mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-19 21:47:13 +00:00
[C#] fix validate (#16097)
* fix validation with discriminator using parent instead * add new files * add new workflow * fix
This commit is contained in:
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using Xunit;
|
||||
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Api;
|
||||
// uncomment below to import models
|
||||
//using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing BodyApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
public class BodyApiTests : IDisposable
|
||||
{
|
||||
private BodyApi instance;
|
||||
|
||||
public BodyApiTests()
|
||||
{
|
||||
instance = new BodyApi();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of BodyApi
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void InstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test 'IsType' BodyApi
|
||||
//Assert.IsType<BodyApi>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestBinaryGif
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestBinaryGifTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//var response = instance.TestBinaryGif();
|
||||
//Assert.IsType<System.IO.Stream>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestBodyApplicationOctetstreamBinary
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestBodyApplicationOctetstreamBinaryTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//System.IO.Stream? body = null;
|
||||
//var response = instance.TestBodyApplicationOctetstreamBinary(body);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestEchoBodyFreeFormObjectResponseString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestEchoBodyFreeFormObjectResponseStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//Object? body = null;
|
||||
//var response = instance.TestEchoBodyFreeFormObjectResponseString(body);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestEchoBodyPet
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestEchoBodyPetTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//Pet? pet = null;
|
||||
//var response = instance.TestEchoBodyPet(pet);
|
||||
//Assert.IsType<Pet>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestEchoBodyPetResponseString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestEchoBodyPetResponseStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//Pet? pet = null;
|
||||
//var response = instance.TestEchoBodyPetResponseString(pet);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestEchoBodyTagResponseString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestEchoBodyTagResponseStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//Tag? tag = null;
|
||||
//var response = instance.TestEchoBodyTagResponseString(tag);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using Xunit;
|
||||
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Api;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing FormApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
public class FormApiTests : IDisposable
|
||||
{
|
||||
private FormApi instance;
|
||||
|
||||
public FormApiTests()
|
||||
{
|
||||
instance = new FormApi();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of FormApi
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void InstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test 'IsType' FormApi
|
||||
//Assert.IsType<FormApi>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestFormIntegerBooleanString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestFormIntegerBooleanStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//int? integerForm = null;
|
||||
//bool? booleanForm = null;
|
||||
//string? stringForm = null;
|
||||
//var response = instance.TestFormIntegerBooleanString(integerForm, booleanForm, stringForm);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using Xunit;
|
||||
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Api;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing HeaderApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
public class HeaderApiTests : IDisposable
|
||||
{
|
||||
private HeaderApi instance;
|
||||
|
||||
public HeaderApiTests()
|
||||
{
|
||||
instance = new HeaderApi();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of HeaderApi
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void InstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test 'IsType' HeaderApi
|
||||
//Assert.IsType<HeaderApi>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestHeaderIntegerBooleanString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestHeaderIntegerBooleanStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//int? integerHeader = null;
|
||||
//bool? booleanHeader = null;
|
||||
//string? stringHeader = null;
|
||||
//var response = instance.TestHeaderIntegerBooleanString(integerHeader, booleanHeader, stringHeader);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using Xunit;
|
||||
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Api;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing PathApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
public class PathApiTests : IDisposable
|
||||
{
|
||||
private PathApi instance;
|
||||
|
||||
public PathApiTests()
|
||||
{
|
||||
instance = new PathApi();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of PathApi
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void InstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test 'IsType' PathApi
|
||||
//Assert.IsType<PathApi>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestsPathStringPathStringIntegerPathInteger
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestsPathStringPathStringIntegerPathIntegerTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//string pathString = null;
|
||||
//int pathInteger = null;
|
||||
//var response = instance.TestsPathStringPathStringIntegerPathInteger(pathString, pathInteger);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using RestSharp;
|
||||
using Xunit;
|
||||
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Api;
|
||||
// uncomment below to import models
|
||||
//using Org.OpenAPITools.Model;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing QueryApi
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the API endpoint.
|
||||
/// </remarks>
|
||||
public class QueryApiTests : IDisposable
|
||||
{
|
||||
private QueryApi instance;
|
||||
|
||||
public QueryApiTests()
|
||||
{
|
||||
instance = new QueryApi();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of QueryApi
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void InstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test 'IsType' QueryApi
|
||||
//Assert.IsType<QueryApi>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestEnumRefString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestEnumRefStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//StringEnumRef? enumRefStringQuery = null;
|
||||
//var response = instance.TestEnumRefString(enumRefStringQuery);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryDatetimeDateString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryDatetimeDateStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//DateTime? datetimeQuery = null;
|
||||
//DateTime? dateQuery = null;
|
||||
//string? stringQuery = null;
|
||||
//var response = instance.TestQueryDatetimeDateString(datetimeQuery, dateQuery, stringQuery);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryIntegerBooleanString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryIntegerBooleanStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//int? integerQuery = null;
|
||||
//bool? booleanQuery = null;
|
||||
//string? stringQuery = null;
|
||||
//var response = instance.TestQueryIntegerBooleanString(integerQuery, booleanQuery, stringQuery);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryStyleDeepObjectExplodeTrueObject
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleDeepObjectExplodeTrueObjectTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//Pet? queryObject = null;
|
||||
//var response = instance.TestQueryStyleDeepObjectExplodeTrueObject(queryObject);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryStyleDeepObjectExplodeTrueObjectAllOf
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleDeepObjectExplodeTrueObjectAllOfTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter? queryObject = null;
|
||||
//var response = instance.TestQueryStyleDeepObjectExplodeTrueObjectAllOf(queryObject);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryStyleFormExplodeTrueArrayString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleFormExplodeTrueArrayStringTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter? queryObject = null;
|
||||
//var response = instance.TestQueryStyleFormExplodeTrueArrayString(queryObject);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryStyleFormExplodeTrueObject
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleFormExplodeTrueObjectTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//Pet? queryObject = null;
|
||||
//var response = instance.TestQueryStyleFormExplodeTrueObject(queryObject);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test TestQueryStyleFormExplodeTrueObjectAllOf
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleFormExplodeTrueObjectAllOfTest()
|
||||
{
|
||||
// TODO uncomment below to test the method and replace null with proper value
|
||||
//DataQuery? queryObject = null;
|
||||
//var response = instance.TestQueryStyleFormExplodeTrueObjectAllOf(queryObject);
|
||||
//Assert.IsType<string>(response);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Bird
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class BirdTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for Bird
|
||||
//private Bird instance;
|
||||
|
||||
public BirdTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of Bird
|
||||
//instance = new Bird();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Bird
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void BirdInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" Bird
|
||||
//Assert.IsType<Bird>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Size'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SizeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Size'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Color'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ColorTest()
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Category
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class CategoryTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for Category
|
||||
//private Category instance;
|
||||
|
||||
public CategoryTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of Category
|
||||
//instance = new Category();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Category
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CategoryInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" Category
|
||||
//Assert.IsType<Category>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing DataQuery
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class DataQueryTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for DataQuery
|
||||
//private DataQuery instance;
|
||||
|
||||
public DataQueryTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of DataQuery
|
||||
//instance = new DataQuery();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of DataQuery
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DataQueryInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" DataQuery
|
||||
//Assert.IsType<DataQuery>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Suffix'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SuffixTest()
|
||||
{
|
||||
// TODO unit test for the property 'Suffix'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Text'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TextTest()
|
||||
{
|
||||
// TODO unit test for the property 'Text'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Date'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DateTest()
|
||||
{
|
||||
// TODO unit test for the property 'Date'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing DefaultValue
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class DefaultValueTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for DefaultValue
|
||||
//private DefaultValue instance;
|
||||
|
||||
public DefaultValueTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of DefaultValue
|
||||
//instance = new DefaultValue();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of DefaultValue
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void DefaultValueInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" DefaultValue
|
||||
//Assert.IsType<DefaultValue>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayStringEnumRefDefault'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayStringEnumRefDefaultTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayStringEnumRefDefault'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayStringEnumDefault'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayStringEnumDefaultTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayStringEnumDefault'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayStringDefault'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayStringDefaultTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayStringDefault'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayIntegerDefault'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayIntegerDefaultTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayIntegerDefault'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayString'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayStringTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayString'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayStringNullable'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayStringNullableTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayStringNullable'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'ArrayStringExtensionNullable'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ArrayStringExtensionNullableTest()
|
||||
{
|
||||
// TODO unit test for the property 'ArrayStringExtensionNullable'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'StringNullable'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void StringNullableTest()
|
||||
{
|
||||
// TODO unit test for the property 'StringNullable'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing NumberPropertiesOnly
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class NumberPropertiesOnlyTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for NumberPropertiesOnly
|
||||
//private NumberPropertiesOnly instance;
|
||||
|
||||
public NumberPropertiesOnlyTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of NumberPropertiesOnly
|
||||
//instance = new NumberPropertiesOnly();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of NumberPropertiesOnly
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NumberPropertiesOnlyInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" NumberPropertiesOnly
|
||||
//Assert.IsType<NumberPropertiesOnly>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Number'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NumberTest()
|
||||
{
|
||||
// TODO unit test for the property 'Number'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'VarFloat'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void VarFloatTest()
|
||||
{
|
||||
// TODO unit test for the property 'VarFloat'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'VarDouble'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void VarDoubleTest()
|
||||
{
|
||||
// TODO unit test for the property 'VarDouble'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class PetTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for Pet
|
||||
//private Pet instance;
|
||||
|
||||
public PetTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of Pet
|
||||
//instance = new Pet();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Pet
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PetInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" Pet
|
||||
//Assert.IsType<Pet>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Category'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void CategoryTest()
|
||||
{
|
||||
// TODO unit test for the property 'Category'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'PhotoUrls'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PhotoUrlsTest()
|
||||
{
|
||||
// TODO unit test for the property 'PhotoUrls'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Tags'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TagsTest()
|
||||
{
|
||||
// TODO unit test for the property 'Tags'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Status'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void StatusTest()
|
||||
{
|
||||
// TODO unit test for the property 'Status'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Query
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class QueryTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for Query
|
||||
//private Query instance;
|
||||
|
||||
public QueryTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of Query
|
||||
//instance = new Query();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Query
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void QueryInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" Query
|
||||
//Assert.IsType<Query>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Outcomes'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OutcomesTest()
|
||||
{
|
||||
// TODO unit test for the property 'Outcomes'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing StringEnumRef
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class StringEnumRefTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for StringEnumRef
|
||||
//private StringEnumRef instance;
|
||||
|
||||
public StringEnumRefTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of StringEnumRef
|
||||
//instance = new StringEnumRef();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of StringEnumRef
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void StringEnumRefInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" StringEnumRef
|
||||
//Assert.IsType<StringEnumRef>(instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing Tag
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class TagTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for Tag
|
||||
//private Tag instance;
|
||||
|
||||
public TagTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of Tag
|
||||
//instance = new Tag();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of Tag
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TagInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" Tag
|
||||
//Assert.IsType<Tag>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
//private TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter instance;
|
||||
|
||||
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
//instance = new TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameterInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
//Assert.IsType<TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Size'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void SizeTest()
|
||||
{
|
||||
// TODO unit test for the property 'Size'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Color'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ColorTest()
|
||||
{
|
||||
// TODO unit test for the property 'Color'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Id'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void IdTest()
|
||||
{
|
||||
// TODO unit test for the property 'Id'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Name'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void NameTest()
|
||||
{
|
||||
// TODO unit test for the property 'Name'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
//private TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter instance;
|
||||
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
//instance = new TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameterInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
//Assert.IsType<TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter>(instance);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the property 'Values'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void ValuesTest()
|
||||
{
|
||||
// TODO unit test for the property 'Values'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<AssemblyName>Org.OpenAPITools.Test</AssemblyName>
|
||||
<RootNamespace>Org.OpenAPITools.Test</RootNamespace>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
|
||||
<PackageReference Include="xunit" Version="2.5.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Org.OpenAPITools\Org.OpenAPITools.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,379 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Mime;
|
||||
using Org.OpenAPITools.Client;
|
||||
|
||||
namespace Org.OpenAPITools.Api
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IFormApiSync : IApiAccessor
|
||||
{
|
||||
#region Synchronous Operations
|
||||
/// <summary>
|
||||
/// Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test form parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
string TestFormIntegerBooleanString(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test form parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
ApiResponse<string> TestFormIntegerBooleanStringWithHttpInfo(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IFormApiAsync : IApiAccessor
|
||||
{
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
/// Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test form parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
System.Threading.Tasks.Task<string> TestFormIntegerBooleanStringAsync(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test form parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> TestFormIntegerBooleanStringWithHttpInfoAsync(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IFormApi : IFormApiSync, IFormApiAsync
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public partial class FormApi : IFormApi
|
||||
{
|
||||
private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public FormApi() : this((string)null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public FormApi(string basePath)
|
||||
{
|
||||
this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations(
|
||||
Org.OpenAPITools.Client.GlobalConfiguration.Instance,
|
||||
new Org.OpenAPITools.Client.Configuration { BasePath = basePath }
|
||||
);
|
||||
this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormApi"/> class
|
||||
/// using Configuration object
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration</param>
|
||||
/// <returns></returns>
|
||||
public FormApi(Org.OpenAPITools.Client.Configuration configuration)
|
||||
{
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations(
|
||||
Org.OpenAPITools.Client.GlobalConfiguration.Instance,
|
||||
configuration
|
||||
);
|
||||
this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="FormApi"/> class
|
||||
/// using a Configuration object and client instance.
|
||||
/// </summary>
|
||||
/// <param name="client">The client interface for synchronous API access.</param>
|
||||
/// <param name="asyncClient">The client interface for asynchronous API access.</param>
|
||||
/// <param name="configuration">The configuration object.</param>
|
||||
public FormApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration)
|
||||
{
|
||||
if (client == null) throw new ArgumentNullException("client");
|
||||
if (asyncClient == null) throw new ArgumentNullException("asyncClient");
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
this.Client = client;
|
||||
this.AsynchronousClient = asyncClient;
|
||||
this.Configuration = configuration;
|
||||
this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The client for accessing this underlying API asynchronously.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client for accessing this underlying API synchronously.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
public string GetBasePath()
|
||||
{
|
||||
return this.Configuration.BasePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides a factory method hook for the creation of exceptions.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||
{
|
||||
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||
}
|
||||
return _exceptionFactory;
|
||||
}
|
||||
set { _exceptionFactory = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test form parameter(s) Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
public string TestFormIntegerBooleanString(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0)
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = TestFormIntegerBooleanStringWithHttpInfo(integerForm, booleanForm, stringForm);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test form parameter(s) Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<string> TestFormIntegerBooleanStringWithHttpInfo(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0)
|
||||
{
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
if (integerForm != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("integer_form", Org.OpenAPITools.Client.ClientUtils.ParameterToString(integerForm)); // form parameter
|
||||
}
|
||||
if (booleanForm != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("boolean_form", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanForm)); // form parameter
|
||||
}
|
||||
if (stringForm != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("string_form", Org.OpenAPITools.Client.ClientUtils.ParameterToString(stringForm)); // form parameter
|
||||
}
|
||||
|
||||
localVarRequestOptions.Operation = "FormApi.TestFormIntegerBooleanString";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Post<string>("/form/integer/boolean/string", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestFormIntegerBooleanString", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test form parameter(s) Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
public async System.Threading.Tasks.Task<string> TestFormIntegerBooleanStringAsync(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await TestFormIntegerBooleanStringWithHttpInfoAsync(integerForm, booleanForm, stringForm, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test form parameter(s) Test form parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerForm"> (optional)</param>
|
||||
/// <param name="booleanForm"> (optional)</param>
|
||||
/// <param name="stringForm"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> TestFormIntegerBooleanStringWithHttpInfoAsync(int? integerForm = default(int?), bool? booleanForm = default(bool?), string? stringForm = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
"application/x-www-form-urlencoded"
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
if (integerForm != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("integer_form", Org.OpenAPITools.Client.ClientUtils.ParameterToString(integerForm)); // form parameter
|
||||
}
|
||||
if (booleanForm != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("boolean_form", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanForm)); // form parameter
|
||||
}
|
||||
if (stringForm != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("string_form", Org.OpenAPITools.Client.ClientUtils.ParameterToString(stringForm)); // form parameter
|
||||
}
|
||||
|
||||
localVarRequestOptions.Operation = "FormApi.TestFormIntegerBooleanString";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.PostAsync<string>("/form/integer/boolean/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestFormIntegerBooleanString", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,377 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Mime;
|
||||
using Org.OpenAPITools.Client;
|
||||
|
||||
namespace Org.OpenAPITools.Api
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IHeaderApiSync : IApiAccessor
|
||||
{
|
||||
#region Synchronous Operations
|
||||
/// <summary>
|
||||
/// Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test header parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
string TestHeaderIntegerBooleanString(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test header parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
ApiResponse<string> TestHeaderIntegerBooleanStringWithHttpInfo(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IHeaderApiAsync : IApiAccessor
|
||||
{
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
/// Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test header parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
System.Threading.Tasks.Task<string> TestHeaderIntegerBooleanStringAsync(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test header parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> TestHeaderIntegerBooleanStringWithHttpInfoAsync(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IHeaderApi : IHeaderApiSync, IHeaderApiAsync
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public partial class HeaderApi : IHeaderApi
|
||||
{
|
||||
private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeaderApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public HeaderApi() : this((string)null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeaderApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public HeaderApi(string basePath)
|
||||
{
|
||||
this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations(
|
||||
Org.OpenAPITools.Client.GlobalConfiguration.Instance,
|
||||
new Org.OpenAPITools.Client.Configuration { BasePath = basePath }
|
||||
);
|
||||
this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeaderApi"/> class
|
||||
/// using Configuration object
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration</param>
|
||||
/// <returns></returns>
|
||||
public HeaderApi(Org.OpenAPITools.Client.Configuration configuration)
|
||||
{
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations(
|
||||
Org.OpenAPITools.Client.GlobalConfiguration.Instance,
|
||||
configuration
|
||||
);
|
||||
this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="HeaderApi"/> class
|
||||
/// using a Configuration object and client instance.
|
||||
/// </summary>
|
||||
/// <param name="client">The client interface for synchronous API access.</param>
|
||||
/// <param name="asyncClient">The client interface for asynchronous API access.</param>
|
||||
/// <param name="configuration">The configuration object.</param>
|
||||
public HeaderApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration)
|
||||
{
|
||||
if (client == null) throw new ArgumentNullException("client");
|
||||
if (asyncClient == null) throw new ArgumentNullException("asyncClient");
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
this.Client = client;
|
||||
this.AsynchronousClient = asyncClient;
|
||||
this.Configuration = configuration;
|
||||
this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The client for accessing this underlying API asynchronously.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client for accessing this underlying API synchronously.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
public string GetBasePath()
|
||||
{
|
||||
return this.Configuration.BasePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides a factory method hook for the creation of exceptions.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||
{
|
||||
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||
}
|
||||
return _exceptionFactory;
|
||||
}
|
||||
set { _exceptionFactory = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test header parameter(s) Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
public string TestHeaderIntegerBooleanString(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0)
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = TestHeaderIntegerBooleanStringWithHttpInfo(integerHeader, booleanHeader, stringHeader);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test header parameter(s) Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<string> TestHeaderIntegerBooleanStringWithHttpInfo(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0)
|
||||
{
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
if (integerHeader != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("integer_header", Org.OpenAPITools.Client.ClientUtils.ParameterToString(integerHeader)); // header parameter
|
||||
}
|
||||
if (booleanHeader != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("boolean_header", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanHeader)); // header parameter
|
||||
}
|
||||
if (stringHeader != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("string_header", Org.OpenAPITools.Client.ClientUtils.ParameterToString(stringHeader)); // header parameter
|
||||
}
|
||||
|
||||
localVarRequestOptions.Operation = "HeaderApi.TestHeaderIntegerBooleanString";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Get<string>("/header/integer/boolean/string", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestHeaderIntegerBooleanString", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test header parameter(s) Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
public async System.Threading.Tasks.Task<string> TestHeaderIntegerBooleanStringAsync(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await TestHeaderIntegerBooleanStringWithHttpInfoAsync(integerHeader, booleanHeader, stringHeader, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test header parameter(s) Test header parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="integerHeader"> (optional)</param>
|
||||
/// <param name="booleanHeader"> (optional)</param>
|
||||
/// <param name="stringHeader"> (optional)</param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> TestHeaderIntegerBooleanStringWithHttpInfoAsync(int? integerHeader = default(int?), bool? booleanHeader = default(bool?), string? stringHeader = default(string?), int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
if (integerHeader != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("integer_header", Org.OpenAPITools.Client.ClientUtils.ParameterToString(integerHeader)); // header parameter
|
||||
}
|
||||
if (booleanHeader != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("boolean_header", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanHeader)); // header parameter
|
||||
}
|
||||
if (stringHeader != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("string_header", Org.OpenAPITools.Client.ClientUtils.ParameterToString(stringHeader)); // header parameter
|
||||
}
|
||||
|
||||
localVarRequestOptions.Operation = "HeaderApi.TestHeaderIntegerBooleanString";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.GetAsync<string>("/header/integer/boolean/string", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestHeaderIntegerBooleanString", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Mime;
|
||||
using Org.OpenAPITools.Client;
|
||||
|
||||
namespace Org.OpenAPITools.Api
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IPathApiSync : IApiAccessor
|
||||
{
|
||||
#region Synchronous Operations
|
||||
/// <summary>
|
||||
/// Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test path parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
string TestsPathStringPathStringIntegerPathInteger(string pathString, int pathInteger, int operationIndex = 0);
|
||||
|
||||
/// <summary>
|
||||
/// Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test path parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
ApiResponse<string> TestsPathStringPathStringIntegerPathIntegerWithHttpInfo(string pathString, int pathInteger, int operationIndex = 0);
|
||||
#endregion Synchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IPathApiAsync : IApiAccessor
|
||||
{
|
||||
#region Asynchronous Operations
|
||||
/// <summary>
|
||||
/// Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test path parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
System.Threading.Tasks.Task<string> TestsPathStringPathStringIntegerPathIntegerAsync(string pathString, int pathInteger, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Test path parameter(s)
|
||||
/// </remarks>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
System.Threading.Tasks.Task<ApiResponse<string>> TestsPathStringPathStringIntegerPathIntegerWithHttpInfoAsync(string pathString, int pathInteger, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
#endregion Asynchronous Operations
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public interface IPathApi : IPathApiSync, IPathApiAsync
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents a collection of functions to interact with the API endpoints
|
||||
/// </summary>
|
||||
public partial class PathApi : IPathApi
|
||||
{
|
||||
private Org.OpenAPITools.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PathApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PathApi() : this((string)null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PathApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public PathApi(string basePath)
|
||||
{
|
||||
this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations(
|
||||
Org.OpenAPITools.Client.GlobalConfiguration.Instance,
|
||||
new Org.OpenAPITools.Client.Configuration { BasePath = basePath }
|
||||
);
|
||||
this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PathApi"/> class
|
||||
/// using Configuration object
|
||||
/// </summary>
|
||||
/// <param name="configuration">An instance of Configuration</param>
|
||||
/// <returns></returns>
|
||||
public PathApi(Org.OpenAPITools.Client.Configuration configuration)
|
||||
{
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
this.Configuration = Org.OpenAPITools.Client.Configuration.MergeConfigurations(
|
||||
Org.OpenAPITools.Client.GlobalConfiguration.Instance,
|
||||
configuration
|
||||
);
|
||||
this.Client = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
this.AsynchronousClient = new Org.OpenAPITools.Client.ApiClient(this.Configuration.BasePath);
|
||||
ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PathApi"/> class
|
||||
/// using a Configuration object and client instance.
|
||||
/// </summary>
|
||||
/// <param name="client">The client interface for synchronous API access.</param>
|
||||
/// <param name="asyncClient">The client interface for asynchronous API access.</param>
|
||||
/// <param name="configuration">The configuration object.</param>
|
||||
public PathApi(Org.OpenAPITools.Client.ISynchronousClient client, Org.OpenAPITools.Client.IAsynchronousClient asyncClient, Org.OpenAPITools.Client.IReadableConfiguration configuration)
|
||||
{
|
||||
if (client == null) throw new ArgumentNullException("client");
|
||||
if (asyncClient == null) throw new ArgumentNullException("asyncClient");
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
this.Client = client;
|
||||
this.AsynchronousClient = asyncClient;
|
||||
this.Configuration = configuration;
|
||||
this.ExceptionFactory = Org.OpenAPITools.Client.Configuration.DefaultExceptionFactory;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The client for accessing this underlying API asynchronously.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.IAsynchronousClient AsynchronousClient { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The client for accessing this underlying API synchronously.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.ISynchronousClient Client { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
public string GetBasePath()
|
||||
{
|
||||
return this.Configuration.BasePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
public Org.OpenAPITools.Client.IReadableConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Provides a factory method hook for the creation of exceptions.
|
||||
/// </summary>
|
||||
public Org.OpenAPITools.Client.ExceptionFactory ExceptionFactory
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||
{
|
||||
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||
}
|
||||
return _exceptionFactory;
|
||||
}
|
||||
set { _exceptionFactory = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test path parameter(s) Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>string</returns>
|
||||
public string TestsPathStringPathStringIntegerPathInteger(string pathString, int pathInteger, int operationIndex = 0)
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = TestsPathStringPathStringIntegerPathIntegerWithHttpInfo(pathString, pathInteger);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test path parameter(s) Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <returns>ApiResponse of string</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<string> TestsPathStringPathStringIntegerPathIntegerWithHttpInfo(string pathString, int pathInteger, int operationIndex = 0)
|
||||
{
|
||||
// verify the required parameter 'pathString' is set
|
||||
if (pathString == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pathString' when calling PathApi->TestsPathStringPathStringIntegerPathInteger");
|
||||
}
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
localVarRequestOptions.PathParameters.Add("path_string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(pathString)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("path_integer", Org.OpenAPITools.Client.ClientUtils.ParameterToString(pathInteger)); // path parameter
|
||||
|
||||
localVarRequestOptions.Operation = "PathApi.TestsPathStringPathStringIntegerPathInteger";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = this.Client.Get<string>("/path/string/{path_string}/integer/{path_integer}", localVarRequestOptions, this.Configuration);
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestsPathStringPathStringIntegerPathInteger", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test path parameter(s) Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of string</returns>
|
||||
public async System.Threading.Tasks.Task<string> TestsPathStringPathStringIntegerPathIntegerAsync(string pathString, int pathInteger, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
Org.OpenAPITools.Client.ApiResponse<string> localVarResponse = await TestsPathStringPathStringIntegerPathIntegerWithHttpInfoAsync(pathString, pathInteger, operationIndex, cancellationToken).ConfigureAwait(false);
|
||||
return localVarResponse.Data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test path parameter(s) Test path parameter(s)
|
||||
/// </summary>
|
||||
/// <exception cref="Org.OpenAPITools.Client.ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="pathString"></param>
|
||||
/// <param name="pathInteger"></param>
|
||||
/// <param name="operationIndex">Index associated with the operation.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse (string)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<string>> TestsPathStringPathStringIntegerPathIntegerWithHttpInfoAsync(string pathString, int pathInteger, int operationIndex = 0, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
// verify the required parameter 'pathString' is set
|
||||
if (pathString == null)
|
||||
{
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'pathString' when calling PathApi->TestsPathStringPathStringIntegerPathInteger");
|
||||
}
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
string[] _contentTypes = new string[] {
|
||||
};
|
||||
|
||||
// to determine the Accept header
|
||||
string[] _accepts = new string[] {
|
||||
"text/plain"
|
||||
};
|
||||
|
||||
var localVarContentType = Org.OpenAPITools.Client.ClientUtils.SelectHeaderContentType(_contentTypes);
|
||||
if (localVarContentType != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
|
||||
}
|
||||
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null)
|
||||
{
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
}
|
||||
|
||||
localVarRequestOptions.PathParameters.Add("path_string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(pathString)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("path_integer", Org.OpenAPITools.Client.ClientUtils.ParameterToString(pathInteger)); // path parameter
|
||||
|
||||
localVarRequestOptions.Operation = "PathApi.TestsPathStringPathStringIntegerPathInteger";
|
||||
localVarRequestOptions.OperationIndex = operationIndex;
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
var localVarResponse = await this.AsynchronousClient.GetAsync<string>("/path/string/{path_string}/integer/{path_integer}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (this.ExceptionFactory != null)
|
||||
{
|
||||
Exception _exception = this.ExceptionFactory("TestsPathStringPathStringIntegerPathInteger", localVarResponse);
|
||||
if (_exception != null)
|
||||
{
|
||||
throw _exception;
|
||||
}
|
||||
}
|
||||
|
||||
return localVarResponse;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,838 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using RestSharp;
|
||||
using RestSharp.Serializers;
|
||||
using RestSharpMethod = RestSharp.Method;
|
||||
using Polly;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Allows RestSharp to Serialize/Deserialize JSON using our custom logic, but only when ContentType is JSON.
|
||||
/// </summary>
|
||||
internal class CustomJsonCodec : IRestSerializer, ISerializer, IDeserializer
|
||||
{
|
||||
private readonly IReadableConfiguration _configuration;
|
||||
private static readonly string _contentType = "application/json";
|
||||
private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public CustomJsonCodec(IReadableConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
|
||||
{
|
||||
_serializerSettings = serializerSettings;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serialize the object into a JSON string.
|
||||
/// </summary>
|
||||
/// <param name="obj">Object to be serialized.</param>
|
||||
/// <returns>A JSON string.</returns>
|
||||
public string Serialize(object obj)
|
||||
{
|
||||
if (obj != null && obj is Org.OpenAPITools.Model.AbstractOpenAPISchema)
|
||||
{
|
||||
// the object to be serialized is an oneOf/anyOf schema
|
||||
return ((Org.OpenAPITools.Model.AbstractOpenAPISchema)obj).ToJson();
|
||||
}
|
||||
else
|
||||
{
|
||||
return JsonConvert.SerializeObject(obj, _serializerSettings);
|
||||
}
|
||||
}
|
||||
|
||||
public string Serialize(Parameter bodyParameter) => Serialize(bodyParameter.Value);
|
||||
|
||||
public T Deserialize<T>(RestResponse response)
|
||||
{
|
||||
var result = (T)Deserialize(response, typeof(T));
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize the JSON string into a proper object.
|
||||
/// </summary>
|
||||
/// <param name="response">The HTTP response.</param>
|
||||
/// <param name="type">Object type.</param>
|
||||
/// <returns>Object representation of the JSON string.</returns>
|
||||
internal object Deserialize(RestResponse response, Type type)
|
||||
{
|
||||
if (type == typeof(byte[])) // return byte array
|
||||
{
|
||||
return response.RawBytes;
|
||||
}
|
||||
|
||||
// TODO: ? if (type.IsAssignableFrom(typeof(Stream)))
|
||||
if (type == typeof(Stream))
|
||||
{
|
||||
var bytes = response.RawBytes;
|
||||
if (response.Headers != null)
|
||||
{
|
||||
var filePath = string.IsNullOrEmpty(_configuration.TempFolderPath)
|
||||
? Path.GetTempPath()
|
||||
: _configuration.TempFolderPath;
|
||||
var regex = new Regex(@"Content-Disposition=.*filename=['""]?([^'""\s]+)['""]?$");
|
||||
foreach (var header in response.Headers)
|
||||
{
|
||||
var match = regex.Match(header.ToString());
|
||||
if (match.Success)
|
||||
{
|
||||
string fileName = filePath + ClientUtils.SanitizeFilename(match.Groups[1].Value.Replace("\"", "").Replace("'", ""));
|
||||
File.WriteAllBytes(fileName, bytes);
|
||||
return new FileStream(fileName, FileMode.Open);
|
||||
}
|
||||
}
|
||||
}
|
||||
var stream = new MemoryStream(bytes);
|
||||
return stream;
|
||||
}
|
||||
|
||||
if (type.Name.StartsWith("System.Nullable`1[[System.DateTime")) // return a datetime object
|
||||
{
|
||||
return DateTime.Parse(response.Content, null, System.Globalization.DateTimeStyles.RoundtripKind);
|
||||
}
|
||||
|
||||
if (type == typeof(string) || type.Name.StartsWith("System.Nullable")) // return primitive type
|
||||
{
|
||||
return Convert.ChangeType(response.Content, type);
|
||||
}
|
||||
|
||||
// at this point, it must be a model (json)
|
||||
try
|
||||
{
|
||||
return JsonConvert.DeserializeObject(response.Content, type, _serializerSettings);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ApiException(500, e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
public ISerializer Serializer => this;
|
||||
public IDeserializer Deserializer => this;
|
||||
|
||||
public string[] AcceptedContentTypes => RestSharp.Serializers.ContentType.JsonAccept;
|
||||
|
||||
public SupportsContentType SupportsContentType => contentType =>
|
||||
contentType.EndsWith("json", StringComparison.InvariantCultureIgnoreCase) ||
|
||||
contentType.EndsWith("javascript", StringComparison.InvariantCultureIgnoreCase);
|
||||
|
||||
public string ContentType
|
||||
{
|
||||
get { return _contentType; }
|
||||
set { throw new InvalidOperationException("Not allowed to set content type."); }
|
||||
}
|
||||
|
||||
public DataFormat DataFormat => DataFormat.Json;
|
||||
}
|
||||
/// <summary>
|
||||
/// Provides a default implementation of an Api client (both synchronous and asynchronous implementations),
|
||||
/// encapsulating general REST accessor use cases.
|
||||
/// </summary>
|
||||
public partial class ApiClient : ISynchronousClient, IAsynchronousClient
|
||||
{
|
||||
private readonly string _baseUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Specifies the settings on a <see cref="JsonSerializer" /> object.
|
||||
/// These settings can be adjusted to accommodate custom serialization rules.
|
||||
/// </summary>
|
||||
public JsonSerializerSettings SerializerSettings { get; set; } = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Allows for extending request processing for <see cref="ApiClient"/> generated code.
|
||||
/// </summary>
|
||||
/// <param name="request">The RestSharp request object</param>
|
||||
partial void InterceptRequest(RestRequest request);
|
||||
|
||||
/// <summary>
|
||||
/// Allows for extending response processing for <see cref="ApiClient"/> generated code.
|
||||
/// </summary>
|
||||
/// <param name="request">The RestSharp request object</param>
|
||||
/// <param name="response">The RestSharp response object</param>
|
||||
partial void InterceptResponse(RestRequest request, RestResponse response);
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiClient" />, defaulting to the global configurations' base url.
|
||||
/// </summary>
|
||||
public ApiClient()
|
||||
{
|
||||
_baseUrl = Org.OpenAPITools.Client.GlobalConfiguration.Instance.BasePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiClient" />
|
||||
/// </summary>
|
||||
/// <param name="basePath">The target service's base path in URL format.</param>
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public ApiClient(string basePath)
|
||||
{
|
||||
if (string.IsNullOrEmpty(basePath))
|
||||
throw new ArgumentException("basePath cannot be empty");
|
||||
|
||||
_baseUrl = basePath;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructs the RestSharp version of an http method
|
||||
/// </summary>
|
||||
/// <param name="method">Swagger Client Custom HttpMethod</param>
|
||||
/// <returns>RestSharp's HttpMethod instance.</returns>
|
||||
/// <exception cref="ArgumentOutOfRangeException"></exception>
|
||||
private RestSharpMethod Method(HttpMethod method)
|
||||
{
|
||||
RestSharpMethod other;
|
||||
switch (method)
|
||||
{
|
||||
case HttpMethod.Get:
|
||||
other = RestSharpMethod.Get;
|
||||
break;
|
||||
case HttpMethod.Post:
|
||||
other = RestSharpMethod.Post;
|
||||
break;
|
||||
case HttpMethod.Put:
|
||||
other = RestSharpMethod.Put;
|
||||
break;
|
||||
case HttpMethod.Delete:
|
||||
other = RestSharpMethod.Delete;
|
||||
break;
|
||||
case HttpMethod.Head:
|
||||
other = RestSharpMethod.Head;
|
||||
break;
|
||||
case HttpMethod.Options:
|
||||
other = RestSharpMethod.Options;
|
||||
break;
|
||||
case HttpMethod.Patch:
|
||||
other = RestSharpMethod.Patch;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("method", method, null);
|
||||
}
|
||||
|
||||
return other;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides all logic for constructing a new RestSharp <see cref="RestRequest"/>.
|
||||
/// At this point, all information for querying the service is known. Here, it is simply
|
||||
/// mapped into the RestSharp request.
|
||||
/// </summary>
|
||||
/// <param name="method">The http verb.</param>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>[private] A new RestRequest instance.</returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private RestRequest NewRequest(
|
||||
HttpMethod method,
|
||||
string path,
|
||||
RequestOptions options,
|
||||
IReadableConfiguration configuration)
|
||||
{
|
||||
if (path == null) throw new ArgumentNullException("path");
|
||||
if (options == null) throw new ArgumentNullException("options");
|
||||
if (configuration == null) throw new ArgumentNullException("configuration");
|
||||
|
||||
RestRequest request = new RestRequest(path, Method(method));
|
||||
|
||||
if (options.PathParameters != null)
|
||||
{
|
||||
foreach (var pathParam in options.PathParameters)
|
||||
{
|
||||
request.AddParameter(pathParam.Key, pathParam.Value, ParameterType.UrlSegment);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.QueryParameters != null)
|
||||
{
|
||||
foreach (var queryParam in options.QueryParameters)
|
||||
{
|
||||
foreach (var value in queryParam.Value)
|
||||
{
|
||||
request.AddQueryParameter(queryParam.Key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (configuration.DefaultHeaders != null)
|
||||
{
|
||||
foreach (var headerParam in configuration.DefaultHeaders)
|
||||
{
|
||||
request.AddHeader(headerParam.Key, headerParam.Value);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.HeaderParameters != null)
|
||||
{
|
||||
foreach (var headerParam in options.HeaderParameters)
|
||||
{
|
||||
foreach (var value in headerParam.Value)
|
||||
{
|
||||
request.AddHeader(headerParam.Key, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (options.FormParameters != null)
|
||||
{
|
||||
foreach (var formParam in options.FormParameters)
|
||||
{
|
||||
request.AddParameter(formParam.Key, formParam.Value);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.Data != null)
|
||||
{
|
||||
if (options.Data is Stream stream)
|
||||
{
|
||||
var contentType = "application/octet-stream";
|
||||
if (options.HeaderParameters != null)
|
||||
{
|
||||
var contentTypes = options.HeaderParameters["Content-Type"];
|
||||
contentType = contentTypes[0];
|
||||
}
|
||||
|
||||
var bytes = ClientUtils.ReadAsBytes(stream);
|
||||
request.AddParameter(contentType, bytes, ParameterType.RequestBody);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (options.HeaderParameters != null)
|
||||
{
|
||||
var contentTypes = options.HeaderParameters["Content-Type"];
|
||||
if (contentTypes == null || contentTypes.Any(header => header.Contains("application/json")))
|
||||
{
|
||||
request.RequestFormat = DataFormat.Json;
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: Generated client user should add additional handlers. RestSharp only supports XML and JSON, with XML as default.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Here, we'll assume JSON APIs are more common. XML can be forced by adding produces/consumes to openapi spec explicitly.
|
||||
request.RequestFormat = DataFormat.Json;
|
||||
}
|
||||
|
||||
request.AddJsonBody(options.Data);
|
||||
}
|
||||
}
|
||||
|
||||
if (options.FileParameters != null)
|
||||
{
|
||||
foreach (var fileParam in options.FileParameters)
|
||||
{
|
||||
foreach (var file in fileParam.Value)
|
||||
{
|
||||
var bytes = ClientUtils.ReadAsBytes(file);
|
||||
var fileStream = file as FileStream;
|
||||
if (fileStream != null)
|
||||
request.AddFile(fileParam.Key, bytes, System.IO.Path.GetFileName(fileStream.Name));
|
||||
else
|
||||
request.AddFile(fileParam.Key, bytes, "no_file_name_provided");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
private ApiResponse<T> ToApiResponse<T>(RestResponse<T> response)
|
||||
{
|
||||
T result = response.Data;
|
||||
string rawContent = response.Content;
|
||||
|
||||
var transformed = new ApiResponse<T>(response.StatusCode, new Multimap<string, string>(), result, rawContent)
|
||||
{
|
||||
ErrorText = response.ErrorMessage,
|
||||
Cookies = new List<Cookie>()
|
||||
};
|
||||
|
||||
if (response.Headers != null)
|
||||
{
|
||||
foreach (var responseHeader in response.Headers)
|
||||
{
|
||||
transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
|
||||
}
|
||||
}
|
||||
|
||||
if (response.ContentHeaders != null)
|
||||
{
|
||||
foreach (var responseHeader in response.ContentHeaders)
|
||||
{
|
||||
transformed.Headers.Add(responseHeader.Name, ClientUtils.ParameterToString(responseHeader.Value));
|
||||
}
|
||||
}
|
||||
|
||||
if (response.Cookies != null)
|
||||
{
|
||||
foreach (var responseCookies in response.Cookies.Cast<Cookie>())
|
||||
{
|
||||
transformed.Cookies.Add(
|
||||
new Cookie(
|
||||
responseCookies.Name,
|
||||
responseCookies.Value,
|
||||
responseCookies.Path,
|
||||
responseCookies.Domain)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return transformed;
|
||||
}
|
||||
|
||||
private ApiResponse<T> Exec<T>(RestRequest req, RequestOptions options, IReadableConfiguration configuration)
|
||||
{
|
||||
var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl;
|
||||
|
||||
var cookies = new CookieContainer();
|
||||
|
||||
if (options.Cookies != null && options.Cookies.Count > 0)
|
||||
{
|
||||
foreach (var cookie in options.Cookies)
|
||||
{
|
||||
cookies.Add(new Cookie(cookie.Name, cookie.Value));
|
||||
}
|
||||
}
|
||||
|
||||
var clientOptions = new RestClientOptions(baseUrl)
|
||||
{
|
||||
ClientCertificates = configuration.ClientCertificates,
|
||||
CookieContainer = cookies,
|
||||
MaxTimeout = configuration.Timeout,
|
||||
Proxy = configuration.Proxy,
|
||||
UserAgent = configuration.UserAgent,
|
||||
UseDefaultCredentials = configuration.UseDefaultCredentials,
|
||||
RemoteCertificateValidationCallback = configuration.RemoteCertificateValidationCallback
|
||||
};
|
||||
|
||||
RestClient client = new RestClient(clientOptions)
|
||||
.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration));
|
||||
|
||||
InterceptRequest(req);
|
||||
|
||||
RestResponse<T> response;
|
||||
if (RetryConfiguration.RetryPolicy != null)
|
||||
{
|
||||
var policy = RetryConfiguration.RetryPolicy;
|
||||
var policyResult = policy.ExecuteAndCapture(() => client.Execute(req));
|
||||
response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize<T>(policyResult.Result) : new RestResponse<T>
|
||||
{
|
||||
Request = req,
|
||||
ErrorException = policyResult.FinalException
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
response = client.Execute<T>(req);
|
||||
}
|
||||
|
||||
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||
if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||
{
|
||||
try
|
||||
{
|
||||
response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content });
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex.InnerException != null ? ex.InnerException : ex;
|
||||
}
|
||||
}
|
||||
else if (typeof(T).Name == "Stream") // for binary response
|
||||
{
|
||||
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||
}
|
||||
else if (typeof(T).Name == "Byte[]") // for byte response
|
||||
{
|
||||
response.Data = (T)(object)response.RawBytes;
|
||||
}
|
||||
else if (typeof(T).Name == "String") // for string response
|
||||
{
|
||||
response.Data = (T)(object)response.Content;
|
||||
}
|
||||
|
||||
InterceptResponse(req, response);
|
||||
|
||||
var result = ToApiResponse(response);
|
||||
if (response.ErrorMessage != null)
|
||||
{
|
||||
result.ErrorText = response.ErrorMessage;
|
||||
}
|
||||
|
||||
if (response.Cookies != null && response.Cookies.Count > 0)
|
||||
{
|
||||
if (result.Cookies == null) result.Cookies = new List<Cookie>();
|
||||
foreach (var restResponseCookie in response.Cookies.Cast<Cookie>())
|
||||
{
|
||||
var cookie = new Cookie(
|
||||
restResponseCookie.Name,
|
||||
restResponseCookie.Value,
|
||||
restResponseCookie.Path,
|
||||
restResponseCookie.Domain
|
||||
)
|
||||
{
|
||||
Comment = restResponseCookie.Comment,
|
||||
CommentUri = restResponseCookie.CommentUri,
|
||||
Discard = restResponseCookie.Discard,
|
||||
Expired = restResponseCookie.Expired,
|
||||
Expires = restResponseCookie.Expires,
|
||||
HttpOnly = restResponseCookie.HttpOnly,
|
||||
Port = restResponseCookie.Port,
|
||||
Secure = restResponseCookie.Secure,
|
||||
Version = restResponseCookie.Version
|
||||
};
|
||||
|
||||
result.Cookies.Add(cookie);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, RequestOptions options, IReadableConfiguration configuration, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var baseUrl = configuration.GetOperationServerUrl(options.Operation, options.OperationIndex) ?? _baseUrl;
|
||||
|
||||
var clientOptions = new RestClientOptions(baseUrl)
|
||||
{
|
||||
ClientCertificates = configuration.ClientCertificates,
|
||||
MaxTimeout = configuration.Timeout,
|
||||
Proxy = configuration.Proxy,
|
||||
UserAgent = configuration.UserAgent,
|
||||
UseDefaultCredentials = configuration.UseDefaultCredentials
|
||||
};
|
||||
|
||||
RestClient client = new RestClient(clientOptions)
|
||||
.UseSerializer(() => new CustomJsonCodec(SerializerSettings, configuration));
|
||||
|
||||
InterceptRequest(req);
|
||||
|
||||
RestResponse<T> response;
|
||||
if (RetryConfiguration.AsyncRetryPolicy != null)
|
||||
{
|
||||
var policy = RetryConfiguration.AsyncRetryPolicy;
|
||||
var policyResult = await policy.ExecuteAndCaptureAsync((ct) => client.ExecuteAsync(req, ct), cancellationToken).ConfigureAwait(false);
|
||||
response = (policyResult.Outcome == OutcomeType.Successful) ? client.Deserialize<T>(policyResult.Result) : new RestResponse<T>
|
||||
{
|
||||
Request = req,
|
||||
ErrorException = policyResult.FinalException
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
response = await client.ExecuteAsync<T>(req, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
// if the response type is oneOf/anyOf, call FromJSON to deserialize the data
|
||||
if (typeof(Org.OpenAPITools.Model.AbstractOpenAPISchema).IsAssignableFrom(typeof(T)))
|
||||
{
|
||||
response.Data = (T) typeof(T).GetMethod("FromJson").Invoke(null, new object[] { response.Content });
|
||||
}
|
||||
else if (typeof(T).Name == "Stream") // for binary response
|
||||
{
|
||||
response.Data = (T)(object)new MemoryStream(response.RawBytes);
|
||||
}
|
||||
else if (typeof(T).Name == "Byte[]") // for byte response
|
||||
{
|
||||
response.Data = (T)(object)response.RawBytes;
|
||||
}
|
||||
|
||||
InterceptResponse(req, response);
|
||||
|
||||
var result = ToApiResponse(response);
|
||||
if (response.ErrorMessage != null)
|
||||
{
|
||||
result.ErrorText = response.ErrorMessage;
|
||||
}
|
||||
|
||||
if (response.Cookies != null && response.Cookies.Count > 0)
|
||||
{
|
||||
if (result.Cookies == null) result.Cookies = new List<Cookie>();
|
||||
foreach (var restResponseCookie in response.Cookies.Cast<Cookie>())
|
||||
{
|
||||
var cookie = new Cookie(
|
||||
restResponseCookie.Name,
|
||||
restResponseCookie.Value,
|
||||
restResponseCookie.Path,
|
||||
restResponseCookie.Domain
|
||||
)
|
||||
{
|
||||
Comment = restResponseCookie.Comment,
|
||||
CommentUri = restResponseCookie.CommentUri,
|
||||
Discard = restResponseCookie.Discard,
|
||||
Expired = restResponseCookie.Expired,
|
||||
Expires = restResponseCookie.Expires,
|
||||
HttpOnly = restResponseCookie.HttpOnly,
|
||||
Port = restResponseCookie.Port,
|
||||
Secure = restResponseCookie.Secure,
|
||||
Version = restResponseCookie.Version
|
||||
};
|
||||
|
||||
result.Cookies.Add(cookie);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#region IAsynchronousClient
|
||||
/// <summary>
|
||||
/// Make a HTTP GET request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP POST request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP PUT request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP DELETE request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP HEAD request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP OPTION request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP PATCH request (async).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <param name="cancellationToken">Token that enables callers to cancel the request.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), options, config, cancellationToken);
|
||||
}
|
||||
#endregion IAsynchronousClient
|
||||
|
||||
#region ISynchronousClient
|
||||
/// <summary>
|
||||
/// Make a HTTP GET request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Get, path, options, config), options, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP POST request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Post, path, options, config), options, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP PUT request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Put, path, options, config), options, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP DELETE request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Delete, path, options, config), options, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP HEAD request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Head, path, options, config), options, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP OPTION request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Options, path, options, config), options, config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Make a HTTP PATCH request (synchronous).
|
||||
/// </summary>
|
||||
/// <param name="path">The target path (or resource).</param>
|
||||
/// <param name="options">The additional request options.</param>
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), options, config);
|
||||
}
|
||||
#endregion ISynchronousClient
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// API Exception
|
||||
/// </summary>
|
||||
public class ApiException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the error code (HTTP status code)
|
||||
/// </summary>
|
||||
/// <value>The error code (HTTP status code).</value>
|
||||
public int ErrorCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the error content (body json object)
|
||||
/// </summary>
|
||||
/// <value>The error content (Http response body).</value>
|
||||
public object ErrorContent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP headers
|
||||
/// </summary>
|
||||
/// <value>HTTP headers</value>
|
||||
public Multimap<string, string> Headers { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
public ApiException() { }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="errorCode">HTTP status code.</param>
|
||||
/// <param name="message">Error message.</param>
|
||||
public ApiException(int errorCode, string message) : base(message)
|
||||
{
|
||||
this.ErrorCode = errorCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="errorCode">HTTP status code.</param>
|
||||
/// <param name="message">Error message.</param>
|
||||
/// <param name="errorContent">Error content.</param>
|
||||
/// <param name="headers">HTTP Headers.</param>
|
||||
public ApiException(int errorCode, string message, object errorContent = null, Multimap<string, string> headers = null) : base(message)
|
||||
{
|
||||
this.ErrorCode = errorCode;
|
||||
this.ErrorContent = errorContent;
|
||||
this.Headers = headers;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides a non-generic contract for the ApiResponse wrapper.
|
||||
/// </summary>
|
||||
public interface IApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// The data type of <see cref="Content"/>
|
||||
/// </summary>
|
||||
Type ResponseType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The content of this response
|
||||
/// </summary>
|
||||
Object Content { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status code (HTTP status code)
|
||||
/// </summary>
|
||||
/// <value>The status code.</value>
|
||||
HttpStatusCode StatusCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP headers
|
||||
/// </summary>
|
||||
/// <value>HTTP headers</value>
|
||||
Multimap<string, string> Headers { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets any error text defined by the calling client.
|
||||
/// </summary>
|
||||
string ErrorText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets any cookies passed along on the response.
|
||||
/// </summary>
|
||||
List<Cookie> Cookies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The raw content of this response
|
||||
/// </summary>
|
||||
string RawContent { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// API Response
|
||||
/// </summary>
|
||||
public class ApiResponse<T> : IApiResponse
|
||||
{
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status code (HTTP status code)
|
||||
/// </summary>
|
||||
/// <value>The status code.</value>
|
||||
public HttpStatusCode StatusCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP headers
|
||||
/// </summary>
|
||||
/// <value>HTTP headers</value>
|
||||
public Multimap<string, string> Headers { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the data (parsed HTTP body)
|
||||
/// </summary>
|
||||
/// <value>The data.</value>
|
||||
public T Data { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets any error text defined by the calling client.
|
||||
/// </summary>
|
||||
public string ErrorText { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets any cookies passed along on the response.
|
||||
/// </summary>
|
||||
public List<Cookie> Cookies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The content of this response
|
||||
/// </summary>
|
||||
public Type ResponseType
|
||||
{
|
||||
get { return typeof(T); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The data type of <see cref="Content"/>
|
||||
/// </summary>
|
||||
public object Content
|
||||
{
|
||||
get { return Data; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The raw content
|
||||
/// </summary>
|
||||
public string RawContent { get; }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">HTTP status code.</param>
|
||||
/// <param name="headers">HTTP headers.</param>
|
||||
/// <param name="data">Data (parsed HTTP body)</param>
|
||||
/// <param name="rawContent">Raw content.</param>
|
||||
public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data, string rawContent)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
Headers = headers;
|
||||
Data = data;
|
||||
RawContent = rawContent;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">HTTP status code.</param>
|
||||
/// <param name="headers">HTTP headers.</param>
|
||||
/// <param name="data">Data (parsed HTTP body)</param>
|
||||
public ApiResponse(HttpStatusCode statusCode, Multimap<string, string> headers, T data) : this(statusCode, headers, data, null)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">HTTP status code.</param>
|
||||
/// <param name="data">Data (parsed HTTP body)</param>
|
||||
/// <param name="rawContent">Raw content.</param>
|
||||
public ApiResponse(HttpStatusCode statusCode, T data, string rawContent) : this(statusCode, null, data, rawContent)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiResponse{T}" /> class.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">HTTP status code.</param>
|
||||
/// <param name="data">Data (parsed HTTP body)</param>
|
||||
public ApiResponse(HttpStatusCode statusCode, T data) : this(statusCode, data, null)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,248 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility functions providing some benefit to API client consumers.
|
||||
/// </summary>
|
||||
public static class ClientUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Sanitize filename by removing the path
|
||||
/// </summary>
|
||||
/// <param name="filename">Filename</param>
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert params to key/value pairs.
|
||||
/// Use collectionFormat to properly format lists and collections.
|
||||
/// </summary>
|
||||
/// <param name="collectionFormat">The swagger-supported collection format, one of: csv, tsv, ssv, pipes, multi</param>
|
||||
/// <param name="name">Key name.</param>
|
||||
/// <param name="value">Value object.</param>
|
||||
/// <returns>A multimap of keys with 1..n associated values.</returns>
|
||||
public static Multimap<string, string> ParameterToMultiMap(string collectionFormat, string name, object value)
|
||||
{
|
||||
var parameters = new Multimap<string, string>();
|
||||
|
||||
if (value is ICollection collection && collectionFormat == "multi")
|
||||
{
|
||||
foreach (var item in collection)
|
||||
{
|
||||
parameters.Add(name, ParameterToString(item));
|
||||
}
|
||||
}
|
||||
else if (value is IDictionary dictionary)
|
||||
{
|
||||
if(collectionFormat == "deepObject") {
|
||||
foreach (DictionaryEntry entry in dictionary)
|
||||
{
|
||||
parameters.Add(name + "[" + entry.Key + "]", ParameterToString(entry.Value));
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach (DictionaryEntry entry in dictionary)
|
||||
{
|
||||
parameters.Add(entry.Key.ToString(), ParameterToString(entry.Value));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
parameters.Add(name, ParameterToString(value));
|
||||
}
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime.
|
||||
/// If parameter is a list, join the list with ",".
|
||||
/// Otherwise just return the string.
|
||||
/// </summary>
|
||||
/// <param name="obj">The parameter (header, path, query, form).</param>
|
||||
/// <param name="configuration">An optional configuration instance, providing formatting options used in processing.</param>
|
||||
/// <returns>Formatted string.</returns>
|
||||
public static string ParameterToString(object obj, IReadableConfiguration configuration = null)
|
||||
{
|
||||
if (obj is DateTime dateTime)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
if (obj is DateTimeOffset dateTimeOffset)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
if (obj is bool boolean)
|
||||
return boolean ? "true" : "false";
|
||||
if (obj is ICollection collection) {
|
||||
List<string> entries = new List<string>();
|
||||
foreach (var entry in collection)
|
||||
entries.Add(ParameterToString(entry, configuration));
|
||||
return string.Join(",", entries);
|
||||
}
|
||||
if (obj is Enum && HasEnumMemberAttrValue(obj))
|
||||
return GetEnumMemberAttrValue(obj);
|
||||
|
||||
return Convert.ToString(obj, CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes the given object when not null. Otherwise return null.
|
||||
/// </summary>
|
||||
/// <param name="obj">The object to serialize.</param>
|
||||
/// <returns>Serialized string.</returns>
|
||||
public static string Serialize(object obj)
|
||||
{
|
||||
return obj != null ? Newtonsoft.Json.JsonConvert.SerializeObject(obj) : null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Encode string in base64 format.
|
||||
/// </summary>
|
||||
/// <param name="text">string to be encoded.</param>
|
||||
/// <returns>Encoded string.</returns>
|
||||
public static string Base64Encode(string text)
|
||||
{
|
||||
return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Convert stream to byte array
|
||||
/// </summary>
|
||||
/// <param name="inputStream">Input stream to be converted</param>
|
||||
/// <returns>Byte array</returns>
|
||||
public static byte[] ReadAsBytes(Stream inputStream)
|
||||
{
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
inputStream.CopyTo(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Select the Content-Type header's value from the given content-type array:
|
||||
/// if JSON type exists in the given array, use it;
|
||||
/// otherwise use the first one defined in 'consumes'
|
||||
/// </summary>
|
||||
/// <param name="contentTypes">The Content-Type array to select from.</param>
|
||||
/// <returns>The Content-Type header to use.</returns>
|
||||
public static string SelectHeaderContentType(string[] contentTypes)
|
||||
{
|
||||
if (contentTypes.Length == 0)
|
||||
return null;
|
||||
|
||||
foreach (var contentType in contentTypes)
|
||||
{
|
||||
if (IsJsonMime(contentType))
|
||||
return contentType;
|
||||
}
|
||||
|
||||
return contentTypes[0]; // use the first content type specified in 'consumes'
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Select the Accept header's value from the given accepts array:
|
||||
/// if JSON exists in the given array, use it;
|
||||
/// otherwise use all of them (joining into a string)
|
||||
/// </summary>
|
||||
/// <param name="accepts">The accepts array to select from.</param>
|
||||
/// <returns>The Accept header to use.</returns>
|
||||
public static string SelectHeaderAccept(string[] accepts)
|
||||
{
|
||||
if (accepts.Length == 0)
|
||||
return null;
|
||||
|
||||
if (accepts.Contains("application/json", StringComparer.OrdinalIgnoreCase))
|
||||
return "application/json";
|
||||
|
||||
return string.Join(",", accepts);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Provides a case-insensitive check that a provided content type is a known JSON-like content type.
|
||||
/// </summary>
|
||||
public static readonly Regex JsonRegex = new Regex("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$");
|
||||
|
||||
/// <summary>
|
||||
/// Check if the given MIME is a JSON MIME.
|
||||
/// JSON MIME examples:
|
||||
/// application/json
|
||||
/// application/json; charset=UTF8
|
||||
/// APPLICATION/JSON
|
||||
/// application/vnd.company+json
|
||||
/// </summary>
|
||||
/// <param name="mime">MIME</param>
|
||||
/// <returns>Returns True if MIME type is json.</returns>
|
||||
public static bool IsJsonMime(string mime)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(mime)) return false;
|
||||
|
||||
return JsonRegex.IsMatch(mime) || mime.Equals("application/json-patch+json");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is the Enum decorated with EnumMember Attribute
|
||||
/// </summary>
|
||||
/// <param name="enumVal"></param>
|
||||
/// <returns>true if found</returns>
|
||||
private static bool HasEnumMemberAttrValue(object enumVal)
|
||||
{
|
||||
if (enumVal == null)
|
||||
throw new ArgumentNullException(nameof(enumVal));
|
||||
var enumType = enumVal.GetType();
|
||||
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
|
||||
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
|
||||
if (attr != null) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the EnumMember value
|
||||
/// </summary>
|
||||
/// <param name="enumVal"></param>
|
||||
/// <returns>EnumMember value as string otherwise null</returns>
|
||||
private static string GetEnumMemberAttrValue(object enumVal)
|
||||
{
|
||||
if (enumVal == null)
|
||||
throw new ArgumentNullException(nameof(enumVal));
|
||||
var enumType = enumVal.GetType();
|
||||
var memInfo = enumType.GetMember(enumVal.ToString() ?? throw new InvalidOperationException());
|
||||
var attr = memInfo.FirstOrDefault()?.GetCustomAttributes(false).OfType<EnumMemberAttribute>().FirstOrDefault();
|
||||
if (attr != null)
|
||||
{
|
||||
return attr.Value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,613 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Text;
|
||||
using System.Net.Http;
|
||||
using System.Net.Security;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a set of configuration settings
|
||||
/// </summary>
|
||||
public class Configuration : IReadableConfiguration
|
||||
{
|
||||
#region Constants
|
||||
|
||||
/// <summary>
|
||||
/// Version of the package.
|
||||
/// </summary>
|
||||
/// <value>Version of the package.</value>
|
||||
public const string Version = "1.0.0";
|
||||
|
||||
/// <summary>
|
||||
/// Identifier for ISO 8601 DateTime Format
|
||||
/// </summary>
|
||||
/// <remarks>See https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8 for more information.</remarks>
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const string ISO8601_DATETIME_FORMAT = "o";
|
||||
|
||||
#endregion Constants
|
||||
|
||||
#region Static Members
|
||||
|
||||
/// <summary>
|
||||
/// Default creation of exceptions for a given method name and response object
|
||||
/// </summary>
|
||||
public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
|
||||
{
|
||||
var status = (int)response.StatusCode;
|
||||
if (status >= 400)
|
||||
{
|
||||
return new ApiException(status,
|
||||
string.Format("Error calling {0}: {1}", methodName, response.RawContent),
|
||||
response.RawContent, response.Headers);
|
||||
}
|
||||
if (status == 0)
|
||||
{
|
||||
return new ApiException(status,
|
||||
string.Format("Error calling {0}: {1}", methodName, response.ErrorText), response.ErrorText);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
#endregion Static Members
|
||||
|
||||
#region Private Members
|
||||
|
||||
/// <summary>
|
||||
/// Defines the base path of the target API server.
|
||||
/// Example: http://localhost:3000/v1/
|
||||
/// </summary>
|
||||
private string _basePath;
|
||||
|
||||
private bool _useDefaultCredentials = false;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the API key based on the authentication name.
|
||||
/// This is the key and value comprising the "secret" for accessing an API.
|
||||
/// </summary>
|
||||
/// <value>The API key.</value>
|
||||
private IDictionary<string, string> _apiKey;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
|
||||
/// </summary>
|
||||
/// <value>The prefix of the API key.</value>
|
||||
private IDictionary<string, string> _apiKeyPrefix;
|
||||
|
||||
private string _dateTimeFormat = ISO8601_DATETIME_FORMAT;
|
||||
private string _tempFolderPath = Path.GetTempPath();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the servers defined in the OpenAPI spec.
|
||||
/// </summary>
|
||||
/// <value>The servers</value>
|
||||
private IList<IReadOnlyDictionary<string, object>> _servers;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the operation servers defined in the OpenAPI spec.
|
||||
/// </summary>
|
||||
/// <value>The operation servers</value>
|
||||
private IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> _operationServers;
|
||||
|
||||
#endregion Private Members
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Configuration" /> class
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
|
||||
public Configuration()
|
||||
{
|
||||
Proxy = null;
|
||||
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");
|
||||
BasePath = "http://localhost:3000";
|
||||
DefaultHeaders = new ConcurrentDictionary<string, string>();
|
||||
ApiKey = new ConcurrentDictionary<string, string>();
|
||||
ApiKeyPrefix = new ConcurrentDictionary<string, string>();
|
||||
Servers = new List<IReadOnlyDictionary<string, object>>()
|
||||
{
|
||||
{
|
||||
new Dictionary<string, object> {
|
||||
{"url", "http://localhost:3000"},
|
||||
{"description", "No description provided"},
|
||||
}
|
||||
}
|
||||
};
|
||||
OperationServers = new Dictionary<string, List<IReadOnlyDictionary<string, object>>>()
|
||||
{
|
||||
};
|
||||
|
||||
// Setting Timeout has side effects (forces ApiClient creation).
|
||||
Timeout = 100000;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Configuration" /> class
|
||||
/// </summary>
|
||||
[System.Diagnostics.CodeAnalysis.SuppressMessage("ReSharper", "VirtualMemberCallInConstructor")]
|
||||
public Configuration(
|
||||
IDictionary<string, string> defaultHeaders,
|
||||
IDictionary<string, string> apiKey,
|
||||
IDictionary<string, string> apiKeyPrefix,
|
||||
string basePath = "http://localhost:3000") : this()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(basePath))
|
||||
throw new ArgumentException("The provided basePath is invalid.", "basePath");
|
||||
if (defaultHeaders == null)
|
||||
throw new ArgumentNullException("defaultHeaders");
|
||||
if (apiKey == null)
|
||||
throw new ArgumentNullException("apiKey");
|
||||
if (apiKeyPrefix == null)
|
||||
throw new ArgumentNullException("apiKeyPrefix");
|
||||
|
||||
BasePath = basePath;
|
||||
|
||||
foreach (var keyValuePair in defaultHeaders)
|
||||
{
|
||||
DefaultHeaders.Add(keyValuePair);
|
||||
}
|
||||
|
||||
foreach (var keyValuePair in apiKey)
|
||||
{
|
||||
ApiKey.Add(keyValuePair);
|
||||
}
|
||||
|
||||
foreach (var keyValuePair in apiKeyPrefix)
|
||||
{
|
||||
ApiKeyPrefix.Add(keyValuePair);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the base path for API access.
|
||||
/// </summary>
|
||||
public virtual string BasePath
|
||||
{
|
||||
get { return _basePath; }
|
||||
set { _basePath = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
|
||||
/// </summary>
|
||||
public virtual bool UseDefaultCredentials
|
||||
{
|
||||
get { return _useDefaultCredentials; }
|
||||
set { _useDefaultCredentials = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default header.
|
||||
/// </summary>
|
||||
[Obsolete("Use DefaultHeaders instead.")]
|
||||
public virtual IDictionary<string, string> DefaultHeader
|
||||
{
|
||||
get
|
||||
{
|
||||
return DefaultHeaders;
|
||||
}
|
||||
set
|
||||
{
|
||||
DefaultHeaders = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default headers.
|
||||
/// </summary>
|
||||
public virtual IDictionary<string, string> DefaultHeaders { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
|
||||
/// </summary>
|
||||
public virtual int Timeout { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the proxy
|
||||
/// </summary>
|
||||
/// <value>Proxy.</value>
|
||||
public virtual WebProxy Proxy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the HTTP user agent.
|
||||
/// </summary>
|
||||
/// <value>Http user agent.</value>
|
||||
public virtual string UserAgent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the username (HTTP basic authentication).
|
||||
/// </summary>
|
||||
/// <value>The username.</value>
|
||||
public virtual string Username { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the password (HTTP basic authentication).
|
||||
/// </summary>
|
||||
/// <value>The password.</value>
|
||||
public virtual string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API key with prefix.
|
||||
/// </summary>
|
||||
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
|
||||
/// <returns>API key with prefix.</returns>
|
||||
public string GetApiKeyWithPrefix(string apiKeyIdentifier)
|
||||
{
|
||||
string apiKeyValue;
|
||||
ApiKey.TryGetValue(apiKeyIdentifier, out apiKeyValue);
|
||||
string apiKeyPrefix;
|
||||
if (ApiKeyPrefix.TryGetValue(apiKeyIdentifier, out apiKeyPrefix))
|
||||
{
|
||||
return apiKeyPrefix + " " + apiKeyValue;
|
||||
}
|
||||
|
||||
return apiKeyValue;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets certificate collection to be sent with requests.
|
||||
/// </summary>
|
||||
/// <value>X509 Certificate collection.</value>
|
||||
public X509CertificateCollection ClientCertificates { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the access token for OAuth2 authentication.
|
||||
///
|
||||
/// This helper property simplifies code generation.
|
||||
/// </summary>
|
||||
/// <value>The access token.</value>
|
||||
public virtual string AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the temporary folder path to store the files downloaded from the server.
|
||||
/// </summary>
|
||||
/// <value>Folder path.</value>
|
||||
public virtual string TempFolderPath
|
||||
{
|
||||
get { return _tempFolderPath; }
|
||||
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
_tempFolderPath = Path.GetTempPath();
|
||||
return;
|
||||
}
|
||||
|
||||
// create the directory if it does not exist
|
||||
if (!Directory.Exists(value))
|
||||
{
|
||||
Directory.CreateDirectory(value);
|
||||
}
|
||||
|
||||
// check if the path contains directory separator at the end
|
||||
if (value[value.Length - 1] == Path.DirectorySeparatorChar)
|
||||
{
|
||||
_tempFolderPath = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
_tempFolderPath = value + Path.DirectorySeparatorChar;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the date time format used when serializing in the ApiClient
|
||||
/// By default, it's set to ISO 8601 - "o", for others see:
|
||||
/// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx
|
||||
/// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx
|
||||
/// No validation is done to ensure that the string you're providing is valid
|
||||
/// </summary>
|
||||
/// <value>The DateTimeFormat string</value>
|
||||
public virtual string DateTimeFormat
|
||||
{
|
||||
get { return _dateTimeFormat; }
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value))
|
||||
{
|
||||
// Never allow a blank or null string, go back to the default
|
||||
_dateTimeFormat = ISO8601_DATETIME_FORMAT;
|
||||
return;
|
||||
}
|
||||
|
||||
// Caution, no validation when you choose date time format other than ISO 8601
|
||||
// Take a look at the above links
|
||||
_dateTimeFormat = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the prefix (e.g. Token) of the API key based on the authentication name.
|
||||
///
|
||||
/// Whatever you set here will be prepended to the value defined in AddApiKey.
|
||||
///
|
||||
/// An example invocation here might be:
|
||||
/// <example>
|
||||
/// ApiKeyPrefix["Authorization"] = "Bearer";
|
||||
/// </example>
|
||||
/// … where ApiKey["Authorization"] would then be used to set the value of your bearer token.
|
||||
///
|
||||
/// <remarks>
|
||||
/// OAuth2 workflows should set tokens via AccessToken.
|
||||
/// </remarks>
|
||||
/// </summary>
|
||||
/// <value>The prefix of the API key.</value>
|
||||
public virtual IDictionary<string, string> ApiKeyPrefix
|
||||
{
|
||||
get { return _apiKeyPrefix; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new InvalidOperationException("ApiKeyPrefix collection may not be null.");
|
||||
}
|
||||
_apiKeyPrefix = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the API key based on the authentication name.
|
||||
/// </summary>
|
||||
/// <value>The API key.</value>
|
||||
public virtual IDictionary<string, string> ApiKey
|
||||
{
|
||||
get { return _apiKey; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new InvalidOperationException("ApiKey collection may not be null.");
|
||||
}
|
||||
_apiKey = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the servers.
|
||||
/// </summary>
|
||||
/// <value>The servers.</value>
|
||||
public virtual IList<IReadOnlyDictionary<string, object>> Servers
|
||||
{
|
||||
get { return _servers; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new InvalidOperationException("Servers may not be null.");
|
||||
}
|
||||
_servers = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the operation servers.
|
||||
/// </summary>
|
||||
/// <value>The operation servers.</value>
|
||||
public virtual IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers
|
||||
{
|
||||
get { return _operationServers; }
|
||||
set
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new InvalidOperationException("Operation servers may not be null.");
|
||||
}
|
||||
_operationServers = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns URL based on server settings without providing values
|
||||
/// for the variables
|
||||
/// </summary>
|
||||
/// <param name="index">Array index of the server settings.</param>
|
||||
/// <return>The server URL.</return>
|
||||
public string GetServerUrl(int index)
|
||||
{
|
||||
return GetServerUrl(Servers, index, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns URL based on server settings.
|
||||
/// </summary>
|
||||
/// <param name="index">Array index of the server settings.</param>
|
||||
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
|
||||
/// <return>The server URL.</return>
|
||||
public string GetServerUrl(int index, Dictionary<string, string> inputVariables)
|
||||
{
|
||||
return GetServerUrl(Servers, index, inputVariables);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns URL based on operation server settings.
|
||||
/// </summary>
|
||||
/// <param name="operation">Operation associated with the request path.</param>
|
||||
/// <param name="index">Array index of the server settings.</param>
|
||||
/// <return>The operation server URL.</return>
|
||||
public string GetOperationServerUrl(string operation, int index)
|
||||
{
|
||||
return GetOperationServerUrl(operation, index, null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns URL based on operation server settings.
|
||||
/// </summary>
|
||||
/// <param name="operation">Operation associated with the request path.</param>
|
||||
/// <param name="index">Array index of the server settings.</param>
|
||||
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
|
||||
/// <return>The operation server URL.</return>
|
||||
public string GetOperationServerUrl(string operation, int index, Dictionary<string, string> inputVariables)
|
||||
{
|
||||
if (operation != null && OperationServers.TryGetValue(operation, out var operationServer))
|
||||
{
|
||||
return GetServerUrl(operationServer, index, inputVariables);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns URL based on server settings.
|
||||
/// </summary>
|
||||
/// <param name="servers">Dictionary of server settings.</param>
|
||||
/// <param name="index">Array index of the server settings.</param>
|
||||
/// <param name="inputVariables">Dictionary of the variables and the corresponding values.</param>
|
||||
/// <return>The server URL.</return>
|
||||
private string GetServerUrl(IList<IReadOnlyDictionary<string, object>> servers, int index, Dictionary<string, string> inputVariables)
|
||||
{
|
||||
if (index < 0 || index >= servers.Count)
|
||||
{
|
||||
throw new InvalidOperationException($"Invalid index {index} when selecting the server. Must be less than {servers.Count}.");
|
||||
}
|
||||
|
||||
if (inputVariables == null)
|
||||
{
|
||||
inputVariables = new Dictionary<string, string>();
|
||||
}
|
||||
|
||||
IReadOnlyDictionary<string, object> server = servers[index];
|
||||
string url = (string)server["url"];
|
||||
|
||||
if (server.ContainsKey("variables"))
|
||||
{
|
||||
// go through each variable and assign a value
|
||||
foreach (KeyValuePair<string, object> variable in (IReadOnlyDictionary<string, object>)server["variables"])
|
||||
{
|
||||
|
||||
IReadOnlyDictionary<string, object> serverVariables = (IReadOnlyDictionary<string, object>)(variable.Value);
|
||||
|
||||
if (inputVariables.ContainsKey(variable.Key))
|
||||
{
|
||||
if (((List<string>)serverVariables["enum_values"]).Contains(inputVariables[variable.Key]))
|
||||
{
|
||||
url = url.Replace("{" + variable.Key + "}", inputVariables[variable.Key]);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException($"The variable `{variable.Key}` in the server URL has invalid value #{inputVariables[variable.Key]}. Must be {(List<string>)serverVariables["enum_values"]}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// use default value
|
||||
url = url.Replace("{" + variable.Key + "}", (string)serverVariables["default_value"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets and Sets the RemoteCertificateValidationCallback
|
||||
/// </summary>
|
||||
public RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; set; }
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Returns a string with essential information for debugging.
|
||||
/// </summary>
|
||||
public static string ToDebugReport()
|
||||
{
|
||||
string report = "C# SDK (Org.OpenAPITools) Debug Report:\n";
|
||||
report += " OS: " + System.Environment.OSVersion + "\n";
|
||||
report += " .NET Framework Version: " + System.Environment.Version + "\n";
|
||||
report += " Version of the API: 0.1.0\n";
|
||||
report += " SDK Package Version: 1.0.0\n";
|
||||
|
||||
return report;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Api Key Header.
|
||||
/// </summary>
|
||||
/// <param name="key">Api Key name.</param>
|
||||
/// <param name="value">Api Key value.</param>
|
||||
/// <returns></returns>
|
||||
public void AddApiKey(string key, string value)
|
||||
{
|
||||
ApiKey[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the API key prefix.
|
||||
/// </summary>
|
||||
/// <param name="key">Api Key name.</param>
|
||||
/// <param name="value">Api Key value.</param>
|
||||
public void AddApiKeyPrefix(string key, string value)
|
||||
{
|
||||
ApiKeyPrefix[key] = value;
|
||||
}
|
||||
|
||||
#endregion Methods
|
||||
|
||||
#region Static Members
|
||||
/// <summary>
|
||||
/// Merge configurations.
|
||||
/// </summary>
|
||||
/// <param name="first">First configuration.</param>
|
||||
/// <param name="second">Second configuration.</param>
|
||||
/// <return>Merged configuration.</return>
|
||||
public static IReadableConfiguration MergeConfigurations(IReadableConfiguration first, IReadableConfiguration second)
|
||||
{
|
||||
if (second == null) return first ?? GlobalConfiguration.Instance;
|
||||
|
||||
Dictionary<string, string> apiKey = first.ApiKey.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||
Dictionary<string, string> apiKeyPrefix = first.ApiKeyPrefix.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||
Dictionary<string, string> defaultHeaders = first.DefaultHeaders.ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
|
||||
|
||||
foreach (var kvp in second.ApiKey) apiKey[kvp.Key] = kvp.Value;
|
||||
foreach (var kvp in second.ApiKeyPrefix) apiKeyPrefix[kvp.Key] = kvp.Value;
|
||||
foreach (var kvp in second.DefaultHeaders) defaultHeaders[kvp.Key] = kvp.Value;
|
||||
|
||||
var config = new Configuration
|
||||
{
|
||||
ApiKey = apiKey,
|
||||
ApiKeyPrefix = apiKeyPrefix,
|
||||
DefaultHeaders = defaultHeaders,
|
||||
BasePath = second.BasePath ?? first.BasePath,
|
||||
Timeout = second.Timeout,
|
||||
Proxy = second.Proxy ?? first.Proxy,
|
||||
UserAgent = second.UserAgent ?? first.UserAgent,
|
||||
Username = second.Username ?? first.Username,
|
||||
Password = second.Password ?? first.Password,
|
||||
AccessToken = second.AccessToken ?? first.AccessToken,
|
||||
TempFolderPath = second.TempFolderPath ?? first.TempFolderPath,
|
||||
DateTimeFormat = second.DateTimeFormat ?? first.DateTimeFormat,
|
||||
ClientCertificates = second.ClientCertificates ?? first.ClientCertificates,
|
||||
UseDefaultCredentials = second.UseDefaultCredentials,
|
||||
RemoteCertificateValidationCallback = second.RemoteCertificateValidationCallback ?? first.RemoteCertificateValidationCallback,
|
||||
};
|
||||
return config;
|
||||
}
|
||||
#endregion Static Members
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// A delegate to ExceptionFactory method
|
||||
/// </summary>
|
||||
/// <param name="methodName">Method name</param>
|
||||
/// <param name="response">Response</param>
|
||||
/// <returns>Exceptions</returns>
|
||||
public delegate Exception ExceptionFactory(string methodName, IApiResponse response);
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="GlobalConfiguration"/> provides a compile-time extension point for globally configuring
|
||||
/// API Clients.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// A customized implementation via partial class may reside in another file and may
|
||||
/// be excluded from automatic generation via a .openapi-generator-ignore file.
|
||||
/// </remarks>
|
||||
public partial class GlobalConfiguration : Configuration
|
||||
{
|
||||
#region Private Members
|
||||
|
||||
private static readonly object GlobalConfigSync = new { };
|
||||
private static IReadableConfiguration _globalConfiguration;
|
||||
|
||||
#endregion Private Members
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
private GlobalConfiguration()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public GlobalConfiguration(IDictionary<string, string> defaultHeader, IDictionary<string, string> apiKey, IDictionary<string, string> apiKeyPrefix, string basePath = "http://localhost:3000/api") : base(defaultHeader, apiKey, apiKeyPrefix, basePath)
|
||||
{
|
||||
}
|
||||
|
||||
static GlobalConfiguration()
|
||||
{
|
||||
Instance = new GlobalConfiguration();
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default Configuration.
|
||||
/// </summary>
|
||||
/// <value>Configuration.</value>
|
||||
public static IReadableConfiguration Instance
|
||||
{
|
||||
get { return _globalConfiguration; }
|
||||
set
|
||||
{
|
||||
lock (GlobalConfigSync)
|
||||
{
|
||||
_globalConfiguration = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Http methods supported by swagger
|
||||
/// </summary>
|
||||
public enum HttpMethod
|
||||
{
|
||||
/// <summary>HTTP GET request.</summary>
|
||||
Get,
|
||||
/// <summary>HTTP POST request.</summary>
|
||||
Post,
|
||||
/// <summary>HTTP PUT request.</summary>
|
||||
Put,
|
||||
/// <summary>HTTP DELETE request.</summary>
|
||||
Delete,
|
||||
/// <summary>HTTP HEAD request.</summary>
|
||||
Head,
|
||||
/// <summary>HTTP OPTIONS request.</summary>
|
||||
Options,
|
||||
/// <summary>HTTP PATCH request.</summary>
|
||||
Patch
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents configuration aspects required to interact with the API endpoints.
|
||||
/// </summary>
|
||||
public interface IApiAccessor
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the configuration object
|
||||
/// </summary>
|
||||
/// <value>An instance of the Configuration</value>
|
||||
IReadableConfiguration Configuration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path of the API client.
|
||||
/// </summary>
|
||||
/// <value>The base path</value>
|
||||
string GetBasePath();
|
||||
|
||||
/// <summary>
|
||||
/// Provides a factory method hook for the creation of exceptions.
|
||||
/// </summary>
|
||||
ExceptionFactory ExceptionFactory { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Contract for Asynchronous RESTful API interactions.
|
||||
///
|
||||
/// This interface allows consumers to provide a custom API accessor client.
|
||||
/// </summary>
|
||||
public interface IAsynchronousClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the GET http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the POST http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the PUT http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the DELETE http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the HEAD http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the OPTIONS http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
|
||||
/// <summary>
|
||||
/// Executes a non-blocking call to some <paramref name="path"/> using the PATCH http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>A task eventually representing the response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Security;
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a readable-only configuration contract.
|
||||
/// </summary>
|
||||
public interface IReadableConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the access token.
|
||||
/// </summary>
|
||||
/// <value>Access token.</value>
|
||||
string AccessToken { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API key.
|
||||
/// </summary>
|
||||
/// <value>API key.</value>
|
||||
IDictionary<string, string> ApiKey { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API key prefix.
|
||||
/// </summary>
|
||||
/// <value>API key prefix.</value>
|
||||
IDictionary<string, string> ApiKeyPrefix { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the base path.
|
||||
/// </summary>
|
||||
/// <value>Base path.</value>
|
||||
string BasePath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the date time format.
|
||||
/// </summary>
|
||||
/// <value>Date time format.</value>
|
||||
string DateTimeFormat { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default header.
|
||||
/// </summary>
|
||||
/// <value>Default header.</value>
|
||||
[Obsolete("Use DefaultHeaders instead.")]
|
||||
IDictionary<string, string> DefaultHeader { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the default headers.
|
||||
/// </summary>
|
||||
/// <value>Default headers.</value>
|
||||
IDictionary<string, string> DefaultHeaders { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the temp folder path.
|
||||
/// </summary>
|
||||
/// <value>Temp folder path.</value>
|
||||
string TempFolderPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HTTP connection timeout (in milliseconds)
|
||||
/// </summary>
|
||||
/// <value>HTTP connection timeout.</value>
|
||||
int Timeout { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the proxy.
|
||||
/// </summary>
|
||||
/// <value>Proxy.</value>
|
||||
WebProxy Proxy { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user agent.
|
||||
/// </summary>
|
||||
/// <value>User agent.</value>
|
||||
string UserAgent { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the username.
|
||||
/// </summary>
|
||||
/// <value>Username.</value>
|
||||
string Username { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the password.
|
||||
/// </summary>
|
||||
/// <value>Password.</value>
|
||||
string Password { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether or not the "default credentials" (e.g. the user account under which the current process is running) will be sent along to the server. The default is false.
|
||||
/// </summary>
|
||||
bool UseDefaultCredentials { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the servers associated with the operation.
|
||||
/// </summary>
|
||||
/// <value>Operation servers.</value>
|
||||
IReadOnlyDictionary<string, List<IReadOnlyDictionary<string, object>>> OperationServers { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the API key with prefix.
|
||||
/// </summary>
|
||||
/// <param name="apiKeyIdentifier">API key identifier (authentication scheme).</param>
|
||||
/// <returns>API key with prefix.</returns>
|
||||
string GetApiKeyWithPrefix(string apiKeyIdentifier);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Operation server url at the provided index.
|
||||
/// </summary>
|
||||
/// <param name="operation">Operation server name.</param>
|
||||
/// <param name="index">Index of the operation server settings.</param>
|
||||
/// <returns></returns>
|
||||
string GetOperationServerUrl(string operation, int index);
|
||||
|
||||
/// <summary>
|
||||
/// Gets certificate collection to be sent with requests.
|
||||
/// </summary>
|
||||
/// <value>X509 Certificate collection.</value>
|
||||
X509CertificateCollection ClientCertificates { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Callback function for handling the validation of remote certificates. Useful for certificate pinning and
|
||||
/// overriding certificate errors in the scope of a request.
|
||||
/// </summary>
|
||||
RemoteCertificateValidationCallback RemoteCertificateValidationCallback { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Contract for Synchronous RESTful API interactions.
|
||||
///
|
||||
/// This interface allows consumers to provide a custom API accessor client.
|
||||
/// </summary>
|
||||
public interface ISynchronousClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the GET http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the POST http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the PUT http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the DELETE http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the HEAD http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the OPTIONS http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
|
||||
/// <summary>
|
||||
/// Executes a blocking call to some <paramref name="path"/> using the PATCH http verb.
|
||||
/// </summary>
|
||||
/// <param name="path">The relative path to invoke.</param>
|
||||
/// <param name="options">The request parameters to pass along to the client.</param>
|
||||
/// <param name="configuration">Per-request configurable settings.</param>
|
||||
/// <typeparam name="T">The return type.</typeparam>
|
||||
/// <returns>The response data, decorated with <see cref="ApiResponse{T}"/></returns>
|
||||
ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// A dictionary in which one key has many associated values.
|
||||
/// </summary>
|
||||
/// <typeparam name="TKey">The type of the key</typeparam>
|
||||
/// <typeparam name="TValue">The type of the value associated with the key.</typeparam>
|
||||
public class Multimap<TKey, TValue> : IDictionary<TKey, IList<TValue>>
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly Dictionary<TKey, IList<TValue>> _dictionary;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <summary>
|
||||
/// Empty Constructor.
|
||||
/// </summary>
|
||||
public Multimap()
|
||||
{
|
||||
_dictionary = new Dictionary<TKey, IList<TValue>>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with comparer.
|
||||
/// </summary>
|
||||
/// <param name="comparer"></param>
|
||||
public Multimap(IEqualityComparer<TKey> comparer)
|
||||
{
|
||||
_dictionary = new Dictionary<TKey, IList<TValue>>(comparer);
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
|
||||
#region Enumerators
|
||||
|
||||
/// <summary>
|
||||
/// To get the enumerator.
|
||||
/// </summary>
|
||||
/// <returns>Enumerator</returns>
|
||||
public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator()
|
||||
{
|
||||
return _dictionary.GetEnumerator();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To get the enumerator.
|
||||
/// </summary>
|
||||
/// <returns>Enumerator</returns>
|
||||
IEnumerator IEnumerable.GetEnumerator()
|
||||
{
|
||||
return _dictionary.GetEnumerator();
|
||||
}
|
||||
|
||||
#endregion Enumerators
|
||||
|
||||
#region Public Members
|
||||
/// <summary>
|
||||
/// Add values to Multimap
|
||||
/// </summary>
|
||||
/// <param name="item">Key value pair</param>
|
||||
public void Add(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
if (!TryAdd(item.Key, item.Value))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Multimap to Multimap
|
||||
/// </summary>
|
||||
/// <param name="multimap">Multimap</param>
|
||||
public void Add(Multimap<TKey, TValue> multimap)
|
||||
{
|
||||
foreach (var item in multimap)
|
||||
{
|
||||
if (!TryAdd(item.Key, item.Value))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear Multimap
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
_dictionary.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether Multimap contains the specified item.
|
||||
/// </summary>
|
||||
/// <param name="item">Key value pair</param>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
/// <returns>true if the Multimap contains the item; otherwise, false.</returns>
|
||||
public bool Contains(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy items of the Multimap to an array,
|
||||
/// starting at a particular array index.
|
||||
/// </summary>
|
||||
/// <param name="array">The array that is the destination of the items copied
|
||||
/// from Multimap. The array must have zero-based indexing.</param>
|
||||
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes the specified item from the Multimap.
|
||||
/// </summary>
|
||||
/// <param name="item">Key value pair</param>
|
||||
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
public bool Remove(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the number of items contained in the Multimap.
|
||||
/// </summary>
|
||||
public int Count => _dictionary.Count;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Multimap is read-only.
|
||||
/// </summary>
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
/// <summary>
|
||||
/// Adds an item with the provided key and value to the Multimap.
|
||||
/// </summary>
|
||||
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||
/// <exception cref="InvalidOperationException">Thrown when couldn't add the value to Multimap.</exception>
|
||||
public void Add(TKey key, IList<TValue> value)
|
||||
{
|
||||
if (value != null && value.Count > 0)
|
||||
{
|
||||
if (_dictionary.TryGetValue(key, out var list))
|
||||
{
|
||||
foreach (var k in value) list.Add(k);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = new List<TValue>(value);
|
||||
if (!TryAdd(key, list))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the Multimap contains an item with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The key to locate in the Multimap.</param>
|
||||
/// <returns>true if the Multimap contains an item with
|
||||
/// the key; otherwise, false.</returns>
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
return _dictionary.ContainsKey(key);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes item with the specified key from the Multimap.
|
||||
/// </summary>
|
||||
/// <param name="key">The key to locate in the Multimap.</param>
|
||||
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||
public bool Remove(TKey key)
|
||||
{
|
||||
return TryRemove(key, out var _);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the value associated with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The key whose value to get.</param>
|
||||
/// <param name="value">When this method returns, the value associated with the specified key, if the
|
||||
/// key is found; otherwise, the default value for the type of the value parameter.
|
||||
/// This parameter is passed uninitialized.</param>
|
||||
/// <returns> true if the object that implements Multimap contains
|
||||
/// an item with the specified key; otherwise, false.</returns>
|
||||
public bool TryGetValue(TKey key, out IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryGetValue(key, out value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the item with the specified key.
|
||||
/// </summary>
|
||||
/// <param name="key">The key of the item to get or set.</param>
|
||||
/// <returns>The value of the specified key.</returns>
|
||||
public IList<TValue> this[TKey key]
|
||||
{
|
||||
get => _dictionary[key];
|
||||
set => _dictionary[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
|
||||
/// </summary>
|
||||
public ICollection<TKey> Keys => _dictionary.Keys;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
|
||||
/// </summary>
|
||||
public ICollection<IList<TValue>> Values => _dictionary.Values;
|
||||
|
||||
/// <summary>
|
||||
/// Copy the items of the Multimap to an System.Array,
|
||||
/// starting at a particular System.Array index.
|
||||
/// </summary>
|
||||
/// <param name="array">The one-dimensional System.Array that is the destination of the items copied
|
||||
/// from Multimap. The System.Array must have zero-based indexing.</param>
|
||||
/// <param name="index">The zero-based index in array at which copying begins.</param>
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
((ICollection)_dictionary).CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds an item with the provided key and value to the Multimap.
|
||||
/// </summary>
|
||||
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||
/// <exception cref="InvalidOperationException">Thrown when couldn't add value to Multimap.</exception>
|
||||
public void Add(TKey key, TValue value)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
if (_dictionary.TryGetValue(key, out var list))
|
||||
{
|
||||
list.Add(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = new List<TValue> { value };
|
||||
if (!TryAdd(key, list))
|
||||
throw new InvalidOperationException("Could not add value to Multimap.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Public Members
|
||||
|
||||
#region Private Members
|
||||
|
||||
/**
|
||||
* Helper method to encapsulate generator differences between dictionary types.
|
||||
*/
|
||||
private bool TryRemove(TKey key, out IList<TValue> value)
|
||||
{
|
||||
_dictionary.TryGetValue(key, out value);
|
||||
return _dictionary.Remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to encapsulate generator differences between dictionary types.
|
||||
*/
|
||||
private bool TryAdd(TKey key, IList<TValue> value)
|
||||
{
|
||||
try
|
||||
{
|
||||
_dictionary.Add(key, value);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion Private Members
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
using Newtonsoft.Json.Converters;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Formatter for 'date' openapi formats ss defined by full-date - RFC3339
|
||||
/// see https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#data-types
|
||||
/// </summary>
|
||||
public class OpenAPIDateConverter : IsoDateTimeConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OpenAPIDateConverter" /> class.
|
||||
/// </summary>
|
||||
public OpenAPIDateConverter()
|
||||
{
|
||||
// full-date = date-fullyear "-" date-month "-" date-mday
|
||||
DateTimeFormat = "yyyy-MM-dd";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// A container for generalized request inputs. This type allows consumers to extend the request functionality
|
||||
/// by abstracting away from the default (built-in) request framework (e.g. RestSharp).
|
||||
/// </summary>
|
||||
public class RequestOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Parameters to be bound to path parts of the Request's URL
|
||||
/// </summary>
|
||||
public Dictionary<string, string> PathParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Query parameters to be applied to the request.
|
||||
/// Keys may have 1 or more values associated.
|
||||
/// </summary>
|
||||
public Multimap<string, string> QueryParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Header parameters to be applied to the request.
|
||||
/// Keys may have 1 or more values associated.
|
||||
/// </summary>
|
||||
public Multimap<string, string> HeaderParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Form parameters to be sent along with the request.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> FormParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// File parameters to be sent along with the request.
|
||||
/// </summary>
|
||||
public Multimap<string, Stream> FileParameters { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Cookies to be sent along with the request.
|
||||
/// </summary>
|
||||
public List<Cookie> Cookies { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Operation associated with the request path.
|
||||
/// </summary>
|
||||
public string Operation { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Index associated with the operation.
|
||||
/// </summary>
|
||||
public int OperationIndex { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Any data associated with a request body.
|
||||
/// </summary>
|
||||
public Object Data { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a new instance of <see cref="RequestOptions"/>
|
||||
/// </summary>
|
||||
public RequestOptions()
|
||||
{
|
||||
PathParameters = new Dictionary<string, string>();
|
||||
QueryParameters = new Multimap<string, string>();
|
||||
HeaderParameters = new Multimap<string, string>();
|
||||
FormParameters = new Dictionary<string, string>();
|
||||
FileParameters = new Multimap<string, Stream>();
|
||||
Cookies = new List<Cookie>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Polly;
|
||||
using RestSharp;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration class to set the polly retry policies to be applied to the requests.
|
||||
/// </summary>
|
||||
public static class RetryConfiguration
|
||||
{
|
||||
/// <summary>
|
||||
/// Retry policy
|
||||
/// </summary>
|
||||
public static Policy<RestResponse> RetryPolicy { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Async retry policy
|
||||
/// </summary>
|
||||
public static AsyncPolicy<RestResponse> AsyncRetryPolicy { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Abstract base class for oneOf, anyOf schemas in the OpenAPI specification
|
||||
/// </summary>
|
||||
public abstract partial class AbstractOpenAPISchema
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom JSON serializer
|
||||
/// </summary>
|
||||
static public readonly JsonSerializerSettings SerializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
MissingMemberHandling = MissingMemberHandling.Error,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON serializer for objects with additional properties
|
||||
/// </summary>
|
||||
static public readonly JsonSerializerSettings AdditionalPropertiesSerializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
MissingMemberHandling = MissingMemberHandling.Ignore,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
OverrideSpecifiedNames = false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the actual instance
|
||||
/// </summary>
|
||||
public abstract Object ActualInstance { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets IsNullable to indicate whether the instance is nullable
|
||||
/// </summary>
|
||||
public bool IsNullable { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets the schema type, which can be either `oneOf` or `anyOf`
|
||||
/// </summary>
|
||||
public string SchemaType { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// Converts the instance into JSON string.
|
||||
/// </summary>
|
||||
public abstract string ToJson();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Bird
|
||||
/// </summary>
|
||||
[DataContract(Name = "Bird")]
|
||||
public partial class Bird : IEquatable<Bird>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Bird" /> class.
|
||||
/// </summary>
|
||||
/// <param name="size">size.</param>
|
||||
/// <param name="color">color.</param>
|
||||
public Bird(string size = default(string), string color = default(string))
|
||||
{
|
||||
this.Size = size;
|
||||
this.Color = color;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Size
|
||||
/// </summary>
|
||||
[DataMember(Name = "size", EmitDefaultValue = false)]
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
[DataMember(Name = "color", EmitDefaultValue = false)]
|
||||
public string Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Bird {\n");
|
||||
sb.Append(" Size: ").Append(Size).Append("\n");
|
||||
sb.Append(" Color: ").Append(Color).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as Bird);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Bird instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Bird to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Bird input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Size == input.Size ||
|
||||
(this.Size != null &&
|
||||
this.Size.Equals(input.Size))
|
||||
) &&
|
||||
(
|
||||
this.Color == input.Color ||
|
||||
(this.Color != null &&
|
||||
this.Color.Equals(input.Color))
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.Size != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Size.GetHashCode();
|
||||
}
|
||||
if (this.Color != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Color.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Category
|
||||
/// </summary>
|
||||
[DataContract(Name = "Category")]
|
||||
public partial class Category : IEquatable<Category>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Category" /> class.
|
||||
/// </summary>
|
||||
/// <param name="id">id.</param>
|
||||
/// <param name="name">name.</param>
|
||||
public Category(long id = default(long), string name = default(string))
|
||||
{
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
/// <example>1</example>
|
||||
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
/// <example>Dogs</example>
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Category {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as Category);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Category instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Category to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Category input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Id == input.Id ||
|
||||
this.Id.Equals(input.Id)
|
||||
) &&
|
||||
(
|
||||
this.Name == input.Name ||
|
||||
(this.Name != null &&
|
||||
this.Name.Equals(input.Name))
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
hashCode = (hashCode * 59) + this.Id.GetHashCode();
|
||||
if (this.Name != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Name.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,186 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// DataQuery
|
||||
/// </summary>
|
||||
[DataContract(Name = "DataQuery")]
|
||||
public partial class DataQuery : Query, IEquatable<DataQuery>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DataQuery" /> class.
|
||||
/// </summary>
|
||||
/// <param name="suffix">test suffix.</param>
|
||||
/// <param name="text">Some text containing white spaces.</param>
|
||||
/// <param name="date">A date.</param>
|
||||
/// <param name="id">Query.</param>
|
||||
/// <param name="outcomes">outcomes.</param>
|
||||
public DataQuery(string suffix = default(string), string text = default(string), DateTime date = default(DateTime), long id = default(long), List<OutcomesEnum> outcomes = default(List<OutcomesEnum>)) : base(id, outcomes)
|
||||
{
|
||||
this.Suffix = suffix;
|
||||
this.Text = text;
|
||||
this.Date = date;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// test suffix
|
||||
/// </summary>
|
||||
/// <value>test suffix</value>
|
||||
[DataMember(Name = "suffix", EmitDefaultValue = false)]
|
||||
public string Suffix { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Some text containing white spaces
|
||||
/// </summary>
|
||||
/// <value>Some text containing white spaces</value>
|
||||
/// <example>Some text</example>
|
||||
[DataMember(Name = "text", EmitDefaultValue = false)]
|
||||
public string Text { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A date
|
||||
/// </summary>
|
||||
/// <value>A date</value>
|
||||
[DataMember(Name = "date", EmitDefaultValue = false)]
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class DataQuery {\n");
|
||||
sb.Append(" ").Append(base.ToString().Replace("\n", "\n ")).Append("\n");
|
||||
sb.Append(" Suffix: ").Append(Suffix).Append("\n");
|
||||
sb.Append(" Text: ").Append(Text).Append("\n");
|
||||
sb.Append(" Date: ").Append(Date).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as DataQuery);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if DataQuery instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of DataQuery to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(DataQuery input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return base.Equals(input) &&
|
||||
(
|
||||
this.Suffix == input.Suffix ||
|
||||
(this.Suffix != null &&
|
||||
this.Suffix.Equals(input.Suffix))
|
||||
) && base.Equals(input) &&
|
||||
(
|
||||
this.Text == input.Text ||
|
||||
(this.Text != null &&
|
||||
this.Text.Equals(input.Text))
|
||||
) && base.Equals(input) &&
|
||||
(
|
||||
this.Date == input.Date ||
|
||||
(this.Date != null &&
|
||||
this.Date.Equals(input.Date))
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = base.GetHashCode();
|
||||
if (this.Suffix != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Suffix.GetHashCode();
|
||||
}
|
||||
if (this.Text != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Text.GetHashCode();
|
||||
}
|
||||
if (this.Date != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Date.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
return this.BaseValidate(validationContext);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
protected IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> BaseValidate(ValidationContext validationContext)
|
||||
{
|
||||
foreach (var x in BaseValidate(validationContext))
|
||||
{
|
||||
yield return x;
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// to test the default value of properties
|
||||
/// </summary>
|
||||
[DataContract(Name = "DefaultValue")]
|
||||
public partial class DefaultValue : IEquatable<DefaultValue>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines ArrayStringEnumDefault
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum ArrayStringEnumDefaultEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Success for value: success
|
||||
/// </summary>
|
||||
[EnumMember(Value = "success")]
|
||||
Success = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Failure for value: failure
|
||||
/// </summary>
|
||||
[EnumMember(Value = "failure")]
|
||||
Failure = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Unclassified for value: unclassified
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unclassified")]
|
||||
Unclassified = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="DefaultValue" /> class.
|
||||
/// </summary>
|
||||
/// <param name="arrayStringEnumRefDefault">arrayStringEnumRefDefault.</param>
|
||||
/// <param name="arrayStringEnumDefault">arrayStringEnumDefault.</param>
|
||||
/// <param name="arrayStringDefault">arrayStringDefault.</param>
|
||||
/// <param name="arrayIntegerDefault">arrayIntegerDefault.</param>
|
||||
/// <param name="arrayString">arrayString.</param>
|
||||
/// <param name="arrayStringNullable">arrayStringNullable.</param>
|
||||
/// <param name="arrayStringExtensionNullable">arrayStringExtensionNullable.</param>
|
||||
/// <param name="stringNullable">stringNullable.</param>
|
||||
public DefaultValue(List<StringEnumRef> arrayStringEnumRefDefault = default(List<StringEnumRef>), List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault = default(List<ArrayStringEnumDefaultEnum>), List<string> arrayStringDefault = default(List<string>), List<int> arrayIntegerDefault = default(List<int>), List<string> arrayString = default(List<string>), List<string> arrayStringNullable = default(List<string>), List<string> arrayStringExtensionNullable = default(List<string>), string stringNullable = default(string))
|
||||
{
|
||||
this.ArrayStringEnumRefDefault = arrayStringEnumRefDefault;
|
||||
this.ArrayStringEnumDefault = arrayStringEnumDefault;
|
||||
this.ArrayStringDefault = arrayStringDefault;
|
||||
this.ArrayIntegerDefault = arrayIntegerDefault;
|
||||
this.ArrayString = arrayString;
|
||||
this.ArrayStringNullable = arrayStringNullable;
|
||||
this.ArrayStringExtensionNullable = arrayStringExtensionNullable;
|
||||
this.StringNullable = stringNullable;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayStringEnumRefDefault
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_string_enum_ref_default", EmitDefaultValue = false)]
|
||||
public List<StringEnumRef> ArrayStringEnumRefDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayStringEnumDefault
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_string_enum_default", EmitDefaultValue = false)]
|
||||
public List<DefaultValue.ArrayStringEnumDefaultEnum> ArrayStringEnumDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayStringDefault
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_string_default", EmitDefaultValue = false)]
|
||||
public List<string> ArrayStringDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayIntegerDefault
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_integer_default", EmitDefaultValue = false)]
|
||||
public List<int> ArrayIntegerDefault { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayString
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_string", EmitDefaultValue = false)]
|
||||
public List<string> ArrayString { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayStringNullable
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_string_nullable", EmitDefaultValue = true)]
|
||||
public List<string> ArrayStringNullable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayStringExtensionNullable
|
||||
/// </summary>
|
||||
[DataMember(Name = "array_string_extension_nullable", EmitDefaultValue = true)]
|
||||
public List<string> ArrayStringExtensionNullable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets StringNullable
|
||||
/// </summary>
|
||||
[DataMember(Name = "string_nullable", EmitDefaultValue = true)]
|
||||
public string StringNullable { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class DefaultValue {\n");
|
||||
sb.Append(" ArrayStringEnumRefDefault: ").Append(ArrayStringEnumRefDefault).Append("\n");
|
||||
sb.Append(" ArrayStringEnumDefault: ").Append(ArrayStringEnumDefault).Append("\n");
|
||||
sb.Append(" ArrayStringDefault: ").Append(ArrayStringDefault).Append("\n");
|
||||
sb.Append(" ArrayIntegerDefault: ").Append(ArrayIntegerDefault).Append("\n");
|
||||
sb.Append(" ArrayString: ").Append(ArrayString).Append("\n");
|
||||
sb.Append(" ArrayStringNullable: ").Append(ArrayStringNullable).Append("\n");
|
||||
sb.Append(" ArrayStringExtensionNullable: ").Append(ArrayStringExtensionNullable).Append("\n");
|
||||
sb.Append(" StringNullable: ").Append(StringNullable).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as DefaultValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if DefaultValue instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of DefaultValue to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(DefaultValue input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.ArrayStringEnumRefDefault == input.ArrayStringEnumRefDefault ||
|
||||
this.ArrayStringEnumRefDefault != null &&
|
||||
input.ArrayStringEnumRefDefault != null &&
|
||||
this.ArrayStringEnumRefDefault.SequenceEqual(input.ArrayStringEnumRefDefault)
|
||||
) &&
|
||||
(
|
||||
this.ArrayStringEnumDefault == input.ArrayStringEnumDefault ||
|
||||
this.ArrayStringEnumDefault != null &&
|
||||
input.ArrayStringEnumDefault != null &&
|
||||
this.ArrayStringEnumDefault.SequenceEqual(input.ArrayStringEnumDefault)
|
||||
) &&
|
||||
(
|
||||
this.ArrayStringDefault == input.ArrayStringDefault ||
|
||||
this.ArrayStringDefault != null &&
|
||||
input.ArrayStringDefault != null &&
|
||||
this.ArrayStringDefault.SequenceEqual(input.ArrayStringDefault)
|
||||
) &&
|
||||
(
|
||||
this.ArrayIntegerDefault == input.ArrayIntegerDefault ||
|
||||
this.ArrayIntegerDefault != null &&
|
||||
input.ArrayIntegerDefault != null &&
|
||||
this.ArrayIntegerDefault.SequenceEqual(input.ArrayIntegerDefault)
|
||||
) &&
|
||||
(
|
||||
this.ArrayString == input.ArrayString ||
|
||||
this.ArrayString != null &&
|
||||
input.ArrayString != null &&
|
||||
this.ArrayString.SequenceEqual(input.ArrayString)
|
||||
) &&
|
||||
(
|
||||
this.ArrayStringNullable == input.ArrayStringNullable ||
|
||||
this.ArrayStringNullable != null &&
|
||||
input.ArrayStringNullable != null &&
|
||||
this.ArrayStringNullable.SequenceEqual(input.ArrayStringNullable)
|
||||
) &&
|
||||
(
|
||||
this.ArrayStringExtensionNullable == input.ArrayStringExtensionNullable ||
|
||||
this.ArrayStringExtensionNullable != null &&
|
||||
input.ArrayStringExtensionNullable != null &&
|
||||
this.ArrayStringExtensionNullable.SequenceEqual(input.ArrayStringExtensionNullable)
|
||||
) &&
|
||||
(
|
||||
this.StringNullable == input.StringNullable ||
|
||||
(this.StringNullable != null &&
|
||||
this.StringNullable.Equals(input.StringNullable))
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ArrayStringEnumRefDefault != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayStringEnumRefDefault.GetHashCode();
|
||||
}
|
||||
if (this.ArrayStringEnumDefault != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayStringEnumDefault.GetHashCode();
|
||||
}
|
||||
if (this.ArrayStringDefault != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayStringDefault.GetHashCode();
|
||||
}
|
||||
if (this.ArrayIntegerDefault != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayIntegerDefault.GetHashCode();
|
||||
}
|
||||
if (this.ArrayString != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayString.GetHashCode();
|
||||
}
|
||||
if (this.ArrayStringNullable != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayStringNullable.GetHashCode();
|
||||
}
|
||||
if (this.ArrayStringExtensionNullable != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.ArrayStringExtensionNullable.GetHashCode();
|
||||
}
|
||||
if (this.StringNullable != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.StringNullable.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// NumberPropertiesOnly
|
||||
/// </summary>
|
||||
[DataContract(Name = "NumberPropertiesOnly")]
|
||||
public partial class NumberPropertiesOnly : IEquatable<NumberPropertiesOnly>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NumberPropertiesOnly" /> class.
|
||||
/// </summary>
|
||||
/// <param name="number">number.</param>
|
||||
/// <param name="varFloat">varFloat.</param>
|
||||
/// <param name="varDouble">varDouble.</param>
|
||||
public NumberPropertiesOnly(decimal number = default(decimal), float varFloat = default(float), double varDouble = default(double))
|
||||
{
|
||||
this.Number = number;
|
||||
this.VarFloat = varFloat;
|
||||
this.VarDouble = varDouble;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Number
|
||||
/// </summary>
|
||||
[DataMember(Name = "number", EmitDefaultValue = false)]
|
||||
public decimal Number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets VarFloat
|
||||
/// </summary>
|
||||
[DataMember(Name = "float", EmitDefaultValue = false)]
|
||||
public float VarFloat { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets VarDouble
|
||||
/// </summary>
|
||||
[DataMember(Name = "double", EmitDefaultValue = false)]
|
||||
public double VarDouble { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class NumberPropertiesOnly {\n");
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" VarFloat: ").Append(VarFloat).Append("\n");
|
||||
sb.Append(" VarDouble: ").Append(VarDouble).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as NumberPropertiesOnly);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if NumberPropertiesOnly instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of NumberPropertiesOnly to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(NumberPropertiesOnly input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Number == input.Number ||
|
||||
this.Number.Equals(input.Number)
|
||||
) &&
|
||||
(
|
||||
this.VarFloat == input.VarFloat ||
|
||||
this.VarFloat.Equals(input.VarFloat)
|
||||
) &&
|
||||
(
|
||||
this.VarDouble == input.VarDouble ||
|
||||
this.VarDouble.Equals(input.VarDouble)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
hashCode = (hashCode * 59) + this.Number.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.VarFloat.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.VarDouble.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// VarDouble (double) maximum
|
||||
if (this.VarDouble > (double)50.2)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value less than or equal to 50.2.", new [] { "VarDouble" });
|
||||
}
|
||||
|
||||
// VarDouble (double) minimum
|
||||
if (this.VarDouble < (double)0.8)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for VarDouble, must be a value greater than or equal to 0.8.", new [] { "VarDouble" });
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Pet
|
||||
/// </summary>
|
||||
[DataContract(Name = "Pet")]
|
||||
public partial class Pet : IEquatable<Pet>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
/// <value>pet status in the store</value>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum StatusEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Available for value: available
|
||||
/// </summary>
|
||||
[EnumMember(Value = "available")]
|
||||
Available = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Pending for value: pending
|
||||
/// </summary>
|
||||
[EnumMember(Value = "pending")]
|
||||
Pending = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Sold for value: sold
|
||||
/// </summary>
|
||||
[EnumMember(Value = "sold")]
|
||||
Sold = 3
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// pet status in the store
|
||||
/// </summary>
|
||||
/// <value>pet status in the store</value>
|
||||
[DataMember(Name = "status", EmitDefaultValue = false)]
|
||||
public StatusEnum? Status { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Pet" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected Pet() { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Pet" /> class.
|
||||
/// </summary>
|
||||
/// <param name="id">id.</param>
|
||||
/// <param name="name">name (required).</param>
|
||||
/// <param name="category">category.</param>
|
||||
/// <param name="photoUrls">photoUrls (required).</param>
|
||||
/// <param name="tags">tags.</param>
|
||||
/// <param name="status">pet status in the store.</param>
|
||||
public Pet(long id = default(long), string name = default(string), Category category = default(Category), List<string> photoUrls = default(List<string>), List<Tag> tags = default(List<Tag>), StatusEnum? status = default(StatusEnum?))
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new ArgumentNullException("name is a required property for Pet and cannot be null");
|
||||
}
|
||||
this.Name = name;
|
||||
// to ensure "photoUrls" is required (not null)
|
||||
if (photoUrls == null)
|
||||
{
|
||||
throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null");
|
||||
}
|
||||
this.PhotoUrls = photoUrls;
|
||||
this.Id = id;
|
||||
this.Category = category;
|
||||
this.Tags = tags;
|
||||
this.Status = status;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
/// <example>10</example>
|
||||
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
/// <example>doggie</example>
|
||||
[DataMember(Name = "name", IsRequired = true, EmitDefaultValue = true)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Category
|
||||
/// </summary>
|
||||
[DataMember(Name = "category", EmitDefaultValue = false)]
|
||||
public Category Category { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PhotoUrls
|
||||
/// </summary>
|
||||
[DataMember(Name = "photoUrls", IsRequired = true, EmitDefaultValue = true)]
|
||||
public List<string> PhotoUrls { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Tags
|
||||
/// </summary>
|
||||
[DataMember(Name = "tags", EmitDefaultValue = false)]
|
||||
public List<Tag> Tags { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Pet {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" Category: ").Append(Category).Append("\n");
|
||||
sb.Append(" PhotoUrls: ").Append(PhotoUrls).Append("\n");
|
||||
sb.Append(" Tags: ").Append(Tags).Append("\n");
|
||||
sb.Append(" Status: ").Append(Status).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as Pet);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Pet instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Pet to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Pet input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Id == input.Id ||
|
||||
this.Id.Equals(input.Id)
|
||||
) &&
|
||||
(
|
||||
this.Name == input.Name ||
|
||||
(this.Name != null &&
|
||||
this.Name.Equals(input.Name))
|
||||
) &&
|
||||
(
|
||||
this.Category == input.Category ||
|
||||
(this.Category != null &&
|
||||
this.Category.Equals(input.Category))
|
||||
) &&
|
||||
(
|
||||
this.PhotoUrls == input.PhotoUrls ||
|
||||
this.PhotoUrls != null &&
|
||||
input.PhotoUrls != null &&
|
||||
this.PhotoUrls.SequenceEqual(input.PhotoUrls)
|
||||
) &&
|
||||
(
|
||||
this.Tags == input.Tags ||
|
||||
this.Tags != null &&
|
||||
input.Tags != null &&
|
||||
this.Tags.SequenceEqual(input.Tags)
|
||||
) &&
|
||||
(
|
||||
this.Status == input.Status ||
|
||||
this.Status.Equals(input.Status)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
hashCode = (hashCode * 59) + this.Id.GetHashCode();
|
||||
if (this.Name != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Name.GetHashCode();
|
||||
}
|
||||
if (this.Category != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Category.GetHashCode();
|
||||
}
|
||||
if (this.PhotoUrls != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.PhotoUrls.GetHashCode();
|
||||
}
|
||||
if (this.Tags != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Tags.GetHashCode();
|
||||
}
|
||||
hashCode = (hashCode * 59) + this.Status.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Query
|
||||
/// </summary>
|
||||
[DataContract(Name = "Query")]
|
||||
public partial class Query : IEquatable<Query>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines Outcomes
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum OutcomesEnum
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum SUCCESS for value: SUCCESS
|
||||
/// </summary>
|
||||
[EnumMember(Value = "SUCCESS")]
|
||||
SUCCESS = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum FAILURE for value: FAILURE
|
||||
/// </summary>
|
||||
[EnumMember(Value = "FAILURE")]
|
||||
FAILURE = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Enum SKIPPED for value: SKIPPED
|
||||
/// </summary>
|
||||
[EnumMember(Value = "SKIPPED")]
|
||||
SKIPPED = 3
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Query" /> class.
|
||||
/// </summary>
|
||||
/// <param name="id">Query.</param>
|
||||
/// <param name="outcomes">outcomes.</param>
|
||||
public Query(long id = default(long), List<OutcomesEnum> outcomes = default(List<OutcomesEnum>))
|
||||
{
|
||||
this.Id = id;
|
||||
this.Outcomes = outcomes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Query
|
||||
/// </summary>
|
||||
/// <value>Query</value>
|
||||
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Outcomes
|
||||
/// </summary>
|
||||
[DataMember(Name = "outcomes", EmitDefaultValue = false)]
|
||||
public List<Query.OutcomesEnum> Outcomes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Query {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Outcomes: ").Append(Outcomes).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as Query);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Query instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Query to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Query input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Id == input.Id ||
|
||||
this.Id.Equals(input.Id)
|
||||
) &&
|
||||
(
|
||||
this.Outcomes == input.Outcomes ||
|
||||
this.Outcomes != null &&
|
||||
input.Outcomes != null &&
|
||||
this.Outcomes.SequenceEqual(input.Outcomes)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
hashCode = (hashCode * 59) + this.Id.GetHashCode();
|
||||
if (this.Outcomes != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Outcomes.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines StringEnumRef
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(StringEnumConverter))]
|
||||
public enum StringEnumRef
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Success for value: success
|
||||
/// </summary>
|
||||
[EnumMember(Value = "success")]
|
||||
Success = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Failure for value: failure
|
||||
/// </summary>
|
||||
[EnumMember(Value = "failure")]
|
||||
Failure = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Enum Unclassified for value: unclassified
|
||||
/// </summary>
|
||||
[EnumMember(Value = "unclassified")]
|
||||
Unclassified = 3
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Tag
|
||||
/// </summary>
|
||||
[DataContract(Name = "Tag")]
|
||||
public partial class Tag : IEquatable<Tag>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Tag" /> class.
|
||||
/// </summary>
|
||||
/// <param name="id">id.</param>
|
||||
/// <param name="name">name.</param>
|
||||
public Tag(long id = default(long), string name = default(string))
|
||||
{
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Tag {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as Tag);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if Tag instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of Tag to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(Tag input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Id == input.Id ||
|
||||
this.Id.Equals(input.Id)
|
||||
) &&
|
||||
(
|
||||
this.Name == input.Name ||
|
||||
(this.Name != null &&
|
||||
this.Name.Equals(input.Name))
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
hashCode = (hashCode * 59) + this.Id.GetHashCode();
|
||||
if (this.Name != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Name.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
|
||||
/// </summary>
|
||||
[DataContract(Name = "test_query_style_deepObject_explode_true_object_allOf_query_object_parameter")]
|
||||
public partial class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter : IEquatable<TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter" /> class.
|
||||
/// </summary>
|
||||
/// <param name="size">size.</param>
|
||||
/// <param name="color">color.</param>
|
||||
/// <param name="id">id.</param>
|
||||
/// <param name="name">name.</param>
|
||||
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(string size = default(string), string color = default(string), long id = default(long), string name = default(string))
|
||||
{
|
||||
this.Size = size;
|
||||
this.Color = color;
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Size
|
||||
/// </summary>
|
||||
[DataMember(Name = "size", EmitDefaultValue = false)]
|
||||
public string Size { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Color
|
||||
/// </summary>
|
||||
[DataMember(Name = "color", EmitDefaultValue = false)]
|
||||
public string Color { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
/// <example>1</example>
|
||||
[DataMember(Name = "id", EmitDefaultValue = false)]
|
||||
public long Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
/// <example>Dogs</example>
|
||||
[DataMember(Name = "name", EmitDefaultValue = false)]
|
||||
public string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter {\n");
|
||||
sb.Append(" Size: ").Append(Size).Append("\n");
|
||||
sb.Append(" Color: ").Append(Color).Append("\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Size == input.Size ||
|
||||
(this.Size != null &&
|
||||
this.Size.Equals(input.Size))
|
||||
) &&
|
||||
(
|
||||
this.Color == input.Color ||
|
||||
(this.Color != null &&
|
||||
this.Color.Equals(input.Color))
|
||||
) &&
|
||||
(
|
||||
this.Id == input.Id ||
|
||||
this.Id.Equals(input.Id)
|
||||
) &&
|
||||
(
|
||||
this.Name == input.Name ||
|
||||
(this.Name != null &&
|
||||
this.Name.Equals(input.Name))
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.Size != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Size.GetHashCode();
|
||||
}
|
||||
if (this.Color != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Color.GetHashCode();
|
||||
}
|
||||
hashCode = (hashCode * 59) + this.Id.GetHashCode();
|
||||
if (this.Name != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Name.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Echo Server API
|
||||
*
|
||||
* Echo Server API
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: team@openapitools.org
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter
|
||||
/// </summary>
|
||||
[DataContract(Name = "test_query_style_form_explode_true_array_string_query_object_parameter")]
|
||||
public partial class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter : IEquatable<TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter" /> class.
|
||||
/// </summary>
|
||||
/// <param name="values">values.</param>
|
||||
public TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(List<string> values = default(List<string>))
|
||||
{
|
||||
this.Values = values;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Values
|
||||
/// </summary>
|
||||
[DataMember(Name = "values", EmitDefaultValue = false)]
|
||||
public List<string> Values { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter {\n");
|
||||
sb.Append(" Values: ").Append(Values).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return this.Equals(input as TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter input)
|
||||
{
|
||||
if (input == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return
|
||||
(
|
||||
this.Values == input.Values ||
|
||||
this.Values != null &&
|
||||
input.Values != null &&
|
||||
this.Values.SequenceEqual(input.Values)
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.Values != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Values.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo><!-- setting GenerateAssemblyInfo to false causes this bug https://github.com/dotnet/project-system/issues/3934 -->
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyName>Org.OpenAPITools</AssemblyName>
|
||||
<PackageId>Org.OpenAPITools</PackageId>
|
||||
<OutputType>Library</OutputType>
|
||||
<Authors>OpenAPI</Authors>
|
||||
<Company>OpenAPI</Company>
|
||||
<AssemblyTitle>OpenAPI Library</AssemblyTitle>
|
||||
<Description>A library generated from a OpenAPI doc</Description>
|
||||
<Copyright>No Copyright</Copyright>
|
||||
<RootNamespace>Org.OpenAPITools</RootNamespace>
|
||||
<Version>1.0.0</Version>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml</DocumentationFile>
|
||||
<RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>Minor update</PackageReleaseNotes>
|
||||
<Nullable>annotations</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JsonSubTypes" Version="2.0.1" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="RestSharp" Version="108.0.3" />
|
||||
<PackageReference Include="Polly" Version="7.2.3" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="System.Web" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Web" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user