[csharp] Support source generator (#16324)

* started source generator

* copy the options

* fixed visibility

* added new sample

* discarded changes to existing samples

* discarded changes to existing samples

* build new sample

* changed package name due to file path length limit

* reverted changes to manual tests

* fixed all new manual tests

* inject contexts into api

* only one JsonConstructor

* fixed spacing

* revert samples for easier merge master

* revert unnecessary change

* fixed formatting

* build samples

* reverting unintended commit

* fixing default value

* reverting unintended commit

* removed debugging lines

* removed unnecessary diff

* address comment
This commit is contained in:
devhl-labs 2023-09-04 22:18:08 -04:00 committed by GitHub
parent 4418b59b47
commit f3eb07408d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
343 changed files with 51012 additions and 9 deletions

View File

@ -0,0 +1,12 @@
# for csharp generichost
generatorName: csharp
outputDir: samples/client/petstore/csharp/OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration
inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
library: generichost
templateDir: modules/openapi-generator/src/main/resources/csharp
additionalProperties:
packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}'
useCompareNetObjects: true
disallowAdditionalPropertiesIfNotPresent: false
useSourceGeneration: true
packageName: UseSourceGeneration

View File

@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|useCollection|Deserialize array types to Collection<T> instead of List<T>.| |false|
|useDateTimeOffset|Use DateTimeOffset to model date-time properties| |false|
|useOneOfDiscriminatorLookup|Use the discriminator's mapping in oneOf to speed up the model lookup. IMPORTANT: Validation (e.g. one and only one match in oneOf's schemas) will be skipped.| |false|
|useSourceGeneration|Use source generation where available (only `generichost` library supports this option).| |false|
|validatable|Generates self-validatable models.| |true|
|zeroBasedEnums|Enumerations with string values will start from 0 when true, 1 when false. If not set, enumerations with string values will start from 0 if the first value is 'unknown', case insensitive.| |null|

View File

@ -59,6 +59,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
protected boolean returnICollection = false;
protected boolean netCoreProjectFileFlag = false;
protected boolean nullReferenceTypesFlag = false;
protected boolean useSourceGeneration = false;
protected String modelPropertyNaming = CodegenConstants.MODEL_PROPERTY_NAMING_TYPE.PascalCase.name();
@ -416,12 +417,15 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
.put("required", new RequiredParameterLambda())
.put("optional", new OptionalParameterLambda().generator(this))
.put("joinWithComma", new JoinWithCommaLambda())
.put("joinLinesWithComma", new JoinWithCommaLambda(false, "\n", ",\n"))
.put("trimLineBreaks", new TrimLineBreaksLambda())
.put("trimTrailingWithNewLine", new TrimTrailingWhiteSpaceLambda(true))
.put("trimTrailing", new TrimTrailingWhiteSpaceLambda(false))
.put("first", new FirstLambda(" "))
.put("firstDot", new FirstLambda("\\."))
.put("indent3", new IndentedLambda(12, " ", false))
.put("indent4", new IndentedLambda(16, " ", false));
.put("indent4", new IndentedLambda(16, " ", false))
.put("uniqueLinesWithNewLine", new UniqueLambda("\n", true));
}
@Override
@ -1350,6 +1354,14 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
return this.nullReferenceTypesFlag;
}
public void setUseSourceGeneration(final Boolean useSourceGeneration) {
this.useSourceGeneration = useSourceGeneration;
}
public boolean getUseSourceGeneration() {
return this.useSourceGeneration;
}
public void setInterfacePrefix(final String interfacePrefix) {
this.interfacePrefix = interfacePrefix;
}

View File

@ -322,6 +322,10 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
CodegenConstants.EQUATABLE_DESC,
this.equatable);
addSwitch("useSourceGeneration",
"Use source generation where available (only `generichost` library supports this option).",
this.getUseSourceGeneration());
supportedLibraries.put(GENERICHOST, "HttpClient with Generic Host dependency injection (https://docs.microsoft.com/en-us/dotnet/core/extensions/generic-host) "
+ "(Experimental. Subject to breaking changes without notice.)");
supportedLibraries.put(HTTPCLIENT, "HttpClient (https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient) "
@ -788,6 +792,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
syncBooleanProperty(additionalProperties, CodegenConstants.NON_PUBLIC_API, this::setNonPublicApi, isNonPublicApi());
syncBooleanProperty(additionalProperties, CodegenConstants.USE_ONEOF_DISCRIMINATOR_LOOKUP, this::setUseOneOfDiscriminatorLookup, this.useOneOfDiscriminatorLookup);
syncBooleanProperty(additionalProperties, "supportsFileParameters", this::setSupportsFileParameters, this.supportsFileParameters);
syncBooleanProperty(additionalProperties, "useSourceGeneration", this::setUseSourceGeneration, this.useSourceGeneration);
final String testPackageName = testPackageName();
String packageFolder = sourceFolder + File.separator + packageName;
@ -855,6 +860,14 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
this.setTypeMapping();
}
@Override
public void setUseSourceGeneration(final Boolean useSourceGeneration) {
if (useSourceGeneration && !this.additionalProperties.containsKey(NET_60_OR_LATER)) {
throw new RuntimeException("Source generation is only compatible with .Net 6 or later.");
}
this.useSourceGeneration = useSourceGeneration;
}
public void setClientPackage(String clientPackage) {
this.clientPackage = clientPackage;
}

View File

@ -38,15 +38,29 @@ import java.io.Writer;
*/
public class JoinWithCommaLambda implements Mustache.Lambda {
public JoinWithCommaLambda() {
private final String delimit;
private final String coalesce;
private final boolean trimInput;
public JoinWithCommaLambda() {
this.delimit = " ";
this.coalesce = ", ";
this.trimInput = true;
}
public JoinWithCommaLambda(boolean trimInput, String delimit, String coalesce) {
this.delimit = delimit;
this.coalesce = coalesce;
this.trimInput = trimInput;
}
@Override
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
String[] substr = fragment.execute().trim().split(" ");
String[] input = this.trimInput
? fragment.execute().trim().split(delimit)
: fragment.execute().split(delimit);
writer.write(String.join(", ", substr));
writer.write(String.join(coalesce, input));
}
}

View File

@ -0,0 +1,64 @@
/*
* Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.openapitools.codegen.templating.mustache;
import com.samskivert.mustache.Mustache;
import com.samskivert.mustache.Template;
import java.io.IOException;
import java.io.Writer;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* Split text by the delimiter and then write only the unique entries
*
* Register:
* <pre>
* additionalProperties.put("unique", new UniqueLambda());
* </pre>
*
* Use:
* <pre>
* {{#unique}}{{name}}{{/unique}}
* </pre>
*/
public class UniqueLambda implements Mustache.Lambda {
private final String delimiter;
private final boolean withNewLine;
public UniqueLambda(String delimiter, boolean withNewLine)
{
this.delimiter = delimiter;
this.withNewLine = withNewLine;
}
@Override
public void execute(Template.Fragment fragment, Writer writer) throws IOException {
String[] parts = fragment.execute().split(this.delimiter);
List<String> uniqueLines = Arrays.stream(parts).distinct().collect(Collectors.toList());
writer.write(String.join(delimiter, uniqueLines));
if (withNewLine) {
writer.write("\n");
}
}
}

View File

@ -110,8 +110,38 @@ namespace {{packageName}}.{{clientPackage}}
/// <summary>
/// The JsonSerialzierOptions
/// </summary>
private System.Text.Json.JsonSerializerOptions _jsonSerializerOptions;
private System.Text.Json.JsonSerializerOptions{{#useSourceGeneration}}{{nrt?}}{{/useSourceGeneration}} _jsonSerializerOptions;
{{#useSourceGeneration}}
/// <summary>
/// The JsonTypeInfo
/// </summary>
private readonly System.Text.Json.Serialization.Metadata.JsonTypeInfo<T>{{nrt?}} _typeInfo;
/// <summary>
/// Construct the response using an HttpResponseMessage
/// </summary>
/// <param name="httpRequestMessage"></param>
/// <param name="httpResponseMessage"></param>
/// <param name="rawContent"></param>
/// <param name="path"></param>
/// <param name="requestedAt"></param>
/// <param name="typeInfo"></param>
public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, string path, DateTime requestedAt, System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> typeInfo)
{
StatusCode = httpResponseMessage.StatusCode;
Headers = httpResponseMessage.Headers;
IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode;
ReasonPhrase = httpResponseMessage.ReasonPhrase;
RawContent = rawContent;
Path = path;
RequestUri = httpRequestMessage.RequestUri;
RequestedAt = requestedAt;
_typeInfo = typeInfo;
OnCreated(httpRequestMessage, httpResponseMessage);
}
{{/useSourceGeneration}}
/// <summary>
/// Construct the response using an HttpResponseMessage
/// </summary>

View File

@ -1,4 +1,14 @@
// This logic may be modified with the AsModel.mustache template
{{^useSourceGeneration}}
return IsSuccessStatusCode
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, _jsonSerializerOptions)
: default(T);
: default(T);
{{/useSourceGeneration}}
{{#useSourceGeneration}}
if (!IsSuccessStatusCode)
return default(T);
return _typeInfo == null
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, _jsonSerializerOptions)
: System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, _typeInfo);
{{/useSourceGeneration}}

View File

@ -48,6 +48,21 @@ namespace {{packageName}}.{{clientPackage}}
{{/models}}
JsonSerializerOptionsProvider jsonSerializerOptionsProvider = new{{^net60OrLater}} JsonSerializerOptionsProvider{{/net60OrLater}}(_jsonOptions);
_services.AddSingleton(jsonSerializerOptionsProvider);
{{#useSourceGeneration}}
{{#models}}
{{#model}}
_services.AddSingleton<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}SerializationContext>();
{{/model}}
{{/models}}
{{#models}}
{{#model}}
_services.AddSingleton<{{datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}DeserializationContext>();
{{/model}}
{{/models}}
{{/useSourceGeneration}}
_services.AddSingleton<IApiFactory, ApiFactory>();{{#apiInfo}}{{#apis}}
_services.AddSingleton<{{classname}}Events>();
_services.AddTransient<{{interfacePrefix}}{{classname}}, {{classname}}>();{{/apis}}{{/apiInfo}}

View File

@ -0,0 +1,34 @@
{{#useSourceGeneration}}
/// <summary>
/// The {{classname}}SerializationContext
/// </summary>
[JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Serialization)]
[JsonSerializable(typeof({{classname}}))]
{{>visibility}} partial class {{classname}}SerializationContext : JsonSerializerContext
{
/// <summary>
/// The {{classname}}SerializationContext
/// </summary>
/// <param name="optionsProvider"></param>
public {{classname}}SerializationContext(JsonSerializerOptionsProvider optionsProvider): base(new(optionsProvider.Options))
{
}
}
/// <summary>
/// {{classname}}DeserializationContext
/// </summary>
[JsonSourceGenerationOptions(WriteIndented = true, GenerationMode = JsonSourceGenerationMode.Metadata)]
[JsonSerializable(typeof({{classname}}))]
{{>visibility}} partial class {{classname}}DeserializationContext : JsonSerializerContext
{
/// <summary>
/// {{classname}}DeserializationContext
/// </summary>
/// <param name="optionsProvider"></param>
public {{classname}}DeserializationContext(JsonSerializerOptionsProvider optionsProvider): base(new(optionsProvider.Options))
{
}
}
{{/useSourceGeneration}}

View File

@ -103,6 +103,19 @@ namespace {{packageName}}.{{apiPackage}}
{{>visibility}} sealed partial class {{classname}} : {{interfacePrefix}}{{classname}}
{
private JsonSerializerOptions _jsonSerializerOptions;
{{#useSourceGeneration}}
{{#lambda.uniqueLinesWithNewLine}}
{{#operation}}
{{#returnProperty}}
{{#isModel}}
{{#returnType}}
private {{{.}}}DeserializationContext _{{#lambda.camelcase_param}}{{{.}}}DeserializationContext{{/lambda.camelcase_param}};
{{/returnType}}
{{/isModel}}
{{/returnProperty}}
{{/operation}}
{{/lambda.uniqueLinesWithNewLine}}
{{/useSourceGeneration}}
/// <summary>
/// The logger
@ -148,7 +161,24 @@ namespace {{packageName}}.{{apiPackage}}
/// Initializes a new instance of the <see cref="{{classname}}"/> class.
/// </summary>
/// <returns></returns>
public {{classname}}(ILogger<{{classname}}> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_param}}{{classname}}Events{{/lambda.camelcase_param}}{{#hasApiKeyMethods}},
public {{classname}}(ILogger<{{classname}}> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider, {{classname}}Events {{#lambda.camelcase_param}}{{classname}}Events{{/lambda.camelcase_param}}{{#lambda.first}}{{#useSourceGeneration}}{{#operation}}{{#returnProperty}}{{#isModel}}, {{/isModel}}{{/returnProperty}}{{/operation}}{{/useSourceGeneration}}{{/lambda.first}}{{#lambda.trimTrailing}}{{#useSourceGeneration}}
{{#lambda.joinLinesWithComma}}
{{#lambda.uniqueLinesWithNewLine}}
{{#operation}}
{{#returnProperty}}
{{#isModel}}
{{#returnType}}
{{{.}}}DeserializationContext {{#lambda.camelcase_param}}{{{.}}}DeserializationContext{{/lambda.camelcase_param}}
{{/returnType}}
{{/isModel}}
{{/returnProperty}}
{{/operation}}
{{/lambda.uniqueLinesWithNewLine}}
{{/lambda.joinLinesWithComma}}
{{/useSourceGeneration}}
{{/lambda.trimTrailing}}
{{#hasApiKeyMethods}}
,
TokenProvider<ApiKeyToken> apiKeyProvider{{/hasApiKeyMethods}}{{#hasHttpBearerMethods}},
TokenProvider<BearerToken> bearerTokenProvider{{/hasHttpBearerMethods}}{{#hasHttpBasicMethods}},
TokenProvider<BasicToken> basicTokenProvider{{/hasHttpBasicMethods}}{{#hasHttpSignatureMethods}},
@ -156,6 +186,19 @@ namespace {{packageName}}.{{apiPackage}}
TokenProvider<OAuthToken> oauthTokenProvider{{/hasOAuthMethods}})
{
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
{{#useSourceGeneration}}
{{#lambda.uniqueLinesWithNewLine}}
{{#operation}}
{{#returnProperty}}
{{#isModel}}
{{#returnType}}
_{{#lambda.camelcase_param}}{{{.}}}DeserializationContext{{/lambda.camelcase_param}} = {{#lambda.camelcase_param}}{{{.}}}DeserializationContext{{/lambda.camelcase_param}};
{{/returnType}}
{{/isModel}}
{{/returnProperty}}
{{/operation}}
{{/lambda.uniqueLinesWithNewLine}}
{{/useSourceGeneration}}
Logger = logger;
HttpClient = httpClient;
Events = {{#lambda.camelcase_param}}{{classname}}Events{{/lambda.camelcase_param}};{{#hasApiKeyMethods}}
@ -539,7 +582,7 @@ namespace {{packageName}}.{{apiPackage}}
{
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync({{#net60OrLater}}cancellationToken{{/net60OrLater}}).ConfigureAwait(false);
ApiResponse<{{{returnType}}}{{^returnType}}object{{/returnType}}> apiResponseLocalVar = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, _jsonSerializerOptions);
ApiResponse<{{{returnType}}}{{^returnType}}object{{/returnType}}> apiResponseLocalVar = new ApiResponse<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}object{{/returnType}}>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, "{{path}}", requestedAtLocalVar, {{^useSourceGeneration}}_jsonSerializerOptions{{/useSourceGeneration}}{{#useSourceGeneration}}{{^returnProperty}}_jsonSerializerOptions{{/returnProperty}}{{#returnProperty}}{{^isModel}}_jsonSerializerOptions{{/isModel}}{{#isModel}}_{{#lambda.camelcase_param}}{{{returnType}}}DeserializationContext{{/lambda.camelcase_param}}.{{{returnType}}}{{/isModel}}{{/returnProperty}}{{/useSourceGeneration}});
After{{operationId}}DefaultImplementation({{#lambda.joinWithComma}}apiResponseLocalVar {{#allParams}}{{paramName}} {{/allParams}}{{/lambda.joinWithComma}});

View File

@ -23,6 +23,12 @@ using System.ComponentModel.DataAnnotations;
{{#useCompareNetObjects}}
using OpenAPIClientUtils = {{packageName}}.Client.ClientUtils;
{{/useCompareNetObjects}}
{{#useGenericHost}}
{{#useSourceGeneration}}
using System.Text.Json.Serialization.Metadata;
using {{packageName}}.{{clientPackage}};
{{/useSourceGeneration}}
{{/useGenericHost}}
{{#models}}
{{#lambda.trimTrailingWithNewLine}}
{{#model}}
@ -37,6 +43,7 @@ namespace {{packageName}}.{{modelPackage}}
{{>JsonConverter}}
{{/isEnum}}
{{>SourceGenerationContext}}
{{/model}}
{{/lambda.trimTrailingWithNewLine}}
{{/models}}

View File

@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="coverlet.collector" Version="3.1.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration\src\UseSourceGeneration\UseSourceGeneration.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,184 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using System.Text.Json;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
using UseSourceGeneration.Extensions;
namespace ManualTests.Latest.UseSourceGeneration;
[TestClass]
public class UnitTest1
{
[TestClass]
public sealed class SerializationTests
{
private readonly IHost _host;
public SerializationTests()
{
IHostBuilder hostBuild = Host.CreateDefaultBuilder(Array.Empty<string>()).ConfigureApi((context, services, options) =>
{
string apiKeyTokenValue = context.Configuration["<token>"] ?? "Token not found.";
ApiKeyToken apiKeyToken = new(apiKeyTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(apiKeyToken);
string bearerTokenValue = context.Configuration["<token>"] ?? "Token not found.";
BearerToken bearerToken = new(bearerTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(bearerToken);
string basicTokenUsername = context.Configuration["<username>"] ?? "Username not found.";
string basicTokenPassword = context.Configuration["<password>"] ?? "Password not found.";
BasicToken basicToken = new(basicTokenUsername, basicTokenPassword, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(basicToken);
HttpSigningConfiguration config = new("<keyId>", "<keyFilePath>", null, new List<string>(), System.Security.Cryptography.HashAlgorithmName.SHA256, "<signingAlgorithm>", 0);
HttpSignatureToken httpSignatureToken = new(config, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(httpSignatureToken);
string oauthTokenValue = context.Configuration["<token>"] ?? "Token not found.";
OAuthToken oauthToken = new(oauthTokenValue, timeout: TimeSpan.FromSeconds(1));
options.AddTokens(oauthToken);
});
_host = hostBuild.Build();
}
[TestMethod]
public void Category()
{
CategorySerializationContext serializationContext = _host.Services.GetRequiredService<CategorySerializationContext>();
CategoryDeserializationContext deserializationContext = _host.Services.GetRequiredService<CategoryDeserializationContext>();
Category category = new(1, "test");
string categoryJson = JsonSerializer.Serialize(category, serializationContext.Category);
Category? category2 = JsonSerializer.Deserialize(categoryJson, deserializationContext.Category);
Assert.AreEqual(category.Id, category2?.Id);
Assert.AreEqual(category.Name, category2?.Name);
}
[TestMethod]
public void Apple()
{
AppleSerializationContext serializationContext = _host.Services.GetRequiredService<AppleSerializationContext>();
AppleDeserializationContext deserializationContext = _host.Services.GetRequiredService<AppleDeserializationContext>();
Apple apple = new("#000000", "cultivar", "origin");
string appleJson = JsonSerializer.Serialize(apple, serializationContext.Apple);
Apple? apple2 = JsonSerializer.Deserialize(appleJson, deserializationContext.Apple);
Assert.IsTrue(apple2 != null && apple.Cultivar.Equals(apple2.Cultivar) && apple.Origin.Equals(apple2.Origin));
}
[TestMethod]
public void Pig()
{
PigSerializationContext serializationContext = _host.Services.GetRequiredService<PigSerializationContext>();
PigDeserializationContext deserializationContext = _host.Services.GetRequiredService<PigDeserializationContext>();
BasquePig basquePig = new("BasquePig");
Pig pig = new(basquePig, "BasquePig");
string pigJson = JsonSerializer.Serialize(pig, serializationContext.Pig);
Pig? pig2 = JsonSerializer.Deserialize<Pig>(pigJson, deserializationContext.Pig);
Assert.IsTrue(
pig.DanishPig == null &&
pig.BasquePig != null &&
pig2 != null &&
pig2.BasquePig != null &&
pig2.DanishPig == null &&
pig2.BasquePig.ClassName.Equals(pig.BasquePig.ClassName));
}
[TestMethod]
public void DanishPig()
{
DanishPigSerializationContext serializationContext = _host.Services.GetRequiredService<DanishPigSerializationContext>();
DanishPigDeserializationContext deserializationContext = _host.Services.GetRequiredService<DanishPigDeserializationContext>();
DanishPig danishPig = new("danishPig");
string danishPigJson = JsonSerializer.Serialize(danishPig, serializationContext.DanishPig);
DanishPig? danishPig2 = JsonSerializer.Deserialize(danishPigJson, deserializationContext.DanishPig);
Assert.IsTrue(danishPig2 != null && danishPig.ClassName.Equals(danishPig2.ClassName));
}
[TestMethod]
public void GmFruit()
{
GmFruitSerializationContext serializationContext = _host.Services.GetRequiredService<GmFruitSerializationContext>();
GmFruitDeserializationContext deserializationContext = _host.Services.GetRequiredService<GmFruitDeserializationContext>();
Apple apple = new("#000000", "cultivar", "origin");
Banana banana = new(10);
GmFruit gmFruit = new(apple, banana, "yellow");
string gmFruitJson = JsonSerializer.Serialize(gmFruit, serializationContext.GmFruit);
GmFruit? gmFruit2 = JsonSerializer.Deserialize<GmFruit>(gmFruitJson, deserializationContext.GmFruit);
Assert.IsTrue(
gmFruit.Apple != null &&
gmFruit.Banana != null &&
gmFruit2 != null &&
gmFruit2.Apple != null &&
gmFruit2.Banana != null &&
gmFruit2.Apple.Cultivar.Equals(gmFruit.Apple.Cultivar) &&
gmFruit2.Apple.Origin.Equals(gmFruit.Apple.Origin) &&
gmFruit2.Banana.LengthCm.Equals(gmFruit.Banana.LengthCm));
Apple? apple2 = JsonSerializer.Deserialize<Apple>(gmFruitJson);
Assert.IsTrue(apple2 != null && apple.Cultivar == apple2.Cultivar && apple.Origin == apple2.Origin);
// TODO: assert the the properties from Banana and GmFruit are in additionalProperties
}
[TestMethod]
public void EquilateralTriangle()
{
EquilateralTriangleSerializationContext serializationContext = _host.Services.GetRequiredService<EquilateralTriangleSerializationContext>();
EquilateralTriangleDeserializationContext deserializationContext = _host.Services.GetRequiredService<EquilateralTriangleDeserializationContext>();
EquilateralTriangle equilateralTriangle = new("triangle", "equilateral");
string equilateralTriangleJson = JsonSerializer.Serialize(equilateralTriangle, serializationContext.EquilateralTriangle);
EquilateralTriangle? equilateralTriangle2 = JsonSerializer.Deserialize(equilateralTriangleJson, deserializationContext.EquilateralTriangle);
Assert.IsTrue(equilateralTriangle2 != null && equilateralTriangle.TriangleType.Equals(equilateralTriangle2.TriangleType) && equilateralTriangle.ShapeType.Equals(equilateralTriangle2.ShapeType));
}
[TestMethod]
public void Quadrilateral()
{
QuadrilateralSerializationContext serializationContext = _host.Services.GetRequiredService<QuadrilateralSerializationContext>();
QuadrilateralDeserializationContext deserializationContext = _host.Services.GetRequiredService<QuadrilateralDeserializationContext>();
ComplexQuadrilateral complexQuadrilateral = new("ComplexQuadrilateral", "shapeType");
Quadrilateral quadrilateral = new(complexQuadrilateral, "ComplexQuadrilateral");
string quadrilateralJson = JsonSerializer.Serialize(quadrilateral, serializationContext.Quadrilateral);
Quadrilateral? quadrilateral2 = JsonSerializer.Deserialize(quadrilateralJson, deserializationContext.Quadrilateral);
Assert.IsTrue(
quadrilateral.ComplexQuadrilateral != null &&
quadrilateral2 != null &&
quadrilateral2.SimpleQuadrilateral == null &&
quadrilateral2.ComplexQuadrilateral != null &&
quadrilateral2.ComplexQuadrilateral.QuadrilateralType.Equals(quadrilateral.ComplexQuadrilateral.QuadrilateralType) &&
quadrilateral2.ComplexQuadrilateral.ShapeType.Equals(quadrilateral.ComplexQuadrilateral.ShapeType));
}
[TestMethod]
public void ChildCatTest()
{
ChildCatSerializationContext serializationContext = _host.Services.GetRequiredService<ChildCatSerializationContext>();
ChildCatDeserializationContext deserializationContext = _host.Services.GetRequiredService<ChildCatDeserializationContext>();
ChildCat childCat = new("some name", ChildCat.PetTypeEnum.ChildCat);
string childCatJson = JsonSerializer.Serialize(childCat, serializationContext.ChildCat);
ChildCat? childCat2 = JsonSerializer.Deserialize(childCatJson, deserializationContext.ChildCat);
Assert.IsTrue(childCat2 != null && childCat.PetType.Equals(childCat2.PetType) && childCat.Name.Equals(childCat2.Name));
}
[TestMethod]
public void Cat()
{
CatSerializationContext serializationContext = _host.Services.GetRequiredService<CatSerializationContext>();
CatDeserializationContext deserializationContext = _host.Services.GetRequiredService<CatDeserializationContext>();
Cat cat = new("cat", false, "black"); // TODO: where is the address property?
string catJson = JsonSerializer.Serialize(cat, serializationContext.Cat);
Cat? cat2 = JsonSerializer.Deserialize(catJson, deserializationContext.Cat);
Assert.IsTrue(cat2 != null && cat.Declawed.Equals(cat2.Declawed) && cat.ClassName.Equals(cat2.ClassName) && cat.Color.Equals(cat2.Color)); // TODO: add the address property
}
}
}

View File

@ -0,0 +1 @@
global using Microsoft.VisualStudio.TestTools.UnitTesting;

View File

@ -3,10 +3,14 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenAPIClient-generichost-manual-tests", "OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj", "{B120BBFD-C287-4235-A7CC-2C5B37601EB1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenAPIClient-generichost-manual-tests", "OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj", "{B120BBFD-C287-4235-A7CC-2C5B37601EB1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Org.OpenAPITools", "..\OpenAPIClient-generichost-net6.0-nrt\src\Org.OpenAPITools\Org.OpenAPITools.csproj", "{C48E5ACD-1ACD-4084-843E-B29DFEE1779C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManualTests.Latest.UseSourceGeneration", "ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj", "{0CDF58C6-300E-4282-99AF-69A92FD6EAA5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UseSourceGeneration", "..\OpenAPIClient-generichost-net6.0-nrt-useSourceGeneration\src\UseSourceGeneration\UseSourceGeneration.csproj", "{39D8167C-2DF8-42E9-92F5-5DA59E7F281B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -21,6 +25,14 @@ Global
{C48E5ACD-1ACD-4084-843E-B29DFEE1779C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C48E5ACD-1ACD-4084-843E-B29DFEE1779C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C48E5ACD-1ACD-4084-843E-B29DFEE1779C}.Release|Any CPU.Build.0 = Release|Any CPU
{0CDF58C6-300E-4282-99AF-69A92FD6EAA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0CDF58C6-300E-4282-99AF-69A92FD6EAA5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0CDF58C6-300E-4282-99AF-69A92FD6EAA5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0CDF58C6-300E-4282-99AF-69A92FD6EAA5}.Release|Any CPU.Build.0 = Release|Any CPU
{39D8167C-2DF8-42E9-92F5-5DA59E7F281B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{39D8167C-2DF8-42E9-92F5-5DA59E7F281B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{39D8167C-2DF8-42E9-92F5-5DA59E7F281B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{39D8167C-2DF8-42E9-92F5-5DA59E7F281B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,362 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd

View File

@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -0,0 +1,228 @@
.gitignore
README.md
UseSourceGeneration.sln
api/openapi.yaml
appveyor.yml
docs/apis/AnotherFakeApi.md
docs/apis/DefaultApi.md
docs/apis/FakeApi.md
docs/apis/FakeClassnameTags123Api.md
docs/apis/PetApi.md
docs/apis/StoreApi.md
docs/apis/UserApi.md
docs/models/Activity.md
docs/models/ActivityOutputElementRepresentation.md
docs/models/AdditionalPropertiesClass.md
docs/models/Animal.md
docs/models/ApiResponse.md
docs/models/Apple.md
docs/models/AppleReq.md
docs/models/ArrayOfArrayOfNumberOnly.md
docs/models/ArrayOfNumberOnly.md
docs/models/ArrayTest.md
docs/models/Banana.md
docs/models/BananaReq.md
docs/models/BasquePig.md
docs/models/Capitalization.md
docs/models/Cat.md
docs/models/Category.md
docs/models/ChildCat.md
docs/models/ClassModel.md
docs/models/ComplexQuadrilateral.md
docs/models/DanishPig.md
docs/models/DateOnlyClass.md
docs/models/DeprecatedObject.md
docs/models/Dog.md
docs/models/Drawing.md
docs/models/EnumArrays.md
docs/models/EnumClass.md
docs/models/EnumTest.md
docs/models/EquilateralTriangle.md
docs/models/File.md
docs/models/FileSchemaTestClass.md
docs/models/Foo.md
docs/models/FooGetDefaultResponse.md
docs/models/FormatTest.md
docs/models/Fruit.md
docs/models/FruitReq.md
docs/models/GmFruit.md
docs/models/GrandparentAnimal.md
docs/models/HasOnlyReadOnly.md
docs/models/HealthCheckResult.md
docs/models/IsoscelesTriangle.md
docs/models/List.md
docs/models/LiteralStringClass.md
docs/models/Mammal.md
docs/models/MapTest.md
docs/models/MixedPropertiesAndAdditionalPropertiesClass.md
docs/models/Model200Response.md
docs/models/ModelClient.md
docs/models/Name.md
docs/models/NotificationtestGetElementsV1ResponseMPayload.md
docs/models/NullableClass.md
docs/models/NullableGuidClass.md
docs/models/NullableShape.md
docs/models/NumberOnly.md
docs/models/ObjectWithDeprecatedFields.md
docs/models/OneOfString.md
docs/models/Order.md
docs/models/OuterComposite.md
docs/models/OuterEnum.md
docs/models/OuterEnumDefaultValue.md
docs/models/OuterEnumInteger.md
docs/models/OuterEnumIntegerDefaultValue.md
docs/models/OuterEnumTest.md
docs/models/ParentPet.md
docs/models/Pet.md
docs/models/Pig.md
docs/models/PolymorphicProperty.md
docs/models/Quadrilateral.md
docs/models/QuadrilateralInterface.md
docs/models/ReadOnlyFirst.md
docs/models/Return.md
docs/models/RolesReportsHash.md
docs/models/RolesReportsHashRole.md
docs/models/ScaleneTriangle.md
docs/models/Shape.md
docs/models/ShapeInterface.md
docs/models/ShapeOrNull.md
docs/models/SimpleQuadrilateral.md
docs/models/SpecialModelName.md
docs/models/Tag.md
docs/models/TestCollectionEndingWithWordList.md
docs/models/TestCollectionEndingWithWordListObject.md
docs/models/Triangle.md
docs/models/TriangleInterface.md
docs/models/User.md
docs/models/Whale.md
docs/models/Zebra.md
docs/models/ZeroBasedEnum.md
docs/models/ZeroBasedEnumClass.md
docs/scripts/git_push.ps1
docs/scripts/git_push.sh
src/UseSourceGeneration.Test/Api/DependencyInjectionTests.cs
src/UseSourceGeneration.Test/README.md
src/UseSourceGeneration.Test/UseSourceGeneration.Test.csproj
src/UseSourceGeneration/Api/AnotherFakeApi.cs
src/UseSourceGeneration/Api/DefaultApi.cs
src/UseSourceGeneration/Api/FakeApi.cs
src/UseSourceGeneration/Api/FakeClassnameTags123Api.cs
src/UseSourceGeneration/Api/IApi.cs
src/UseSourceGeneration/Api/PetApi.cs
src/UseSourceGeneration/Api/StoreApi.cs
src/UseSourceGeneration/Api/UserApi.cs
src/UseSourceGeneration/Client/ApiException.cs
src/UseSourceGeneration/Client/ApiFactory.cs
src/UseSourceGeneration/Client/ApiKeyToken.cs
src/UseSourceGeneration/Client/ApiResponseEventArgs.cs
src/UseSourceGeneration/Client/ApiResponse`1.cs
src/UseSourceGeneration/Client/BasicToken.cs
src/UseSourceGeneration/Client/BearerToken.cs
src/UseSourceGeneration/Client/ClientUtils.cs
src/UseSourceGeneration/Client/CookieContainer.cs
src/UseSourceGeneration/Client/DateTimeJsonConverter.cs
src/UseSourceGeneration/Client/DateTimeNullableJsonConverter.cs
src/UseSourceGeneration/Client/ExceptionEventArgs.cs
src/UseSourceGeneration/Client/HostConfiguration.cs
src/UseSourceGeneration/Client/HttpSigningConfiguration.cs
src/UseSourceGeneration/Client/HttpSigningToken.cs
src/UseSourceGeneration/Client/JsonSerializerOptionsProvider.cs
src/UseSourceGeneration/Client/OAuthToken.cs
src/UseSourceGeneration/Client/Option.cs
src/UseSourceGeneration/Client/RateLimitProvider`1.cs
src/UseSourceGeneration/Client/TokenBase.cs
src/UseSourceGeneration/Client/TokenContainer`1.cs
src/UseSourceGeneration/Client/TokenProvider`1.cs
src/UseSourceGeneration/Extensions/IHostBuilderExtensions.cs
src/UseSourceGeneration/Extensions/IHttpClientBuilderExtensions.cs
src/UseSourceGeneration/Extensions/IServiceCollectionExtensions.cs
src/UseSourceGeneration/Model/Activity.cs
src/UseSourceGeneration/Model/ActivityOutputElementRepresentation.cs
src/UseSourceGeneration/Model/AdditionalPropertiesClass.cs
src/UseSourceGeneration/Model/Animal.cs
src/UseSourceGeneration/Model/ApiResponse.cs
src/UseSourceGeneration/Model/Apple.cs
src/UseSourceGeneration/Model/AppleReq.cs
src/UseSourceGeneration/Model/ArrayOfArrayOfNumberOnly.cs
src/UseSourceGeneration/Model/ArrayOfNumberOnly.cs
src/UseSourceGeneration/Model/ArrayTest.cs
src/UseSourceGeneration/Model/Banana.cs
src/UseSourceGeneration/Model/BananaReq.cs
src/UseSourceGeneration/Model/BasquePig.cs
src/UseSourceGeneration/Model/Capitalization.cs
src/UseSourceGeneration/Model/Cat.cs
src/UseSourceGeneration/Model/Category.cs
src/UseSourceGeneration/Model/ChildCat.cs
src/UseSourceGeneration/Model/ClassModel.cs
src/UseSourceGeneration/Model/ComplexQuadrilateral.cs
src/UseSourceGeneration/Model/DanishPig.cs
src/UseSourceGeneration/Model/DateOnlyClass.cs
src/UseSourceGeneration/Model/DeprecatedObject.cs
src/UseSourceGeneration/Model/Dog.cs
src/UseSourceGeneration/Model/Drawing.cs
src/UseSourceGeneration/Model/EnumArrays.cs
src/UseSourceGeneration/Model/EnumClass.cs
src/UseSourceGeneration/Model/EnumTest.cs
src/UseSourceGeneration/Model/EquilateralTriangle.cs
src/UseSourceGeneration/Model/File.cs
src/UseSourceGeneration/Model/FileSchemaTestClass.cs
src/UseSourceGeneration/Model/Foo.cs
src/UseSourceGeneration/Model/FooGetDefaultResponse.cs
src/UseSourceGeneration/Model/FormatTest.cs
src/UseSourceGeneration/Model/Fruit.cs
src/UseSourceGeneration/Model/FruitReq.cs
src/UseSourceGeneration/Model/GmFruit.cs
src/UseSourceGeneration/Model/GrandparentAnimal.cs
src/UseSourceGeneration/Model/HasOnlyReadOnly.cs
src/UseSourceGeneration/Model/HealthCheckResult.cs
src/UseSourceGeneration/Model/IsoscelesTriangle.cs
src/UseSourceGeneration/Model/List.cs
src/UseSourceGeneration/Model/LiteralStringClass.cs
src/UseSourceGeneration/Model/Mammal.cs
src/UseSourceGeneration/Model/MapTest.cs
src/UseSourceGeneration/Model/MixedPropertiesAndAdditionalPropertiesClass.cs
src/UseSourceGeneration/Model/Model200Response.cs
src/UseSourceGeneration/Model/ModelClient.cs
src/UseSourceGeneration/Model/Name.cs
src/UseSourceGeneration/Model/NotificationtestGetElementsV1ResponseMPayload.cs
src/UseSourceGeneration/Model/NullableClass.cs
src/UseSourceGeneration/Model/NullableGuidClass.cs
src/UseSourceGeneration/Model/NullableShape.cs
src/UseSourceGeneration/Model/NumberOnly.cs
src/UseSourceGeneration/Model/ObjectWithDeprecatedFields.cs
src/UseSourceGeneration/Model/OneOfString.cs
src/UseSourceGeneration/Model/Order.cs
src/UseSourceGeneration/Model/OuterComposite.cs
src/UseSourceGeneration/Model/OuterEnum.cs
src/UseSourceGeneration/Model/OuterEnumDefaultValue.cs
src/UseSourceGeneration/Model/OuterEnumInteger.cs
src/UseSourceGeneration/Model/OuterEnumIntegerDefaultValue.cs
src/UseSourceGeneration/Model/OuterEnumTest.cs
src/UseSourceGeneration/Model/ParentPet.cs
src/UseSourceGeneration/Model/Pet.cs
src/UseSourceGeneration/Model/Pig.cs
src/UseSourceGeneration/Model/PolymorphicProperty.cs
src/UseSourceGeneration/Model/Quadrilateral.cs
src/UseSourceGeneration/Model/QuadrilateralInterface.cs
src/UseSourceGeneration/Model/ReadOnlyFirst.cs
src/UseSourceGeneration/Model/Return.cs
src/UseSourceGeneration/Model/RolesReportsHash.cs
src/UseSourceGeneration/Model/RolesReportsHashRole.cs
src/UseSourceGeneration/Model/ScaleneTriangle.cs
src/UseSourceGeneration/Model/Shape.cs
src/UseSourceGeneration/Model/ShapeInterface.cs
src/UseSourceGeneration/Model/ShapeOrNull.cs
src/UseSourceGeneration/Model/SimpleQuadrilateral.cs
src/UseSourceGeneration/Model/SpecialModelName.cs
src/UseSourceGeneration/Model/Tag.cs
src/UseSourceGeneration/Model/TestCollectionEndingWithWordList.cs
src/UseSourceGeneration/Model/TestCollectionEndingWithWordListObject.cs
src/UseSourceGeneration/Model/Triangle.cs
src/UseSourceGeneration/Model/TriangleInterface.cs
src/UseSourceGeneration/Model/User.cs
src/UseSourceGeneration/Model/Whale.cs
src/UseSourceGeneration/Model/Zebra.cs
src/UseSourceGeneration/Model/ZeroBasedEnum.cs
src/UseSourceGeneration/Model/ZeroBasedEnumClass.cs
src/UseSourceGeneration/README.md
src/UseSourceGeneration/UseSourceGeneration.csproj

View File

@ -0,0 +1 @@
# Created with Openapi Generator

View File

@ -0,0 +1,27 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
VisualStudioVersion = 12.0.0.0
MinimumVisualStudioVersion = 10.0.0.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UseSourceGeneration", "src\UseSourceGeneration\UseSourceGeneration.csproj", "{321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UseSourceGeneration.Test", "src\UseSourceGeneration.Test\UseSourceGeneration.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{321C8C3F-0156-40C1-AE42-D59761FB9B6C}.Release|Any CPU.Build.0 = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,9 @@
# auto-generated by OpenAPI Generator (https://github.com/OpenAPITools/openapi-generator)
#
image: Visual Studio 2019
clone_depth: 1
build_script:
- dotnet build -c Release
- dotnet test -c Release
after_build:
- dotnet pack .\src\UseSourceGeneration\UseSourceGeneration.csproj -o ../../output -c Release --no-build

View File

@ -0,0 +1,99 @@
# UseSourceGeneration.Api.AnotherFakeApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags |
<a id="call123testspecialtags"></a>
# **Call123TestSpecialTags**
> ModelClient Call123TestSpecialTags (ModelClient modelClient)
To test special tags
To test special tags and operation ID starting with number
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class Call123TestSpecialTagsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new AnotherFakeApi(config);
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.Call123TestSpecialTags(modelClient);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTags: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the Call123TestSpecialTagsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// To test special tags
ApiResponse<ModelClient> response = apiInstance.Call123TestSpecialTagsWithHttpInfo(modelClient);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling AnotherFakeApi.Call123TestSpecialTagsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **modelClient** | [**ModelClient**](ModelClient.md) | client model | |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,429 @@
# UseSourceGeneration.Api.DefaultApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**FooGet**](DefaultApi.md#fooget) | **GET** /foo | |
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello |
| [**RolesReportGet**](DefaultApi.md#rolesreportget) | **GET** /roles/report | |
| [**Test**](DefaultApi.md#test) | **GET** /test | Retrieve an existing Notificationtest&#39;s Elements |
<a id="fooget"></a>
# **FooGet**
> FooGetDefaultResponse FooGet ()
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class FooGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
FooGetDefaultResponse result = apiInstance.FooGet();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.FooGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the FooGetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
ApiResponse<FooGetDefaultResponse> response = apiInstance.FooGetWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.FooGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**FooGetDefaultResponse**](FooGetDefaultResponse.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | response | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="getcountry"></a>
# **GetCountry**
> void GetCountry (string country)
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class GetCountryExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
var country = "country_example"; // string |
try
{
apiInstance.GetCountry(country);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.GetCountry: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the GetCountryWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
apiInstance.GetCountryWithHttpInfo(country);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.GetCountryWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **country** | **string** | | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | OK | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="hello"></a>
# **Hello**
> List&lt;Guid&gt; Hello ()
Hello
Hello
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class HelloExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
// Hello
List<Guid> result = apiInstance.Hello();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.Hello: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the HelloWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Hello
ApiResponse<List<Guid>> response = apiInstance.HelloWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.HelloWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**List<Guid>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | UUIDs | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="rolesreportget"></a>
# **RolesReportGet**
> List&lt;List&lt;RolesReportsHash&gt;&gt; RolesReportGet ()
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class RolesReportGetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
List<List<RolesReportsHash>> result = apiInstance.RolesReportGet();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RolesReportGet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the RolesReportGetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
ApiResponse<List<List<RolesReportsHash>>> response = apiInstance.RolesReportGetWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.RolesReportGetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**List<List<RolesReportsHash>>**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | returns report | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="test"></a>
# **Test**
> NotificationtestGetElementsV1ResponseMPayload Test ()
Retrieve an existing Notificationtest's Elements
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class TestExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new DefaultApi(config);
try
{
// Retrieve an existing Notificationtest's Elements
NotificationtestGetElementsV1ResponseMPayload result = apiInstance.Test();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.Test: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the TestWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Retrieve an existing Notificationtest's Elements
ApiResponse<NotificationtestGetElementsV1ResponseMPayload> response = apiInstance.TestWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling DefaultApi.TestWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
[**NotificationtestGetElementsV1ResponseMPayload**](NotificationtestGetElementsV1ResponseMPayload.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | Successful response | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,104 @@
# UseSourceGeneration.Api.FakeClassnameTags123Api
All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case |
<a id="testclassname"></a>
# **TestClassname**
> ModelClient TestClassname (ModelClient modelClient)
To test class name in snake case
To test class name in snake case
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class TestClassnameExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key_query
config.AddApiKey("api_key_query", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key_query", "Bearer");
var apiInstance = new FakeClassnameTags123Api(config);
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test class name in snake case
ModelClient result = apiInstance.TestClassname(modelClient);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassname: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the TestClassnameWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// To test class name in snake case
ApiResponse<ModelClient> response = apiInstance.TestClassnameWithHttpInfo(modelClient);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling FakeClassnameTags123Api.TestClassnameWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **modelClient** | [**ModelClient**](ModelClient.md) | client model | |
### Return type
[**ModelClient**](ModelClient.md)
### Authorization
[api_key_query](../README.md#api_key_query)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,856 @@
# UseSourceGeneration.Api.PetApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**AddPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store |
| [**DeletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet |
| [**FindPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status |
| [**FindPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags |
| [**GetPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID |
| [**UpdatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet |
| [**UpdatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data |
| [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image |
| [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
<a id="addpet"></a>
# **AddPet**
> void AddPet (Pet pet)
Add a new pet to the store
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class AddPetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Add a new pet to the store
apiInstance.AddPet(pet);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.AddPet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the AddPetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Add a new pet to the store
apiInstance.AddPetWithHttpInfo(pet);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.AddPetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | |
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **405** | Invalid input | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="deletepet"></a>
# **DeletePet**
> void DeletePet (long petId, string apiKey = null)
Deletes a pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class DeletePetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // long | Pet id to delete
var apiKey = "apiKey_example"; // string | (optional)
try
{
// Deletes a pet
apiInstance.DeletePet(petId, apiKey);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.DeletePet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the DeletePetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Deletes a pet
apiInstance.DeletePetWithHttpInfo(petId, apiKey);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.DeletePetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **petId** | **long** | Pet id to delete | |
| **apiKey** | **string** | | [optional] |
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid pet value | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="findpetsbystatus"></a>
# **FindPetsByStatus**
> List&lt;Pet&gt; FindPetsByStatus (List<string> status)
Finds Pets by status
Multiple status values can be provided with comma separated strings
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class FindPetsByStatusExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var status = new List<string>(); // List<string> | Status values that need to be considered for filter
try
{
// Finds Pets by status
List<Pet> result = apiInstance.FindPetsByStatus(status);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.FindPetsByStatus: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the FindPetsByStatusWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Finds Pets by status
ApiResponse<List<Pet>> response = apiInstance.FindPetsByStatusWithHttpInfo(status);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.FindPetsByStatusWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **status** | [**List&lt;string&gt;**](string.md) | Status values that need to be considered for filter | |
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid status value | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="findpetsbytags"></a>
# **FindPetsByTags**
> List&lt;Pet&gt; FindPetsByTags (List<string> tags)
Finds Pets by tags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class FindPetsByTagsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var tags = new List<string>(); // List<string> | Tags to filter by
try
{
// Finds Pets by tags
List<Pet> result = apiInstance.FindPetsByTags(tags);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.FindPetsByTags: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the FindPetsByTagsWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Finds Pets by tags
ApiResponse<List<Pet>> response = apiInstance.FindPetsByTagsWithHttpInfo(tags);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.FindPetsByTagsWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **tags** | [**List&lt;string&gt;**](string.md) | Tags to filter by | |
### Return type
[**List&lt;Pet&gt;**](Pet.md)
### Authorization
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid tag value | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="getpetbyid"></a>
# **GetPetById**
> Pet GetPetById (long petId)
Find pet by ID
Returns a single pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class GetPetByIdExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet to return
try
{
// Find pet by ID
Pet result = apiInstance.GetPetById(petId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.GetPetById: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the GetPetByIdWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Find pet by ID
ApiResponse<Pet> response = apiInstance.GetPetByIdWithHttpInfo(petId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.GetPetByIdWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **petId** | **long** | ID of pet to return | |
### Return type
[**Pet**](Pet.md)
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid ID supplied | - |
| **404** | Pet not found | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="updatepet"></a>
# **UpdatePet**
> void UpdatePet (Pet pet)
Update an existing pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class UpdatePetExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Update an existing pet
apiInstance.UpdatePet(pet);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UpdatePet: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the UpdatePetWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Update an existing pet
apiInstance.UpdatePetWithHttpInfo(pet);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UpdatePetWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **pet** | [**Pet**](Pet.md) | Pet object that needs to be added to the store | |
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth), [http_signature_test](../README.md#http_signature_test)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid ID supplied | - |
| **404** | Pet not found | - |
| **405** | Validation exception | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="updatepetwithform"></a>
# **UpdatePetWithForm**
> void UpdatePetWithForm (long petId, string name = null, string status = null)
Updates a pet in the store with form data
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class UpdatePetWithFormExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet that needs to be updated
var name = "name_example"; // string | Updated name of the pet (optional)
var status = "status_example"; // string | Updated status of the pet (optional)
try
{
// Updates a pet in the store with form data
apiInstance.UpdatePetWithForm(petId, name, status);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UpdatePetWithForm: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the UpdatePetWithFormWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Updates a pet in the store with form data
apiInstance.UpdatePetWithFormWithHttpInfo(petId, name, status);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UpdatePetWithFormWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **petId** | **long** | ID of pet that needs to be updated | |
| **name** | **string** | Updated name of the pet | [optional] |
| **status** | **string** | Updated status of the pet | [optional] |
### Return type
void (empty response body)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **405** | Invalid input | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="uploadfile"></a>
# **UploadFile**
> ApiResponse UploadFile (long petId, System.IO.Stream file = null, string additionalMetadata = null)
uploads an image
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class UploadFileExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var petId = 789L; // long | ID of pet to update
var file = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload (optional)
var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
try
{
// uploads an image
ApiResponse result = apiInstance.UploadFile(petId, file, additionalMetadata);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UploadFile: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the UploadFileWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// uploads an image
ApiResponse<ApiResponse> response = apiInstance.UploadFileWithHttpInfo(petId, file, additionalMetadata);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UploadFileWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **petId** | **long** | ID of pet to update | |
| **file** | **System.IO.Stream****System.IO.Stream** | file to upload | [optional] |
| **additionalMetadata** | **string** | Additional data to pass to server | [optional] |
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="uploadfilewithrequiredfile"></a>
# **UploadFileWithRequiredFile**
> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string additionalMetadata = null)
uploads an image (required)
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class UploadFileWithRequiredFileExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure OAuth2 access token for authorization: petstore_auth
config.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi(config);
var requiredFile = new System.IO.MemoryStream(System.IO.File.ReadAllBytes("/path/to/file.txt")); // System.IO.Stream | file to upload
var petId = 789L; // long | ID of pet to update
var additionalMetadata = "additionalMetadata_example"; // string | Additional data to pass to server (optional)
try
{
// uploads an image (required)
ApiResponse result = apiInstance.UploadFileWithRequiredFile(requiredFile, petId, additionalMetadata);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFile: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the UploadFileWithRequiredFileWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// uploads an image (required)
ApiResponse<ApiResponse> response = apiInstance.UploadFileWithRequiredFileWithHttpInfo(requiredFile, petId, additionalMetadata);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PetApi.UploadFileWithRequiredFileWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **requiredFile** | **System.IO.Stream****System.IO.Stream** | file to upload | |
| **petId** | **long** | ID of pet to update | |
| **additionalMetadata** | **string** | Additional data to pass to server | [optional] |
### Return type
[**ApiResponse**](ApiResponse.md)
### Authorization
[petstore_auth](../README.md#petstore_auth)
### HTTP request headers
- **Content-Type**: multipart/form-data
- **Accept**: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,373 @@
# UseSourceGeneration.Api.StoreApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**DeleteOrder**](StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID |
| [**GetInventory**](StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status |
| [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID |
| [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet |
<a id="deleteorder"></a>
# **DeleteOrder**
> void DeleteOrder (string orderId)
Delete purchase order by ID
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class DeleteOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = "orderId_example"; // string | ID of the order that needs to be deleted
try
{
// Delete purchase order by ID
apiInstance.DeleteOrder(orderId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.DeleteOrder: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the DeleteOrderWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Delete purchase order by ID
apiInstance.DeleteOrderWithHttpInfo(orderId);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.DeleteOrderWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **orderId** | **string** | ID of the order that needs to be deleted | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid ID supplied | - |
| **404** | Order not found | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="getinventory"></a>
# **GetInventory**
> Dictionary&lt;string, int&gt; GetInventory ()
Returns pet inventories by status
Returns a map of status codes to quantities
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class GetInventoryExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
// Configure API key authorization: api_key
config.AddApiKey("api_key", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("api_key", "Bearer");
var apiInstance = new StoreApi(config);
try
{
// Returns pet inventories by status
Dictionary<string, int> result = apiInstance.GetInventory();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.GetInventory: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the GetInventoryWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Returns pet inventories by status
ApiResponse<Dictionary<string, int>> response = apiInstance.GetInventoryWithHttpInfo();
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.GetInventoryWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
**Dictionary<string, int>**
### Authorization
[api_key](../README.md#api_key)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="getorderbyid"></a>
# **GetOrderById**
> Order GetOrderById (long orderId)
Find purchase order by ID
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class GetOrderByIdExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var orderId = 789L; // long | ID of pet that needs to be fetched
try
{
// Find purchase order by ID
Order result = apiInstance.GetOrderById(orderId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.GetOrderById: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the GetOrderByIdWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Find purchase order by ID
ApiResponse<Order> response = apiInstance.GetOrderByIdWithHttpInfo(orderId);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.GetOrderByIdWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **orderId** | **long** | ID of pet that needs to be fetched | |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid ID supplied | - |
| **404** | Order not found | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="placeorder"></a>
# **PlaceOrder**
> Order PlaceOrder (Order order)
Place an order for a pet
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class PlaceOrderExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new StoreApi(config);
var order = new Order(); // Order | order placed for purchasing the pet
try
{
// Place an order for a pet
Order result = apiInstance.PlaceOrder(order);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.PlaceOrder: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the PlaceOrderWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Place an order for a pet
ApiResponse<Order> response = apiInstance.PlaceOrderWithHttpInfo(order);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling StoreApi.PlaceOrderWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **order** | [**Order**](Order.md) | order placed for purchasing the pet | |
### Return type
[**Order**](Order.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid Order | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,713 @@
# UseSourceGeneration.Api.UserApi
All URIs are relative to *http://petstore.swagger.io:80/v2*
| Method | HTTP request | Description |
|--------|--------------|-------------|
| [**CreateUser**](UserApi.md#createuser) | **POST** /user | Create user |
| [**CreateUsersWithArrayInput**](UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array |
| [**CreateUsersWithListInput**](UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array |
| [**DeleteUser**](UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user |
| [**GetUserByName**](UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name |
| [**LoginUser**](UserApi.md#loginuser) | **GET** /user/login | Logs user into the system |
| [**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session |
| [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user |
<a id="createuser"></a>
# **CreateUser**
> void CreateUser (User user)
Create user
This can only be done by the logged in user.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class CreateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new User(); // User | Created user object
try
{
// Create user
apiInstance.CreateUser(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the CreateUserWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Create user
apiInstance.CreateUserWithHttpInfo(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **user** | [**User**](User.md) | Created user object | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="createuserswitharrayinput"></a>
# **CreateUsersWithArrayInput**
> void CreateUsersWithArrayInput (List<User> user)
Creates list of users with given input array
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class CreateUsersWithArrayInputExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithArrayInput(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInput: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the CreateUsersWithArrayInputWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithArrayInputWithHttpInfo(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUsersWithArrayInputWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **user** | [**List&lt;User&gt;**](User.md) | List of user object | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="createuserswithlistinput"></a>
# **CreateUsersWithListInput**
> void CreateUsersWithListInput (List<User> user)
Creates list of users with given input array
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class CreateUsersWithListInputExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithListInput(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUsersWithListInput: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the CreateUsersWithListInputWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithListInputWithHttpInfo(user);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUsersWithListInputWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **user** | [**List&lt;User&gt;**](User.md) | List of user object | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="deleteuser"></a>
# **DeleteUser**
> void DeleteUser (string username)
Delete user
This can only be done by the logged in user.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class DeleteUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = "username_example"; // string | The name that needs to be deleted
try
{
// Delete user
apiInstance.DeleteUser(username);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.DeleteUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the DeleteUserWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Delete user
apiInstance.DeleteUserWithHttpInfo(username);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.DeleteUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **username** | **string** | The name that needs to be deleted | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid username supplied | - |
| **404** | User not found | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="getuserbyname"></a>
# **GetUserByName**
> User GetUserByName (string username)
Get user by user name
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class GetUserByNameExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing.
try
{
// Get user by user name
User result = apiInstance.GetUserByName(username);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.GetUserByName: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the GetUserByNameWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Get user by user name
ApiResponse<User> response = apiInstance.GetUserByNameWithHttpInfo(username);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.GetUserByNameWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **username** | **string** | The name that needs to be fetched. Use user1 for testing. | |
### Return type
[**User**](User.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | - |
| **400** | Invalid username supplied | - |
| **404** | User not found | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="loginuser"></a>
# **LoginUser**
> string LoginUser (string username, string password)
Logs user into the system
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class LoginUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var username = "username_example"; // string | The user name for login
var password = "password_example"; // string | The password for login in clear text
try
{
// Logs user into the system
string result = apiInstance.LoginUser(username, password);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.LoginUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the LoginUserWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Logs user into the system
ApiResponse<string> response = apiInstance.LoginUserWithHttpInfo(username, password);
Debug.Write("Status Code: " + response.StatusCode);
Debug.Write("Response Headers: " + response.Headers);
Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.LoginUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **username** | **string** | The user name for login | |
| **password** | **string** | The password for login in clear text | |
### Return type
**string**
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **200** | successful operation | * X-Rate-Limit - calls per hour allowed by the user <br> * X-Expires-After - date in UTC when token expires <br> |
| **400** | Invalid username/password supplied | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="logoutuser"></a>
# **LogoutUser**
> void LogoutUser ()
Logs out current logged in user session
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class LogoutUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
try
{
// Logs out current logged in user session
apiInstance.LogoutUser();
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.LogoutUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the LogoutUserWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Logs out current logged in user session
apiInstance.LogoutUserWithHttpInfo();
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.LogoutUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
This endpoint does not need any parameter.
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **0** | successful operation | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)
<a id="updateuser"></a>
# **UpdateUser**
> void UpdateUser (User user, string username)
Updated user
This can only be done by the logged in user.
### Example
```csharp
using System.Collections.Generic;
using System.Diagnostics;
using UseSourceGeneration.Api;
using UseSourceGeneration.Client;
using UseSourceGeneration.Model;
namespace Example
{
public class UpdateUserExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://petstore.swagger.io:80/v2";
var apiInstance = new UserApi(config);
var user = new User(); // User | Updated user object
var username = "username_example"; // string | name that need to be deleted
try
{
// Updated user
apiInstance.UpdateUser(user, username);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.UpdateUser: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```
#### Using the UpdateUserWithHttpInfo variant
This returns an ApiResponse object which contains the response data, status code and headers.
```csharp
try
{
// Updated user
apiInstance.UpdateUserWithHttpInfo(user, username);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.UpdateUserWithHttpInfo: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
```
### Parameters
| Name | Type | Description | Notes |
|------|------|-------------|-------|
| **user** | [**User**](User.md) | Updated user object | |
| **username** | **string** | name that need to be deleted | |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
| **400** | Invalid user supplied | - |
| **404** | User not found | - |
[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../README.md#documentation-for-models) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.Activity
test map of maps
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ActivityOutputs** | **Dictionary&lt;string, List&lt;ActivityOutputElementRepresentation&gt;&gt;** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.ActivityOutputElementRepresentation
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Prop1** | **string** | | [optional]
**Prop2** | **Object** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,17 @@
# UseSourceGeneration.Model.AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EmptyMap** | **Object** | an object with no declared properties and no undeclared properties, hence it&#39;s an empty map. | [optional]
**MapOfMapProperty** | **Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;** | | [optional]
**MapProperty** | **Dictionary&lt;string, string&gt;** | | [optional]
**MapWithUndeclaredPropertiesAnytype1** | **Object** | | [optional]
**MapWithUndeclaredPropertiesAnytype2** | **Object** | | [optional]
**MapWithUndeclaredPropertiesAnytype3** | **Dictionary&lt;string, Object&gt;** | | [optional]
**MapWithUndeclaredPropertiesString** | **Dictionary&lt;string, string&gt;** | | [optional]
**Anytype1** | **Object** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.ApiResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Code** | **int** | | [optional]
**Message** | **string** | | [optional]
**Type** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.Apple
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ColorCode** | **string** | | [optional]
**Cultivar** | **string** | | [optional]
**Origin** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.AppleReq
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Cultivar** | **string** | |
**Mealy** | **bool** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayArrayNumber** | **List&lt;List&lt;decimal&gt;&gt;** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayNumber** | **List&lt;decimal&gt;** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayArrayOfInteger** | **List&lt;List&lt;long&gt;&gt;** | | [optional]
**ArrayArrayOfModel** | **List&lt;List&lt;ReadOnlyFirst&gt;&gt;** | | [optional]
**ArrayOfString** | **List&lt;string&gt;** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.Banana
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**LengthCm** | **decimal** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.BananaReq
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**LengthCm** | **decimal** | |
**Sweet** | **bool** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.BasquePig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,15 @@
# UseSourceGeneration.Model.Capitalization
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ATT_NAME** | **string** | Name of the pet | [optional]
**CapitalCamel** | **string** | | [optional]
**CapitalSnake** | **string** | | [optional]
**SCAETHFlowPoints** | **string** | | [optional]
**SmallCamel** | **string** | | [optional]
**SmallSnake** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**Declawed** | **bool** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.Category
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **long** | | [optional]
**Name** | **string** | | [default to "default-name"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.ChildCat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
**PetType** | **string** | | [optional] [default to PetTypeEnum.ChildCat]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.ClassModel
Model for testing model with \"_class\" property
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VarClass** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.ComplexQuadrilateral
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**QuadrilateralType** | **string** | |
**ShapeType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.DanishPig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.DateOnlyClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**DateOnlyProperty** | **DateTime** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.DeprecatedObject
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
**Color** | **string** | | [optional] [default to "red"]
**Breed** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,13 @@
# UseSourceGeneration.Model.Drawing
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MainShape** | [**Shape**](Shape.md) | | [optional]
**Shapes** | [**List&lt;Shape&gt;**](Shape.md) | | [optional]
**NullableShape** | [**NullableShape**](NullableShape.md) | | [optional]
**ShapeOrNull** | [**ShapeOrNull**](ShapeOrNull.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayEnum** | **List&lt;EnumArrays.ArrayEnumEnum&gt;** | | [optional]
**JustSymbol** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.EnumClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,18 @@
# UseSourceGeneration.Model.EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EnumInteger** | **int** | | [optional]
**EnumIntegerOnly** | **int** | | [optional]
**EnumNumber** | **double** | | [optional]
**EnumString** | **string** | | [optional]
**EnumStringRequired** | **string** | |
**OuterEnumDefaultValue** | **OuterEnumDefaultValue** | | [optional]
**OuterEnumInteger** | **OuterEnumInteger** | | [optional]
**OuterEnumIntegerDefaultValue** | **OuterEnumIntegerDefaultValue** | | [optional]
**OuterEnum** | **OuterEnum** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.EquilateralTriangle
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.File
Must be named `File` for test.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SourceURI** | **string** | Test capitalization | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.FileSchemaTestClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**File** | [**File**](File.md) | | [optional]
**Files** | [**List&lt;File&gt;**](File.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.Foo
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [default to "bar"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.FooGetDefaultResponse
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VarString** | [**Foo**](Foo.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,28 @@
# UseSourceGeneration.Model.FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Binary** | **System.IO.Stream** | | [optional]
**VarByte** | **byte[]** | |
**Date** | **DateTime** | |
**DateTime** | **DateTime** | | [optional]
**VarDecimal** | **decimal** | | [optional]
**VarDouble** | **double** | | [optional]
**VarFloat** | **float** | | [optional]
**Int32** | **int** | | [optional]
**Int64** | **long** | | [optional]
**Integer** | **int** | | [optional]
**Number** | **decimal** | |
**Password** | **string** | |
**PatternWithBackslash** | **string** | None | [optional]
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**PatternWithDigitsAndDelimiter** | **string** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
**VarString** | **string** | | [optional]
**UnsignedInteger** | **uint** | | [optional]
**UnsignedLong** | **ulong** | | [optional]
**Uuid** | **Guid** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.Fruit
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Color** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.FruitReq
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.GmFruit
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Color** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.GrandparentAnimal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**PetType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [readonly]
**Foo** | **string** | | [optional] [readonly]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.HealthCheckResult
Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**NullableMessage** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.IsoscelesTriangle
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
**TriangleType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.List
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Var123List** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.LiteralStringClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EscapedLiteralString** | **string** | | [optional] [default to "C:\\Users\\username"]
**UnescapedLiteralString** | **string** | | [optional] [default to "C:\Users\username"]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.Mammal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,13 @@
# UseSourceGeneration.Model.MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**DirectMap** | **Dictionary&lt;string, bool&gt;** | | [optional]
**IndirectMap** | **Dictionary&lt;string, bool&gt;** | | [optional]
**MapMapOfString** | **Dictionary&lt;string, Dictionary&lt;string, string&gt;&gt;** | | [optional]
**MapOfEnumString** | **Dictionary&lt;string, MapTest.InnerEnum&gt;** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,13 @@
# UseSourceGeneration.Model.MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**DateTime** | **DateTime** | | [optional]
**Map** | [**Dictionary&lt;string, Animal&gt;**](Animal.md) | | [optional]
**Uuid** | **Guid** | | [optional]
**UuidWithPattern** | **Guid** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.Model200Response
Model for testing model name starting with number
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VarClass** | **string** | | [optional]
**Name** | **int** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.ModelClient
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VarClient** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,14 @@
# UseSourceGeneration.Model.Name
Model for testing model name same as property name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**VarName** | **int** | |
**Property** | **string** | | [optional]
**SnakeCase** | **int** | | [optional] [readonly]
**Var123Number** | **int** | | [optional] [readonly]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.NotificationtestGetElementsV1ResponseMPayload
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AObjVariableobject** | **List&lt;Dictionary&lt;string, Object&gt;&gt;** | |
**PkiNotificationtestID** | **int** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,21 @@
# UseSourceGeneration.Model.NullableClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayItemsNullable** | **List&lt;Object&gt;** | | [optional]
**ObjectItemsNullable** | **Dictionary&lt;string, Object&gt;** | | [optional]
**ArrayAndItemsNullableProp** | **List&lt;Object&gt;** | | [optional]
**ArrayNullableProp** | **List&lt;Object&gt;** | | [optional]
**BooleanProp** | **bool** | | [optional]
**DateProp** | **DateTime** | | [optional]
**DatetimeProp** | **DateTime** | | [optional]
**IntegerProp** | **int** | | [optional]
**NumberProp** | **decimal** | | [optional]
**ObjectAndItemsNullableProp** | **Dictionary&lt;string, Object&gt;** | | [optional]
**ObjectNullableProp** | **Dictionary&lt;string, Object&gt;** | | [optional]
**StringProp** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.NullableGuidClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | **Guid** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.NullableShape
The value may be a shape or the 'null' value. The 'nullable' attribute was introduced in OAS schema >= 3.0 and has been deprecated in OAS schema >= 3.1.
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ShapeType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustNumber** | **decimal** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,13 @@
# UseSourceGeneration.Model.ObjectWithDeprecatedFields
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bars** | **List&lt;string&gt;** | | [optional]
**DeprecatedRef** | [**DeprecatedObject**](DeprecatedObject.md) | | [optional]
**Id** | **decimal** | | [optional]
**Uuid** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.OneOfString
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,15 @@
# UseSourceGeneration.Model.Order
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Id** | **long** | | [optional]
**PetId** | **long** | | [optional]
**Quantity** | **int** | | [optional]
**ShipDate** | **DateTime** | | [optional]
**Status** | **string** | Order Status | [optional]
**Complete** | **bool** | | [optional] [default to false]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,12 @@
# UseSourceGeneration.Model.OuterComposite
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MyBoolean** | **bool** | | [optional]
**MyNumber** | **decimal** | | [optional]
**MyString** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.OuterEnum
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.OuterEnumDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.OuterEnumInteger
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.OuterEnumIntegerDefaultValue
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.OuterEnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.ParentPet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**PetType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,15 @@
# UseSourceGeneration.Model.Pet
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Category** | [**Category**](Category.md) | | [optional]
**Id** | **long** | | [optional]
**Name** | **string** | |
**PhotoUrls** | **List&lt;string&gt;** | |
**Status** | **string** | pet status in the store | [optional]
**Tags** | [**List&lt;Tag&gt;**](Tag.md) | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.Pig
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,9 @@
# UseSourceGeneration.Model.PolymorphicProperty
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.Quadrilateral
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,10 @@
# UseSourceGeneration.Model.QuadrilateralInterface
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**QuadrilateralType** | **string** | |
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

View File

@ -0,0 +1,11 @@
# UseSourceGeneration.Model.ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [readonly]
**Baz** | **string** | | [optional]
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

Some files were not shown because too many files have changed in this diff Show More