Update C# API client with Petstore OAS2 (#240)

* update c# petstore with oas2

* add csharp tests
This commit is contained in:
William Cheng
2018-04-27 00:03:30 +08:00
committed by GitHub
parent 8640c172c9
commit 5ef5e540fd
30 changed files with 1653 additions and 919 deletions

View File

@@ -1 +1 @@
2.4.0-SNAPSHOT
3.0.0-SNAPSHOT

View File

@@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
- API version: 1.0.0
- SDK version: 1.0.0
- Build package: io.swagger.codegen.languages.CSharpClientCodegen
- Build package: org.openapitools.codegen.languages.CSharpClientCodegen
<a name="frameworks-supported"></a>
## Frameworks supported
@@ -71,12 +71,12 @@ namespace Example
{
var apiInstance = new AnotherFakeApi();
var body = new ModelClient(); // ModelClient | client model
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.TestSpecialTags(body);
ModelClient result = apiInstance.TestSpecialTags(modelClient);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -101,6 +101,7 @@ Class | Method | HTTP request | Description
*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
@@ -134,14 +135,15 @@ Class | Method | HTTP request | Description
- [Model.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
- [Model.Animal](docs/Animal.md)
- [Model.AnimalFarm](docs/AnimalFarm.md)
- [Model.ApiResponse](docs/ApiResponse.md)
- [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
- [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
- [Model.ArrayTest](docs/ArrayTest.md)
- [Model.Capitalization](docs/Capitalization.md)
- [Model.Cat](docs/Cat.md)
- [Model.Category](docs/Category.md)
- [Model.ClassModel](docs/ClassModel.md)
- [Model.Dog](docs/Dog.md)
- [Model.EnumArrays](docs/EnumArrays.md)
- [Model.EnumClass](docs/EnumClass.md)
- [Model.EnumTest](docs/EnumTest.md)
@@ -155,19 +157,14 @@ Class | Method | HTTP request | Description
- [Model.Name](docs/Name.md)
- [Model.NumberOnly](docs/NumberOnly.md)
- [Model.Order](docs/Order.md)
- [Model.OuterBoolean](docs/OuterBoolean.md)
- [Model.OuterComposite](docs/OuterComposite.md)
- [Model.OuterEnum](docs/OuterEnum.md)
- [Model.OuterNumber](docs/OuterNumber.md)
- [Model.OuterString](docs/OuterString.md)
- [Model.Pet](docs/Pet.md)
- [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md)
- [Model.Return](docs/Return.md)
- [Model.SpecialModelName](docs/SpecialModelName.md)
- [Model.Tag](docs/Tag.md)
- [Model.User](docs/User.md)
- [Model.Cat](docs/Cat.md)
- [Model.Dog](docs/Dog.md)
<a name="documentation-for-authorization"></a>

View File

@@ -9,7 +9,7 @@ Method | HTTP request | Description
<a name="testspecialtags"></a>
# **TestSpecialTags**
> ModelClient TestSpecialTags (ModelClient body)
> ModelClient TestSpecialTags (ModelClient modelClient)
To test special tags
@@ -30,12 +30,12 @@ namespace Example
public void main()
{
var apiInstance = new AnotherFakeApi();
var body = new ModelClient(); // ModelClient | client model
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test special tags
ModelClient result = apiInstance.TestSpecialTags(body);
ModelClient result = apiInstance.TestSpecialTags(modelClient);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -51,7 +51,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ModelClient**](ModelClient.md)| client model |
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type

View File

@@ -4,6 +4,7 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EnumString** | **string** | | [optional]
**EnumStringRequired** | **string** | |
**EnumInteger** | **int?** | | [optional]
**EnumNumber** | **double?** | | [optional]
**OuterEnum** | **OuterEnum** | | [optional]

View File

@@ -8,6 +8,7 @@ Method | HTTP request | Description
[**FakeOuterCompositeSerialize**](FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
[**FakeOuterNumberSerialize**](FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
[**FakeOuterStringSerialize**](FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
[**TestBodyWithQueryParams**](FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
[**TestClientModel**](FakeApi.md#testclientmodel) | **PATCH** /fake | To test \&quot;client\&quot; model
[**TestEndpointParameters**](FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**TestEnumParameters**](FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
@@ -17,7 +18,7 @@ Method | HTTP request | Description
<a name="fakeouterbooleanserialize"></a>
# **FakeOuterBooleanSerialize**
> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null)
> bool? FakeOuterBooleanSerialize (bool? booleanPostBody = null)
@@ -38,11 +39,11 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional)
var booleanPostBody = true; // bool? | Input boolean as post body (optional)
try
{
OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body);
bool? result = apiInstance.FakeOuterBooleanSerialize(booleanPostBody);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -58,11 +59,11 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional]
**booleanPostBody** | **bool?**| Input boolean as post body | [optional]
### Return type
[**OuterBoolean**](OuterBoolean.md)
**bool?**
### Authorization
@@ -71,13 +72,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="fakeoutercompositeserialize"></a>
# **FakeOuterCompositeSerialize**
> OuterComposite FakeOuterCompositeSerialize (OuterComposite body = null)
> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null)
@@ -98,11 +99,11 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional)
try
{
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(body);
OuterComposite result = apiInstance.FakeOuterCompositeSerialize(outerComposite);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -118,7 +119,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
### Return type
@@ -131,13 +132,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="fakeouternumberserialize"></a>
# **FakeOuterNumberSerialize**
> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null)
> decimal? FakeOuterNumberSerialize (decimal? body = null)
@@ -158,11 +159,11 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = new OuterNumber(); // OuterNumber | Input number as post body (optional)
var body = 1.2; // decimal? | Input number as post body (optional)
try
{
OuterNumber result = apiInstance.FakeOuterNumberSerialize(body);
decimal? result = apiInstance.FakeOuterNumberSerialize(body);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -178,11 +179,11 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional]
**body** | **decimal?**| Input number as post body | [optional]
### Return type
[**OuterNumber**](OuterNumber.md)
**decimal?**
### Authorization
@@ -191,13 +192,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: Not defined
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="fakeouterstringserialize"></a>
# **FakeOuterStringSerialize**
> OuterString FakeOuterStringSerialize (OuterString body = null)
> string FakeOuterStringSerialize (string body = null)
@@ -218,11 +219,11 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = new OuterString(); // OuterString | Input string as post body (optional)
var body = body_example; // string | Input string as post body (optional)
try
{
OuterString result = apiInstance.FakeOuterStringSerialize(body);
string result = apiInstance.FakeOuterStringSerialize(body);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -238,11 +239,11 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**OuterString**](OuterString.md)| Input string as post body | [optional]
**body** | **string**| Input string as post body | [optional]
### Return type
[**OuterString**](OuterString.md)
**string**
### Authorization
@@ -251,13 +252,72 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: */*
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="testbodywithqueryparams"></a>
# **TestBodyWithQueryParams**
> void TestBodyWithQueryParams (string query, User user)
### Example
```csharp
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class TestBodyWithQueryParamsExample
{
public void main()
{
var apiInstance = new FakeApi();
var query = query_example; // string |
var user = new User(); // User |
try
{
apiInstance.TestBodyWithQueryParams(query, user);
}
catch (Exception e)
{
Debug.Print("Exception when calling FakeApi.TestBodyWithQueryParams: " + e.Message );
}
}
}
}
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**query** | **string**| |
**user** | [**User**](User.md)| |
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="testclientmodel"></a>
# **TestClientModel**
> ModelClient TestClientModel (ModelClient body)
> ModelClient TestClientModel (ModelClient modelClient)
To test \"client\" model
@@ -278,12 +338,12 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var body = new ModelClient(); // ModelClient | client model
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test \"client\" model
ModelClient result = apiInstance.TestClientModel(body);
ModelClient result = apiInstance.TestClientModel(modelClient);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -299,7 +359,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ModelClient**](ModelClient.md)| client model |
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type
@@ -318,7 +378,7 @@ No authorization required
<a name="testendpointparameters"></a>
# **TestEndpointParameters**
> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)
> void TestEndpointParameters (decimal? number, double? _double, string patternWithoutDelimiter, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, string _string = null, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -346,13 +406,13 @@ namespace Example
var number = 8.14; // decimal? | None
var _double = 1.2; // double? | None
var patternWithoutDelimiter = patternWithoutDelimiter_example; // string | None
var _byte = B; // byte[] | None
var _byte = BYTE_ARRAY_DATA_HERE; // byte[] | None
var integer = 56; // int? | None (optional)
var int32 = 56; // int? | None (optional)
var int64 = 789; // long? | None (optional)
var _float = 3.4; // float? | None (optional)
var _string = _string_example; // string | None (optional)
var binary = B; // byte[] | None (optional)
var binary = BINARY_DATA_HERE; // System.IO.Stream | None (optional)
var date = 2013-10-20; // DateTime? | None (optional)
var dateTime = 2013-10-20T19:20:30+01:00; // DateTime? | None (optional)
var password = password_example; // string | None (optional)
@@ -385,7 +445,7 @@ Name | Type | Description | Notes
**int64** | **long?**| None | [optional]
**_float** | **float?**| None | [optional]
**_string** | **string**| None | [optional]
**binary** | **byte[]**| None | [optional]
**binary** | **System.IO.Stream****System.IO.Stream**| None | [optional]
**date** | **DateTime?**| None | [optional]
**dateTime** | **DateTime?**| None | [optional]
**password** | **string**| None | [optional]
@@ -401,14 +461,14 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="testenumparameters"></a>
# **TestEnumParameters**
> void TestEnumParameters (List<string> enumFormStringArray = null, string enumFormString = null, List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null)
> void TestEnumParameters (List<string> enumHeaderStringArray = null, string enumHeaderString = null, List<string> enumQueryStringArray = null, string enumQueryString = null, int? enumQueryInteger = null, double? enumQueryDouble = null, List<string> enumFormStringArray = null, string enumFormString = null)
To test enum parameters
@@ -429,19 +489,19 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var enumFormStringArray = enumFormStringArray_example; // List<string> | Form parameter enum test (string array) (optional)
var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional) (default to -efg)
var enumHeaderStringArray = enumHeaderStringArray_example; // List<string> | Header parameter enum test (string array) (optional)
var enumHeaderString = enumHeaderString_example; // string | Header parameter enum test (string) (optional) (default to -efg)
var enumQueryStringArray = enumQueryStringArray_example; // List<string> | Query parameter enum test (string array) (optional)
var enumQueryString = enumQueryString_example; // string | Query parameter enum test (string) (optional) (default to -efg)
var enumQueryInteger = 56; // int? | Query parameter enum test (double) (optional)
var enumQueryDouble = 1.2; // double? | Query parameter enum test (double) (optional)
var enumFormStringArray = enumFormStringArray_example; // List<string> | Form parameter enum test (string array) (optional)
var enumFormString = enumFormString_example; // string | Form parameter enum test (string) (optional)
try
{
// To test enum parameters
apiInstance.TestEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble);
apiInstance.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString);
}
catch (Exception e)
{
@@ -456,14 +516,14 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | **List&lt;string&gt;**| Form parameter enum test (string array) | [optional]
**enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg]
**enumHeaderStringArray** | **List&lt;string&gt;**| Header parameter enum test (string array) | [optional]
**enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg]
**enumQueryStringArray** | **List&lt;string&gt;**| Query parameter enum test (string array) | [optional]
**enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
**enumQueryInteger** | **int?**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **double?**| Query parameter enum test (double) | [optional]
**enumFormStringArray** | **List&lt;string&gt;**| Form parameter enum test (string array) | [optional]
**enumFormString** | **string**| Form parameter enum test (string) | [optional]
### Return type
@@ -475,14 +535,14 @@ No authorization required
### HTTP request headers
- **Content-Type**: */*
- **Accept**: */*
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="testinlineadditionalproperties"></a>
# **TestInlineAdditionalProperties**
> void TestInlineAdditionalProperties (Object param)
> void TestInlineAdditionalProperties (string requestBody)
test inline additionalProperties
@@ -501,12 +561,12 @@ namespace Example
public void main()
{
var apiInstance = new FakeApi();
var param = ; // Object | request body
var requestBody = new string(); // string | request body
try
{
// test inline additionalProperties
apiInstance.TestInlineAdditionalProperties(param);
apiInstance.TestInlineAdditionalProperties(requestBody);
}
catch (Exception e)
{
@@ -521,7 +581,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**param** | **Object**| request body |
**requestBody** | [**string**](string.md)| request body |
### Return type
@@ -593,7 +653,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -9,7 +9,9 @@ Method | HTTP request | Description
<a name="testclassname"></a>
# **TestClassname**
> ModelClient TestClassname (ModelClient body)
> ModelClient TestClassname (ModelClient modelClient)
To test class name in snake case
To test class name in snake case
@@ -33,12 +35,12 @@ namespace Example
// Configuration.Default.AddApiKeyPrefix("api_key_query", "Bearer");
var apiInstance = new FakeClassnameTags123Api();
var body = new ModelClient(); // ModelClient | client model
var modelClient = new ModelClient(); // ModelClient | client model
try
{
// To test class name in snake case
ModelClient result = apiInstance.TestClassname(body);
ModelClient result = apiInstance.TestClassname(modelClient);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -54,7 +56,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**ModelClient**](ModelClient.md)| client model |
**modelClient** | [**ModelClient**](ModelClient.md)| client model |
### Return type

View File

@@ -11,7 +11,7 @@ Name | Type | Description | Notes
**Double** | **double?** | | [optional]
**String** | **string** | | [optional]
**Byte** | **byte[]** | |
**Binary** | **byte[]** | | [optional]
**Binary** | **System.IO.Stream** | | [optional]
**Date** | **DateTime?** | |
**DateTime** | **DateTime?** | | [optional]
**Uuid** | **Guid?** | | [optional]

View File

@@ -3,9 +3,9 @@
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional]
**MyString** | [**OuterString**](OuterString.md) | | [optional]
**MyBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional]
**MyNumber** | **decimal?** | | [optional]
**MyString** | **string** | | [optional]
**MyBoolean** | **bool?** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="addpet"></a>
# **AddPet**
> void AddPet (Pet body)
> void AddPet (Pet pet)
Add a new pet to the store
@@ -38,12 +38,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Add a new pet to the store
apiInstance.AddPet(body);
apiInstance.AddPet(pet);
}
catch (Exception e)
{
@@ -58,7 +58,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -71,7 +71,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -134,7 +134,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -334,7 +334,7 @@ Name | Type | Description | Notes
<a name="updatepet"></a>
# **UpdatePet**
> void UpdatePet (Pet body)
> void UpdatePet (Pet pet)
Update an existing pet
@@ -356,12 +356,12 @@ namespace Example
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new PetApi();
var body = new Pet(); // Pet | Pet object that needs to be added to the store
var pet = new Pet(); // Pet | Pet object that needs to be added to the store
try
{
// Update an existing pet
apiInstance.UpdatePet(body);
apiInstance.UpdatePet(pet);
}
catch (Exception e)
{
@@ -376,7 +376,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
### Return type
@@ -389,7 +389,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/json, application/xml
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -454,7 +454,7 @@ void (empty response body)
### HTTP request headers
- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -484,7 +484,7 @@ namespace Example
var apiInstance = new PetApi();
var petId = 789; // long? | ID of pet to update
var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional)
var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional)
var file = BINARY_DATA_HERE; // System.IO.Stream | file to upload (optional)
try
{
@@ -507,7 +507,7 @@ Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**petId** | **long?**| ID of pet to update |
**additionalMetadata** | **string**| Additional data to pass to server | [optional]
**file** | **System.IO.Stream**| file to upload | [optional]
**file** | **System.IO.Stream****System.IO.Stream**| file to upload | [optional]
### Return type

View File

@@ -66,7 +66,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -195,7 +195,7 @@ No authorization required
<a name="placeorder"></a>
# **PlaceOrder**
> Order PlaceOrder (Order body)
> Order PlaceOrder (Order order)
Place an order for a pet
@@ -214,12 +214,12 @@ namespace Example
public void main()
{
var apiInstance = new StoreApi();
var body = new Order(); // Order | order placed for purchasing the pet
var order = new Order(); // Order | order placed for purchasing the pet
try
{
// Place an order for a pet
Order result = apiInstance.PlaceOrder(body);
Order result = apiInstance.PlaceOrder(order);
Debug.WriteLine(result);
}
catch (Exception e)
@@ -235,7 +235,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
### Return type

View File

@@ -16,7 +16,7 @@ Method | HTTP request | Description
<a name="createuser"></a>
# **CreateUser**
> void CreateUser (User body)
> void CreateUser (User user)
Create user
@@ -37,12 +37,12 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var body = new User(); // User | Created user object
var user = new User(); // User | Created user object
try
{
// Create user
apiInstance.CreateUser(body);
apiInstance.CreateUser(user);
}
catch (Exception e)
{
@@ -57,7 +57,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**User**](User.md)| Created user object |
**user** | [**User**](User.md)| Created user object |
### Return type
@@ -70,13 +70,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="createuserswitharrayinput"></a>
# **CreateUsersWithArrayInput**
> void CreateUsersWithArrayInput (List<User> body)
> void CreateUsersWithArrayInput (List<User> user)
Creates list of users with given input array
@@ -95,12 +95,12 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var body = new List<User>(); // List<User> | List of user object
var user = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithArrayInput(body);
apiInstance.CreateUsersWithArrayInput(user);
}
catch (Exception e)
{
@@ -115,7 +115,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
**user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type
@@ -128,13 +128,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="createuserswithlistinput"></a>
# **CreateUsersWithListInput**
> void CreateUsersWithListInput (List<User> body)
> void CreateUsersWithListInput (List<User> user)
Creates list of users with given input array
@@ -153,12 +153,12 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var body = new List<User>(); // List<User> | List of user object
var user = new List<User>(); // List<User> | List of user object
try
{
// Creates list of users with given input array
apiInstance.CreateUsersWithListInput(body);
apiInstance.CreateUsersWithListInput(user);
}
catch (Exception e)
{
@@ -173,7 +173,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**List&lt;User&gt;**](User.md)| List of user object |
**user** | [**List&lt;User&gt;**](List.md)| List of user object |
### Return type
@@ -186,7 +186,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -246,7 +246,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
@@ -271,7 +271,7 @@ namespace Example
public void main()
{
var apiInstance = new UserApi();
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
var username = username_example; // string | The name that needs to be fetched. Use user1 for testing.
try
{
@@ -292,7 +292,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
**username** | **string**| The name that needs to be fetched. Use user1 for testing. |
### Return type
@@ -420,13 +420,13 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
<a name="updateuser"></a>
# **UpdateUser**
> void UpdateUser (string username, User body)
> void UpdateUser (string username, User user)
Updated user
@@ -448,12 +448,12 @@ namespace Example
{
var apiInstance = new UserApi();
var username = username_example; // string | name that need to be deleted
var body = new User(); // User | Updated user object
var user = new User(); // User | Updated user object
try
{
// Updated user
apiInstance.UpdateUser(username, body);
apiInstance.UpdateUser(username, user);
}
catch (Exception e)
{
@@ -469,7 +469,7 @@ namespace Example
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**username** | **string**| name that need to be deleted |
**body** | [**User**](User.md)| Updated user object |
**user** | [**User**](User.md)| Updated user object |
### Return type
@@ -482,7 +482,7 @@ No authorization required
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/xml, application/json
- **Accept**: Not defined
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -1,13 +1,3 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.IO;
using System.Collections.Generic;
@@ -23,148 +13,312 @@ using IO.Swagger.Model;
namespace IO.Swagger.Test
{
/// <summary>
/// Class for testing PetApi
/// </summary>
/// <remarks>
/// This file is automatically generated by Swagger Codegen.
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class PetApiTests
{
private PetApi instance;
/// <summary>
/// Class for testing PetApi
/// </summary>
/// <remarks>
/// This file is automatically generated by Swagger Codegen.
/// Please update the test case below to test the API endpoint.
/// </remarks>
[TestFixture]
public class PetApiTests
{
private PetApi instance;
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
{
instance = new PetApi();
}
private long petId = 11088;
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
/// <summary>
/// Create a Pet object
/// </summary>
private Pet createPet()
{
// create pet
Pet p = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
p.Id = petId;
//p.Name = "Csharp test";
p.Status = Pet.StatusEnum.Available;
// create Category object
Category category = new Category();
category.Id = 56;
category.Name = "sample category name2";
List<String> photoUrls = new List<String>(new String[] { "sample photoUrls" });
// create Tag object
Tag tag = new Tag();
tag.Id = petId;
tag.Name = "csharp sample tag name1";
List<Tag> tags = new List<Tag>(new Tag[] { tag });
p.Tags = tags;
p.Category = category;
p.PhotoUrls = photoUrls;
}
return p;
}
/// <summary>
/// Test an instance of PetApi
/// </summary>
[Test]
public void InstanceTest()
{
// TODO uncomment below to test 'IsInstanceOfType' PetApi
//Assert.IsInstanceOfType(typeof(PetApi), instance, "instance is a PetApi");
}
/// <summary>
/// Convert string to byte array
/// </summary>
private byte[] GetBytes(string str)
{
byte[] bytes = new byte[str.Length * sizeof(char)];
System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
return bytes;
}
/// <summary>
/// Test AddPet
/// </summary>
[Test]
public void AddPetTest()
{
// TODO uncomment below to test the method and replace null with proper value
//Pet body = null;
//instance.AddPet(body);
}
/// <summary>
/// Test DeletePet
/// </summary>
[Test]
public void DeletePetTest()
{
// TODO uncomment below to test the method and replace null with proper value
//long? petId = null;
//string apiKey = null;
//instance.DeletePet(petId, apiKey);
}
/// <summary>
/// Test FindPetsByStatus
/// </summary>
[Test]
public void FindPetsByStatusTest()
{
// TODO uncomment below to test the method and replace null with proper value
//List<string> status = null;
//var response = instance.FindPetsByStatus(status);
//Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
}
/// <summary>
/// Test FindPetsByTags
/// </summary>
[Test]
public void FindPetsByTagsTest()
{
// TODO uncomment below to test the method and replace null with proper value
//List<string> tags = null;
//var response = instance.FindPetsByTags(tags);
//Assert.IsInstanceOf<List<Pet>> (response, "response is List<Pet>");
}
/// <summary>
/// Test GetPetById
/// </summary>
[Test]
public void GetPetByIdTest()
{
// TODO uncomment below to test the method and replace null with proper value
//long? petId = null;
//var response = instance.GetPetById(petId);
//Assert.IsInstanceOf<Pet> (response, "response is Pet");
}
/// <summary>
/// Test UpdatePet
/// </summary>
[Test]
public void UpdatePetTest()
{
// TODO uncomment below to test the method and replace null with proper value
//Pet body = null;
//instance.UpdatePet(body);
}
/// <summary>
/// Test UpdatePetWithForm
/// </summary>
[Test]
public void UpdatePetWithFormTest()
{
// TODO uncomment below to test the method and replace null with proper value
//long? petId = null;
//string name = null;
//string status = null;
//instance.UpdatePetWithForm(petId, name, status);
}
/// <summary>
/// Test UploadFile
/// </summary>
[Test]
public void UploadFileTest()
{
// TODO uncomment below to test the method and replace null with proper value
//long? petId = null;
//string additionalMetadata = null;
//System.IO.Stream file = null;
//var response = instance.UploadFile(petId, additionalMetadata, file);
//Assert.IsInstanceOf<ApiResponse> (response, "response is ApiResponse");
}
}
/// <summary>
/// Setup before each unit test
/// </summary>
[SetUp]
public void Init()
{
instance = new PetApi();
}
// create pet
Pet p = createPet();
// add pet before testing
PetApi petApi = new PetApi("http://petstore.swagger.io/v2/");
petApi.AddPet(p);
}
/// <summary>
/// Clean up after each unit test
/// </summary>
[TearDown]
public void Cleanup()
{
// remove the pet after testing
PetApi petApi = new PetApi();
petApi.DeletePet(petId, "test key");
}
/// <summary>
/// Test an instance of PetApi
/// </summary>
[Test]
public void InstanceTest()
{
Assert.IsInstanceOf<PetApi>(instance);
}
/// <summary>
/// Test AddPet
/// </summary>
[Test]
public void AddPetTest()
{
// create pet
Pet p = createPet();
instance.AddPet(p);
}
/// <summary>
/// Test DeletePet
/// </summary>
[Test]
public void DeletePetTest()
{
// no need to test as it'c covered by Cleanup() already
}
/// <summary>
/// Test FindPetsByStatus
/// </summary>
[Test]
public void FindPetsByStatusTest()
{
PetApi petApi = new PetApi();
List<String> tagsList = new List<String>(new String[] { "available" });
List<Pet> listPet = petApi.FindPetsByTags(tagsList);
foreach (Pet pet in listPet) // Loop through List with foreach.
{
Assert.IsInstanceOf<Pet>(pet);
Assert.AreEqual("csharp sample tag name1", pet.Tags[0]);
}
}
/// <summary>
/// Test FindPetsByTags
/// </summary>
[Test]
public void FindPetsByTagsTest()
{
List<string> tags = new List<String>(new String[] { "pet" });
var response = instance.FindPetsByTags(tags);
Assert.IsInstanceOf<List<Pet>>(response);
}
/// <summary>
/// Test GetPetById
/// </summary>
[Test]
public void GetPetByIdTest()
{
// set timeout to 10 seconds
Configuration c1 = new Configuration();
c1.Timeout = 10000;
c1.UserAgent = "TEST_USER_AGENT";
PetApi petApi = new PetApi(c1);
Pet response = petApi.GetPetById(petId);
Assert.IsInstanceOf<Pet>(response);
Assert.AreEqual("Csharp test", response.Name);
Assert.AreEqual(Pet.StatusEnum.Available, response.Status);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual("csharp sample tag name1", response.Tags[0].Name);
Assert.IsInstanceOf<List<String>>(response.PhotoUrls);
Assert.AreEqual("sample photoUrls", response.PhotoUrls[0]);
Assert.IsInstanceOf<Category>(response.Category);
Assert.AreEqual(56, response.Category.Id);
Assert.AreEqual("sample category name2", response.Category.Name);
}
/// <summary>
/// Test GetPetByIdAsync
/// </summary>
[Test()]
public void TestGetPetByIdAsync()
{
PetApi petApi = new PetApi();
var task = petApi.GetPetByIdAsync(petId);
Pet response = task.Result;
Assert.IsInstanceOf<Pet>(response);
Assert.AreEqual("Csharp test", response.Name);
Assert.AreEqual(Pet.StatusEnum.Available, response.Status);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual("csharp sample tag name1", response.Tags[0].Name);
Assert.IsInstanceOf<List<String>>(response.PhotoUrls);
Assert.AreEqual("sample photoUrls", response.PhotoUrls[0]);
Assert.IsInstanceOf<Category>(response.Category);
Assert.AreEqual(56, response.Category.Id);
Assert.AreEqual("sample category name2", response.Category.Name);
}
/// <summary>
/// Test GetPetByIdAsyncWithHttpInfo
/// </summary>
[Test()]
public void TestGetPetByIdAsyncWithHttpInfo()
{
PetApi petApi = new PetApi();
var task = petApi.GetPetByIdAsyncWithHttpInfo(petId);
Assert.AreEqual(200, task.Result.StatusCode);
Assert.IsTrue(task.Result.Headers.ContainsKey("Content-Type"));
Assert.AreEqual(task.Result.Headers["Content-Type"], "application/json");
Pet response = task.Result.Data;
Assert.IsInstanceOf<Pet>(response);
Assert.AreEqual("Csharp test", response.Name);
Assert.AreEqual(Pet.StatusEnum.Available, response.Status);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual("csharp sample tag name1", response.Tags[0].Name);
Assert.IsInstanceOf<List<String>>(response.PhotoUrls);
Assert.AreEqual("sample photoUrls", response.PhotoUrls[0]);
Assert.IsInstanceOf<Category>(response.Category);
Assert.AreEqual(56, response.Category.Id);
Assert.AreEqual("sample category name2", response.Category.Name);
}
/// <summary>
/// Test UpdatePet
/// </summary>
[Test]
public void UpdatePetTest()
{
// create pet
Pet p = createPet();
instance.UpdatePet(p);
}
/// <summary>
/// Test UpdatePetWithForm
/// </summary>
[Test]
public void UpdatePetWithFormTest()
{
PetApi petApi = new PetApi();
petApi.UpdatePetWithForm(petId, "new form name", "pending");
Pet response = petApi.GetPetById(petId);
Assert.IsInstanceOf<Pet>(response);
Assert.IsInstanceOf<Category>(response.Category);
Assert.IsInstanceOf<List<Tag>>(response.Tags);
Assert.AreEqual("new form name", response.Name);
Assert.AreEqual(Pet.StatusEnum.Pending, response.Status);
Assert.AreEqual(petId, response.Tags[0].Id);
Assert.AreEqual(56, response.Category.Id);
// test optional parameter
petApi.UpdatePetWithForm(petId, "new form name2");
Pet response2 = petApi.GetPetById(petId);
Assert.AreEqual("new form name2", response2.Name);
}
/// <summary>
/// Test UploadFile
/// </summary>
[Test]
public void UploadFileTest()
{
Assembly _assembly = Assembly.GetExecutingAssembly();
Stream _imageStream = _assembly.GetManifestResourceStream("IO.Swagger.Test.linux-logo.png");
PetApi petApi = new PetApi();
// test file upload with form parameters
petApi.UploadFile(petId, "new form name", _imageStream);
// test file upload without any form parameters
// using optional parameter syntax introduced at .net 4.0
petApi.UploadFile(petId: petId, file: _imageStream);
}
/// <summary>
/// Test status code
/// </summary>
[Test()]
public void TestStatusCodeAndHeader()
{
PetApi petApi = new PetApi();
var response = petApi.GetPetByIdWithHttpInfo(petId);
Assert.AreEqual(response.StatusCode, 200);
Assert.IsTrue(response.Headers.ContainsKey("Content-Type"));
Assert.AreEqual(response.Headers["Content-Type"], "application/json");
}
/// <summary>
/// Test default header (should be deprecated
/// </summary>
[Test()]
public void TestDefaultHeader()
{
PetApi petApi = new PetApi();
// commented out the warning test below as it's confirmed the warning is working as expected
// there should be a warning for using AddDefaultHeader (deprecated) below
//petApi.AddDefaultHeader ("header_key", "header_value");
// the following should be used instead as suggested in the doc
petApi.Configuration.AddDefaultHeader("header_key2", "header_value2");
}
}
}

View File

@@ -0,0 +1,139 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using IO.Swagger.Client;
using IO.Swagger.Api;
using IO.Swagger.Model;
namespace IO.Swagger.Test
{
public class ApiClientTests
{
public ApiClientTests()
{
}
[TearDown()]
public void TearDown()
{
// Reset to default, just in case
Configuration.Default.DateTimeFormat = "o";
}
/// <summary>
/// Test SelectHeaderContentType
/// </summary>
[Test()]
public void TestSelectHeaderContentType()
{
ApiClient api = new ApiClient();
String[] contentTypes = new String[] { "application/json", "application/xml" };
Assert.AreEqual("application/json", api.SelectHeaderContentType(contentTypes));
contentTypes = new String[] { "application/xml" };
Assert.AreEqual("application/xml", api.SelectHeaderContentType(contentTypes));
contentTypes = new String[] { };
Assert.AreEqual("application/json", api.SelectHeaderContentType(contentTypes));
}
/// <summary>
/// Test ParameterToString
/// </summary>
[Test()]
public void TestParameterToString()
{
ApiClient api = new ApiClient();
// test array of string
List<string> statusList = new List<String>(new String[] { "available", "sold" });
Assert.AreEqual("available,sold", api.ParameterToString(statusList));
// test array of int
List<int> numList = new List<int>(new int[] { 1, 37 });
Assert.AreEqual("1,37", api.ParameterToString(numList));
}
[Test()]
public void TestParameterToStringForDateTime()
{
ApiClient api = new ApiClient();
// test datetime
DateTime dateUtc = DateTime.Parse("2008-04-10T13:30:00.0000000z", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("2008-04-10T13:30:00.0000000Z", api.ParameterToString(dateUtc));
// test datetime with no timezone
DateTime dateWithNoTz = DateTime.Parse("2008-04-10T13:30:00.000", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("2008-04-10T13:30:00.0000000", api.ParameterToString(dateWithNoTz));
}
// The test below only passes when running at -04:00 timezone
[Ignore()]
public void TestParameterToStringWithTimeZoneForDateTime()
{
ApiClient api = new ApiClient();
// test datetime with a time zone
DateTimeOffset dateWithTz = DateTimeOffset.Parse("2008-04-10T13:30:00.0000000-04:00", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("2008-04-10T13:30:00.0000000-04:00", api.ParameterToString(dateWithTz));
}
[Test()]
public void TestParameterToStringForDateTimeWithUFormat()
{
// Setup the DateTimeFormat across all of the calls
Configuration.Default.DateTimeFormat = "u";
ApiClient api = new ApiClient();
// test datetime
DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("2009-06-15 20:45:30Z", api.ParameterToString(dateUtc));
}
[Test()]
public void TestParameterToStringForDateTimeWithCustomFormat()
{
// Setup the DateTimeFormat across all of the calls
Configuration.Default.DateTimeFormat = "dd/MM/yy HH:mm:ss";
ApiClient api = new ApiClient();
// test datetime
DateTime dateUtc = DateTime.Parse("2009-06-15 20:45:30Z", null, System.Globalization.DateTimeStyles.RoundtripKind);
Assert.AreEqual("15/06/09 20:45:30", api.ParameterToString(dateUtc));
}
[Test()]
public void TestSanitizeFilename()
{
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("sun.gif"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("../sun.gif"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("/var/tmp/sun.gif"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("./sun.gif"));
Assert.AreEqual("sun", ApiClient.SanitizeFilename("sun"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("..\\sun.gif"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("\\var\\tmp\\sun.gif"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename("c:\\var\\tmp\\sun.gif"));
Assert.AreEqual("sun.gif", ApiClient.SanitizeFilename(".\\sun.gif"));
}
[Test()]
public void TestApiClientInstance()
{
PetApi p1 = new PetApi();
PetApi p2 = new PetApi();
Configuration c1 = new Configuration(); // using default ApiClient
PetApi p3 = new PetApi(c1);
// ensure both using the same default ApiClient
Assert.AreSame(p1.Configuration.ApiClient, p2.Configuration.ApiClient);
Assert.AreSame(p1.Configuration.ApiClient, Configuration.Default.ApiClient);
// ensure both using the same default ApiClient
Assert.AreSame(p3.Configuration.ApiClient, c1.ApiClient);
}
}
}

View File

@@ -0,0 +1,111 @@
using NUnit.Framework;
using System;
using System.Collections.Generic;
using IO.Swagger.Client;
using IO.Swagger.Api;
using IO.Swagger.Model;
namespace IO.Swagger.Test
{
public class ConfigurationTests
{
public ConfigurationTests()
{
}
[TearDown()]
public void TearDown()
{
// Reset to default, just in case
Configuration.Default.DateTimeFormat = "o";
}
[Test()]
public void TestAuthentication()
{
Configuration c = new Configuration();
c.Username = "test_username";
c.Password = "test_password";
c.ApiKey["api_key_identifier"] = "1233456778889900";
c.ApiKeyPrefix["api_key_identifier"] = "PREFIX";
Assert.AreEqual(c.GetApiKeyWithPrefix("api_key_identifier"), "PREFIX 1233456778889900");
}
[Test()]
public void TestBasePath()
{
PetApi p = new PetApi("http://new-basepath.com");
Assert.AreEqual(p.Configuration.ApiClient.RestClient.BaseUrl, "http://new-basepath.com");
// Given that PetApi is initailized with a base path, a new configuration (with a new ApiClient)
// is created by default
Assert.AreNotSame(p.Configuration, Configuration.Default);
}
[Test()]
public void TestDateTimeFormat_Default()
{
// Should default to the Round-trip Format Specifier - "o"
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
Assert.AreEqual("o", Configuration.Default.DateTimeFormat);
}
[Test()]
public void TestDateTimeFormat_UType()
{
Configuration.Default.DateTimeFormat = "u";
Assert.AreEqual("u", Configuration.Default.DateTimeFormat);
}
[Test()]
public void TestDefautlConfiguration()
{
PetApi p1 = new PetApi();
PetApi p2 = new PetApi();
Assert.AreSame(p1.Configuration, p2.Configuration);
// same as the default
Assert.AreSame(p1.Configuration, Configuration.Default);
Configuration c = new Configuration();
Assert.AreNotSame(c, p1.Configuration);
PetApi p3 = new PetApi(c);
// same as c
Assert.AreSame(p3.Configuration, c);
// not same as default
Assert.AreNotSame(p3.Configuration, p1.Configuration);
}
[Test()]
public void TestUsage()
{
// basic use case using default base URL
PetApi p1 = new PetApi();
Assert.AreSame(p1.Configuration, Configuration.Default, "PetApi should use default configuration");
// using a different base URL
PetApi p2 = new PetApi("http://new-base-url.com/");
Assert.AreEqual(p2.Configuration.ApiClient.RestClient.BaseUrl.ToString(), "http://new-base-url.com/");
// using a different configuration
Configuration c1 = new Configuration();
PetApi p3 = new PetApi(c1);
Assert.AreSame(p3.Configuration, c1);
}
[Test()]
public void TestTimeout()
{
Configuration c1 = new Configuration();
Assert.AreEqual(100000, c1.Timeout); // default vaue
c1.Timeout = 50000;
Assert.AreEqual(50000, c1.Timeout);
}
}
}

View File

@@ -72,8 +72,9 @@ Contact: apiteam@swagger.io
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="**\*.cs"
Exclude="obj\**"/>
<Compile Include="**\*.cs" Exclude="obj\**" />
<Compile Include="Client\ApiClientTest.cs" />
<Compile Include="Client\Configuration.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@@ -85,5 +86,11 @@ Contact: apiteam@swagger.io
<Name>IO.Swagger</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="Client\" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="linux-logo.png" />
</ItemGroup>
</Project>

View File

@@ -1,14 +1,3 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using NUnit.Framework;
using System;
@@ -19,102 +8,162 @@ using IO.Swagger.Api;
using IO.Swagger.Model;
using IO.Swagger.Client;
using System.Reflection;
using Newtonsoft.Json;
namespace IO.Swagger.Test
{
/// <summary>
/// Class for testing Pet
/// </summary>
/// <remarks>
/// This file is automatically generated by Swagger Codegen.
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class PetTests
{
// TODO uncomment below to declare an instance variable for Pet
//private Pet instance;
/// <summary>
/// Class for testing Pet
/// </summary>
/// <remarks>
/// This file is automatically generated by Swagger Codegen.
/// Please update the test case below to test the model.
/// </remarks>
[TestFixture]
public class PetTests
{
private Pet instance;
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
// TODO uncomment below to create an instance of Pet
//instance = new Pet();
}
private long petId = 11088;
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
/// <summary>
/// Setup before each test
/// </summary>
[SetUp]
public void Init()
{
instance = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
}
}
/// <summary>
/// Clean up after each test
/// </summary>
[TearDown]
public void Cleanup()
{
/// <summary>
/// Test an instance of Pet
/// </summary>
[Test]
public void PetInstanceTest()
{
// TODO uncomment below to test "IsInstanceOfType" Pet
//Assert.IsInstanceOfType<Pet> (instance, "variable 'instance' is a Pet");
}
}
/// <summary>
/// Test an instance of Pet
/// </summary>
[Test]
public void PetInstanceTest()
{
Assert.IsInstanceOfType(typeof(Pet), instance);
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
public void IdTest()
{
// TODO unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Test]
public void CategoryTest()
{
// TODO unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
public void NameTest()
{
// TODO unit test for the property 'Name'
}
/// <summary>
/// Test the property 'PhotoUrls'
/// </summary>
[Test]
public void PhotoUrlsTest()
{
// TODO unit test for the property 'PhotoUrls'
}
/// <summary>
/// Test the property 'Tags'
/// </summary>
[Test]
public void TagsTest()
{
// TODO unit test for the property 'Tags'
}
/// <summary>
/// Test the property 'Status'
/// </summary>
[Test]
public void StatusTest()
{
// TODO unit test for the property 'Status'
}
/// <summary>
/// Test the property 'Id'
/// </summary>
[Test]
public void IdTest()
{
// TODO: unit test for the property 'Id'
}
/// <summary>
/// Test the property 'Category'
/// </summary>
[Test]
public void CategoryTest()
{
// TODO: unit test for the property 'Category'
}
/// <summary>
/// Test the property 'Name'
/// </summary>
[Test]
public void NameTest()
{
// TODO: unit test for the property 'Name'
}
/// <summary>
/// Test the property 'PhotoUrls'
/// </summary>
[Test]
public void PhotoUrlsTest()
{
// TODO: unit test for the property 'PhotoUrls'
}
/// <summary>
/// Test the property 'Tags'
/// </summary>
[Test]
public void TagsTest()
{
// TODO: unit test for the property 'Tags'
}
/// <summary>
/// Test the property 'Status'
/// </summary>
[Test]
public void StatusTest()
{
// TODO: unit test for the property 'Status'
}
}
/// <summary>
/// Test Equal
/// </summary>
[Test()]
public void TestEqual()
{
// create pet
Pet p1 = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
p1.Id = petId;
//p1.Name = "Csharp test";
p1.Status = Pet.StatusEnum.Available;
// create Category object
Category category1 = new Category();
category1.Id = 56;
category1.Name = "sample category name2";
List<String> photoUrls1 = new List<String>(new String[] { "sample photoUrls" });
// create Tag object
Tag tag1 = new Tag();
tag1.Id = petId;
tag1.Name = "csharp sample tag name1";
List<Tag> tags1 = new List<Tag>(new Tag[] { tag1 });
p1.Tags = tags1;
p1.Category = category1;
p1.PhotoUrls = photoUrls1;
}
// create pet 2
Pet p2 = new Pet(name: "Csharp test", photoUrls: new List<string> { "http://petstore.com/csharp_test" });
p2.Id = petId;
p2.Name = "Csharp test";
p2.Status = Pet.StatusEnum.Available;
// create Category object
Category category2 = new Category();
category2.Id = 56;
category2.Name = "sample category name2";
List<String> photoUrls2 = new List<String>(new String[] { "sample photoUrls" });
// create Tag object
Tag tag2 = new Tag();
tag2.Id = petId;
tag2.Name = "csharp sample tag name1";
List<Tag> tags2 = new List<Tag>(new Tag[] { tag2 });
p2.Tags = tags2;
p2.Category = category2;
p2.PhotoUrls = photoUrls2;
// p1 and p2 should be equal (both object and attribute level)
Assert.IsTrue(category1.Equals(category2));
Assert.IsTrue(tags1.SequenceEqual(tags2));
Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.IsTrue(p1.Equals(p2));
// update attribute to that p1 and p2 are not equal
category2.Name = "new category name";
Assert.IsFalse(category1.Equals(category2));
tags2 = new List<Tag>();
Assert.IsFalse(tags1.SequenceEqual(tags2));
// photoUrls has not changed so it should be equal
Assert.IsTrue(p1.PhotoUrls.SequenceEqual(p2.PhotoUrls));
Assert.IsFalse(p1.Equals(p2));
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

View File

@@ -31,9 +31,9 @@ namespace IO.Swagger.Api
/// To test special tags
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ModelClient</returns>
ModelClient TestSpecialTags (ModelClient body);
ModelClient TestSpecialTags (ModelClient modelClient);
/// <summary>
/// To test special tags
@@ -42,9 +42,9 @@ namespace IO.Swagger.Api
/// To test special tags
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
ApiResponse<ModelClient> TestSpecialTagsWithHttpInfo (ModelClient body);
ApiResponse<ModelClient> TestSpecialTagsWithHttpInfo (ModelClient modelClient);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
@@ -54,9 +54,9 @@ namespace IO.Swagger.Api
/// To test special tags
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ModelClient</returns>
System.Threading.Tasks.Task<ModelClient> TestSpecialTagsAsync (ModelClient body);
System.Threading.Tasks.Task<ModelClient> TestSpecialTagsAsync (ModelClient modelClient);
/// <summary>
/// To test special tags
@@ -65,9 +65,9 @@ namespace IO.Swagger.Api
/// To test special tags
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestSpecialTagsAsyncWithHttpInfo (ModelClient body);
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient);
#endregion Asynchronous Operations
}
@@ -172,11 +172,11 @@ namespace IO.Swagger.Api
/// To test special tags To test special tags
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ModelClient</returns>
public ModelClient TestSpecialTags (ModelClient body)
public ModelClient TestSpecialTags (ModelClient modelClient)
{
ApiResponse<ModelClient> localVarResponse = TestSpecialTagsWithHttpInfo(body);
ApiResponse<ModelClient> localVarResponse = TestSpecialTagsWithHttpInfo(modelClient);
return localVarResponse.Data;
}
@@ -184,13 +184,13 @@ namespace IO.Swagger.Api
/// To test special tags To test special tags
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient body)
public ApiResponse< ModelClient > TestSpecialTagsWithHttpInfo (ModelClient modelClient)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags");
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags");
var localVarPath = "/another-fake/dummy";
var localVarPathParams = new Dictionary<String, String>();
@@ -214,13 +214,13 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (modelClient != null && modelClient.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = modelClient; // byte array
}
@@ -246,11 +246,11 @@ namespace IO.Swagger.Api
/// To test special tags To test special tags
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ModelClient</returns>
public async System.Threading.Tasks.Task<ModelClient> TestSpecialTagsAsync (ModelClient body)
public async System.Threading.Tasks.Task<ModelClient> TestSpecialTagsAsync (ModelClient modelClient)
{
ApiResponse<ModelClient> localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(body);
ApiResponse<ModelClient> localVarResponse = await TestSpecialTagsAsyncWithHttpInfo(modelClient);
return localVarResponse.Data;
}
@@ -259,13 +259,13 @@ namespace IO.Swagger.Api
/// To test special tags To test special tags
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
public async System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestSpecialTagsAsyncWithHttpInfo (ModelClient body)
public async System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestSpecialTagsAsyncWithHttpInfo (ModelClient modelClient)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling AnotherFakeApi->TestSpecialTags");
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new ApiException(400, "Missing required parameter 'modelClient' when calling AnotherFakeApi->TestSpecialTags");
var localVarPath = "/another-fake/dummy";
var localVarPathParams = new Dictionary<String, String>();
@@ -289,13 +289,13 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (modelClient != null && modelClient.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = modelClient; // byte array
}

View File

@@ -28,46 +28,46 @@ namespace IO.Swagger.Api
/// To test class name in snake case
/// </summary>
/// <remarks>
///
/// To test class name in snake case
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ModelClient</returns>
ModelClient TestClassname (ModelClient body);
ModelClient TestClassname (ModelClient modelClient);
/// <summary>
/// To test class name in snake case
/// </summary>
/// <remarks>
///
/// To test class name in snake case
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
ApiResponse<ModelClient> TestClassnameWithHttpInfo (ModelClient body);
ApiResponse<ModelClient> TestClassnameWithHttpInfo (ModelClient modelClient);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
/// To test class name in snake case
/// </summary>
/// <remarks>
///
/// To test class name in snake case
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ModelClient</returns>
System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient body);
System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient modelClient);
/// <summary>
/// To test class name in snake case
/// </summary>
/// <remarks>
///
/// To test class name in snake case
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient body);
System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient modelClient);
#endregion Asynchronous Operations
}
@@ -169,28 +169,28 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test class name in snake case
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ModelClient</returns>
public ModelClient TestClassname (ModelClient body)
public ModelClient TestClassname (ModelClient modelClient)
{
ApiResponse<ModelClient> localVarResponse = TestClassnameWithHttpInfo(body);
ApiResponse<ModelClient> localVarResponse = TestClassnameWithHttpInfo(modelClient);
return localVarResponse.Data;
}
/// <summary>
/// To test class name in snake case
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>ApiResponse of ModelClient</returns>
public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient body)
public ApiResponse< ModelClient > TestClassnameWithHttpInfo (ModelClient modelClient)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname");
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname");
var localVarPath = "/fake_classname_test";
var localVarPathParams = new Dictionary<String, String>();
@@ -214,13 +214,13 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (modelClient != null && modelClient.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = modelClient; // byte array
}
// authentication (api_key_query) required
@@ -248,29 +248,29 @@ namespace IO.Swagger.Api
}
/// <summary>
/// To test class name in snake case
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ModelClient</returns>
public async System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient body)
public async System.Threading.Tasks.Task<ModelClient> TestClassnameAsync (ModelClient modelClient)
{
ApiResponse<ModelClient> localVarResponse = await TestClassnameAsyncWithHttpInfo(body);
ApiResponse<ModelClient> localVarResponse = await TestClassnameAsyncWithHttpInfo(modelClient);
return localVarResponse.Data;
}
/// <summary>
/// To test class name in snake case
/// To test class name in snake case To test class name in snake case
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">client model</param>
/// <param name="modelClient">client model</param>
/// <returns>Task of ApiResponse (ModelClient)</returns>
public async System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient body)
public async System.Threading.Tasks.Task<ApiResponse<ModelClient>> TestClassnameAsyncWithHttpInfo (ModelClient modelClient)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling FakeClassnameTags123Api->TestClassname");
// verify the required parameter 'modelClient' is set
if (modelClient == null)
throw new ApiException(400, "Missing required parameter 'modelClient' when calling FakeClassnameTags123Api->TestClassname");
var localVarPath = "/fake_classname_test";
var localVarPathParams = new Dictionary<String, String>();
@@ -294,13 +294,13 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (modelClient != null && modelClient.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(modelClient); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = modelClient; // byte array
}
// authentication (api_key_query) required

View File

@@ -31,9 +31,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns>
void AddPet (Pet body);
void AddPet (Pet pet);
/// <summary>
/// Add a new pet to the store
@@ -42,9 +42,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> AddPetWithHttpInfo (Pet body);
ApiResponse<Object> AddPetWithHttpInfo (Pet pet);
/// <summary>
/// Deletes a pet
/// </summary>
@@ -138,9 +138,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns>
void UpdatePet (Pet body);
void UpdatePet (Pet pet);
/// <summary>
/// Update an existing pet
@@ -149,9 +149,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> UpdatePetWithHttpInfo (Pet body);
ApiResponse<Object> UpdatePetWithHttpInfo (Pet pet);
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
@@ -211,9 +211,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task AddPetAsync (Pet body);
System.Threading.Tasks.Task AddPetAsync (Pet pet);
/// <summary>
/// Add a new pet to the store
@@ -222,9 +222,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body);
System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet pet);
/// <summary>
/// Deletes a pet
/// </summary>
@@ -318,9 +318,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task UpdatePetAsync (Pet body);
System.Threading.Tasks.Task UpdatePetAsync (Pet pet);
/// <summary>
/// Update an existing pet
@@ -329,9 +329,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body);
System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet pet);
/// <summary>
/// Updates a pet in the store with form data
/// </summary>
@@ -486,24 +486,24 @@ namespace IO.Swagger.Api
/// Add a new pet to the store
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns>
public void AddPet (Pet body)
public void AddPet (Pet pet)
{
AddPetWithHttpInfo(body);
AddPetWithHttpInfo(pet);
}
/// <summary>
/// Add a new pet to the store
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> AddPetWithHttpInfo (Pet body)
public ApiResponse<Object> AddPetWithHttpInfo (Pet pet)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet");
// verify the required parameter 'pet' is set
if (pet == null)
throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet");
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
@@ -522,20 +522,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (pet != null && pet.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = pet; // byte array
}
// authentication (petstore_auth) required
@@ -567,11 +565,11 @@ namespace IO.Swagger.Api
/// Add a new pet to the store
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task AddPetAsync (Pet body)
public async System.Threading.Tasks.Task AddPetAsync (Pet pet)
{
await AddPetAsyncWithHttpInfo(body);
await AddPetAsyncWithHttpInfo(pet);
}
@@ -579,13 +577,13 @@ namespace IO.Swagger.Api
/// Add a new pet to the store
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet body)
public async System.Threading.Tasks.Task<ApiResponse<Object>> AddPetAsyncWithHttpInfo (Pet pet)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->AddPet");
// verify the required parameter 'pet' is set
if (pet == null)
throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->AddPet");
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
@@ -604,20 +602,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (pet != null && pet.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = pet; // byte array
}
// authentication (petstore_auth) required
@@ -685,8 +681,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -761,8 +755,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1239,24 +1231,24 @@ namespace IO.Swagger.Api
/// Update an existing pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns></returns>
public void UpdatePet (Pet body)
public void UpdatePet (Pet pet)
{
UpdatePetWithHttpInfo(body);
UpdatePetWithHttpInfo(pet);
}
/// <summary>
/// Update an existing pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UpdatePetWithHttpInfo (Pet body)
public ApiResponse<Object> UpdatePetWithHttpInfo (Pet pet)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet");
// verify the required parameter 'pet' is set
if (pet == null)
throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet");
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
@@ -1275,20 +1267,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (pet != null && pet.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = pet; // byte array
}
// authentication (petstore_auth) required
@@ -1320,11 +1310,11 @@ namespace IO.Swagger.Api
/// Update an existing pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task UpdatePetAsync (Pet body)
public async System.Threading.Tasks.Task UpdatePetAsync (Pet pet)
{
await UpdatePetAsyncWithHttpInfo(body);
await UpdatePetAsyncWithHttpInfo(pet);
}
@@ -1332,13 +1322,13 @@ namespace IO.Swagger.Api
/// Update an existing pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Pet object that needs to be added to the store</param>
/// <param name="pet">Pet object that needs to be added to the store</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet body)
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdatePetAsyncWithHttpInfo (Pet pet)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling PetApi->UpdatePet");
// verify the required parameter 'pet' is set
if (pet == null)
throw new ApiException(400, "Missing required parameter 'pet' when calling PetApi->UpdatePet");
var localVarPath = "/pet";
var localVarPathParams = new Dictionary<String, String>();
@@ -1357,20 +1347,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (pet != null && pet.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(pet); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = pet; // byte array
}
// authentication (petstore_auth) required
@@ -1441,8 +1429,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1521,8 +1507,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)

View File

@@ -92,9 +92,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>Order</returns>
Order PlaceOrder (Order body);
Order PlaceOrder (Order order);
/// <summary>
/// Place an order for a pet
@@ -103,9 +103,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
ApiResponse<Order> PlaceOrderWithHttpInfo (Order body);
ApiResponse<Order> PlaceOrderWithHttpInfo (Order order);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
@@ -176,9 +176,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>Task of Order</returns>
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body);
System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order order);
/// <summary>
/// Place an order for a pet
@@ -187,9 +187,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>Task of ApiResponse (Order)</returns>
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body);
System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order order);
#endregion Asynchronous Operations
}
@@ -328,8 +328,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -395,8 +393,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -693,11 +689,11 @@ namespace IO.Swagger.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>Order</returns>
public Order PlaceOrder (Order body)
public Order PlaceOrder (Order order)
{
ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(body);
ApiResponse<Order> localVarResponse = PlaceOrderWithHttpInfo(order);
return localVarResponse.Data;
}
@@ -705,13 +701,13 @@ namespace IO.Swagger.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>ApiResponse of Order</returns>
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order body)
public ApiResponse< Order > PlaceOrderWithHttpInfo (Order order)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
// verify the required parameter 'order' is set
if (order == null)
throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder");
var localVarPath = "/store/order";
var localVarPathParams = new Dictionary<String, String>();
@@ -735,13 +731,13 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (order != null && order.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = order; // byte array
}
@@ -767,11 +763,11 @@ namespace IO.Swagger.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>Task of Order</returns>
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order body)
public async System.Threading.Tasks.Task<Order> PlaceOrderAsync (Order order)
{
ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(body);
ApiResponse<Order> localVarResponse = await PlaceOrderAsyncWithHttpInfo(order);
return localVarResponse.Data;
}
@@ -780,13 +776,13 @@ namespace IO.Swagger.Api
/// Place an order for a pet
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">order placed for purchasing the pet</param>
/// <param name="order">order placed for purchasing the pet</param>
/// <returns>Task of ApiResponse (Order)</returns>
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order body)
public async System.Threading.Tasks.Task<ApiResponse<Order>> PlaceOrderAsyncWithHttpInfo (Order order)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling StoreApi->PlaceOrder");
// verify the required parameter 'order' is set
if (order == null)
throw new ApiException(400, "Missing required parameter 'order' when calling StoreApi->PlaceOrder");
var localVarPath = "/store/order";
var localVarPathParams = new Dictionary<String, String>();
@@ -810,13 +806,13 @@ namespace IO.Swagger.Api
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (order != null && order.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(order); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = order; // byte array
}

View File

@@ -31,9 +31,9 @@ namespace IO.Swagger.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns></returns>
void CreateUser (User body);
void CreateUser (User user);
/// <summary>
/// Create user
@@ -42,9 +42,9 @@ namespace IO.Swagger.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUserWithHttpInfo (User body);
ApiResponse<Object> CreateUserWithHttpInfo (User user);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -52,9 +52,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns></returns>
void CreateUsersWithArrayInput (List<User> body);
void CreateUsersWithArrayInput (List<User> user);
/// <summary>
/// Creates list of users with given input array
@@ -63,9 +63,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body);
ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> user);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -73,9 +73,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns></returns>
void CreateUsersWithListInput (List<User> body);
void CreateUsersWithListInput (List<User> user);
/// <summary>
/// Creates list of users with given input array
@@ -84,9 +84,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body);
ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> user);
/// <summary>
/// Delete user
/// </summary>
@@ -115,7 +115,7 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>User</returns>
User GetUserByName (string username);
@@ -126,7 +126,7 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>ApiResponse of User</returns>
ApiResponse<User> GetUserByNameWithHttpInfo (string username);
/// <summary>
@@ -179,9 +179,9 @@ namespace IO.Swagger.Api
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns></returns>
void UpdateUser (string username, User body);
void UpdateUser (string username, User user);
/// <summary>
/// Updated user
@@ -191,9 +191,9 @@ namespace IO.Swagger.Api
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns>ApiResponse of Object(void)</returns>
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body);
ApiResponse<Object> UpdateUserWithHttpInfo (string username, User user);
#endregion Synchronous Operations
#region Asynchronous Operations
/// <summary>
@@ -203,9 +203,9 @@ namespace IO.Swagger.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUserAsync (User body);
System.Threading.Tasks.Task CreateUserAsync (User user);
/// <summary>
/// Create user
@@ -214,9 +214,9 @@ namespace IO.Swagger.Api
/// This can only be done by the logged in user.
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User user);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -224,9 +224,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body);
System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> user);
/// <summary>
/// Creates list of users with given input array
@@ -235,9 +235,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> user);
/// <summary>
/// Creates list of users with given input array
/// </summary>
@@ -245,9 +245,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body);
System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> user);
/// <summary>
/// Creates list of users with given input array
@@ -256,9 +256,9 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body);
System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> user);
/// <summary>
/// Delete user
/// </summary>
@@ -287,7 +287,7 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>Task of User</returns>
System.Threading.Tasks.Task<User> GetUserByNameAsync (string username);
@@ -298,7 +298,7 @@ namespace IO.Swagger.Api
///
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>Task of ApiResponse (User)</returns>
System.Threading.Tasks.Task<ApiResponse<User>> GetUserByNameAsyncWithHttpInfo (string username);
/// <summary>
@@ -351,9 +351,9 @@ namespace IO.Swagger.Api
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns>Task of void</returns>
System.Threading.Tasks.Task UpdateUserAsync (string username, User body);
System.Threading.Tasks.Task UpdateUserAsync (string username, User user);
/// <summary>
/// Updated user
@@ -363,9 +363,9 @@ namespace IO.Swagger.Api
/// </remarks>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns>Task of ApiResponse</returns>
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body);
System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User user);
#endregion Asynchronous Operations
}
@@ -470,24 +470,24 @@ namespace IO.Swagger.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns></returns>
public void CreateUser (User body)
public void CreateUser (User user)
{
CreateUserWithHttpInfo(body);
CreateUserWithHttpInfo(user);
}
/// <summary>
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUserWithHttpInfo (User body)
public ApiResponse<Object> CreateUserWithHttpInfo (User user)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser");
var localVarPath = "/user";
var localVarPathParams = new Dictionary<String, String>();
@@ -504,20 +504,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -543,11 +541,11 @@ namespace IO.Swagger.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUserAsync (User body)
public async System.Threading.Tasks.Task CreateUserAsync (User user)
{
await CreateUserAsyncWithHttpInfo(body);
await CreateUserAsyncWithHttpInfo(user);
}
@@ -555,13 +553,13 @@ namespace IO.Swagger.Api
/// Create user This can only be done by the logged in user.
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">Created user object</param>
/// <param name="user">Created user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User body)
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUserAsyncWithHttpInfo (User user)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUser");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUser");
var localVarPath = "/user";
var localVarPathParams = new Dictionary<String, String>();
@@ -578,20 +576,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -617,24 +613,24 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns></returns>
public void CreateUsersWithArrayInput (List<User> body)
public void CreateUsersWithArrayInput (List<User> user)
{
CreateUsersWithArrayInputWithHttpInfo(body);
CreateUsersWithArrayInputWithHttpInfo(user);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> body)
public ApiResponse<Object> CreateUsersWithArrayInputWithHttpInfo (List<User> user)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput");
var localVarPath = "/user/createWithArray";
var localVarPathParams = new Dictionary<String, String>();
@@ -651,20 +647,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -690,11 +684,11 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> body)
public async System.Threading.Tasks.Task CreateUsersWithArrayInputAsync (List<User> user)
{
await CreateUsersWithArrayInputAsyncWithHttpInfo(body);
await CreateUsersWithArrayInputAsyncWithHttpInfo(user);
}
@@ -702,13 +696,13 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> body)
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithArrayInputAsyncWithHttpInfo (List<User> user)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithArrayInput");
var localVarPath = "/user/createWithArray";
var localVarPathParams = new Dictionary<String, String>();
@@ -725,20 +719,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -764,24 +756,24 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns></returns>
public void CreateUsersWithListInput (List<User> body)
public void CreateUsersWithListInput (List<User> user)
{
CreateUsersWithListInputWithHttpInfo(body);
CreateUsersWithListInputWithHttpInfo(user);
}
/// <summary>
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> body)
public ApiResponse<Object> CreateUsersWithListInputWithHttpInfo (List<User> user)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput");
var localVarPath = "/user/createWithList";
var localVarPathParams = new Dictionary<String, String>();
@@ -798,20 +790,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -837,11 +827,11 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> body)
public async System.Threading.Tasks.Task CreateUsersWithListInputAsync (List<User> user)
{
await CreateUsersWithListInputAsyncWithHttpInfo(body);
await CreateUsersWithListInputAsyncWithHttpInfo(user);
}
@@ -849,13 +839,13 @@ namespace IO.Swagger.Api
/// Creates list of users with given input array
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="body">List of user object</param>
/// <param name="user">List of user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> body)
public async System.Threading.Tasks.Task<ApiResponse<Object>> CreateUsersWithListInputAsyncWithHttpInfo (List<User> user)
{
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->CreateUsersWithListInput");
var localVarPath = "/user/createWithList";
var localVarPathParams = new Dictionary<String, String>();
@@ -872,20 +862,18 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -945,8 +933,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1012,8 +998,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1044,7 +1028,7 @@ namespace IO.Swagger.Api
/// Get user by user name
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>User</returns>
public User GetUserByName (string username)
{
@@ -1056,7 +1040,7 @@ namespace IO.Swagger.Api
/// Get user by user name
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>ApiResponse of User</returns>
public ApiResponse< User > GetUserByNameWithHttpInfo (string username)
{
@@ -1111,7 +1095,7 @@ namespace IO.Swagger.Api
/// Get user by user name
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>Task of User</returns>
public async System.Threading.Tasks.Task<User> GetUserByNameAsync (string username)
{
@@ -1124,7 +1108,7 @@ namespace IO.Swagger.Api
/// Get user by user name
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">The name that needs to be fetched. Use user1 for testing. </param>
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
/// <returns>Task of ApiResponse (User)</returns>
public async System.Threading.Tasks.Task<ApiResponse<User>> GetUserByNameAsyncWithHttpInfo (string username)
{
@@ -1355,8 +1339,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1416,8 +1398,6 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
@@ -1448,11 +1428,11 @@ namespace IO.Swagger.Api
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns></returns>
public void UpdateUser (string username, User body)
public void UpdateUser (string username, User user)
{
UpdateUserWithHttpInfo(username, body);
UpdateUserWithHttpInfo(username, user);
}
/// <summary>
@@ -1460,16 +1440,16 @@ namespace IO.Swagger.Api
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns>ApiResponse of Object(void)</returns>
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User body)
public ApiResponse<Object> UpdateUserWithHttpInfo (string username, User user)
{
// verify the required parameter 'username' is set
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
@@ -1486,21 +1466,19 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}
@@ -1527,11 +1505,11 @@ namespace IO.Swagger.Api
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns>Task of void</returns>
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User body)
public async System.Threading.Tasks.Task UpdateUserAsync (string username, User user)
{
await UpdateUserAsyncWithHttpInfo(username, body);
await UpdateUserAsyncWithHttpInfo(username, user);
}
@@ -1540,16 +1518,16 @@ namespace IO.Swagger.Api
/// </summary>
/// <exception cref="IO.Swagger.Client.ApiException">Thrown when fails to make API call</exception>
/// <param name="username">name that need to be deleted</param>
/// <param name="body">Updated user object</param>
/// <param name="user">Updated user object</param>
/// <returns>Task of ApiResponse</returns>
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User body)
public async System.Threading.Tasks.Task<ApiResponse<Object>> UpdateUserAsyncWithHttpInfo (string username, User user)
{
// verify the required parameter 'username' is set
if (username == null)
throw new ApiException(400, "Missing required parameter 'username' when calling UserApi->UpdateUser");
// verify the required parameter 'body' is set
if (body == null)
throw new ApiException(400, "Missing required parameter 'body' when calling UserApi->UpdateUser");
// verify the required parameter 'user' is set
if (user == null)
throw new ApiException(400, "Missing required parameter 'user' when calling UserApi->UpdateUser");
var localVarPath = "/user/{username}";
var localVarPathParams = new Dictionary<String, String>();
@@ -1566,21 +1544,19 @@ namespace IO.Swagger.Api
// to determine the Accept header
String[] localVarHttpHeaderAccepts = new String[] {
"application/xml",
"application/json"
};
String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);
if (localVarHttpHeaderAccept != null)
localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
if (username != null) localVarPathParams.Add("username", this.Configuration.ApiClient.ParameterToString(username)); // path parameter
if (body != null && body.GetType() != typeof(byte[]))
if (user != null && user.GetType() != typeof(byte[]))
{
localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
localVarPostBody = this.Configuration.ApiClient.Serialize(user); // http body (model) parameter
}
else
{
localVarPostBody = body; // byte array
localVarPostBody = user; // byte array
}

View File

@@ -25,7 +25,7 @@ namespace IO.Swagger.Client
/// </summary>
/// <remarks>
/// A customized implementation via partial class may reside in another file and may
/// be excluded from automatic generation via a .swagger-codegen-ignore file.
/// be excluded from automatic generation via a .openapi-generator-ignore file.
/// </remarks>
public partial class GlobalConfiguration : Configuration
{

View File

@@ -39,7 +39,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="Cat" /> class.
/// </summary>
/// <param name="declawed">declawed.</param>
public Cat(bool? declawed = default(bool?), string className = "Cat", string color = "red") : base(className, color)
public Cat(bool? declawed = default(bool?), string className = default(string), string color = "red") : base(className, color)
{
this.Declawed = declawed;
}

View File

@@ -39,7 +39,7 @@ namespace IO.Swagger.Model
/// Initializes a new instance of the <see cref="Dog" /> class.
/// </summary>
/// <param name="breed">breed.</param>
public Dog(string breed = default(string), string className = "Dog", string color = "red") : base(className, color)
public Dog(string breed = default(string), string className = default(string), string color = "red") : base(className, color)
{
this.Breed = breed;
}

View File

@@ -62,6 +62,37 @@ namespace IO.Swagger.Model
[DataMember(Name="enum_string", EmitDefaultValue=false)]
public EnumStringEnum? EnumString { get; set; }
/// <summary>
/// Defines EnumStringRequired
/// </summary>
[JsonConverter(typeof(StringEnumConverter))]
public enum EnumStringRequiredEnum
{
/// <summary>
/// Enum UPPER for value: UPPER
/// </summary>
[EnumMember(Value = "UPPER")]
UPPER = 1,
/// <summary>
/// Enum Lower for value: lower
/// </summary>
[EnumMember(Value = "lower")]
Lower = 2,
/// <summary>
/// Enum Empty for value:
/// </summary>
[EnumMember(Value = "")]
Empty = 3
}
/// <summary>
/// Gets or Sets EnumStringRequired
/// </summary>
[DataMember(Name="enum_string_required", EmitDefaultValue=false)]
public EnumStringRequiredEnum EnumStringRequired { get; set; }
/// <summary>
/// Defines EnumInteger
/// </summary>
public enum EnumIntegerEnum
@@ -118,12 +149,27 @@ namespace IO.Swagger.Model
/// <summary>
/// Initializes a new instance of the <see cref="EnumTest" /> class.
/// </summary>
[JsonConstructorAttribute]
protected EnumTest() { }
/// <summary>
/// Initializes a new instance of the <see cref="EnumTest" /> class.
/// </summary>
/// <param name="enumString">enumString.</param>
/// <param name="enumStringRequired">enumStringRequired (required).</param>
/// <param name="enumInteger">enumInteger.</param>
/// <param name="enumNumber">enumNumber.</param>
/// <param name="outerEnum">outerEnum.</param>
public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?))
public EnumTest(EnumStringEnum? enumString = default(EnumStringEnum?), EnumStringRequiredEnum enumStringRequired = default(EnumStringRequiredEnum), EnumIntegerEnum? enumInteger = default(EnumIntegerEnum?), EnumNumberEnum? enumNumber = default(EnumNumberEnum?), OuterEnum? outerEnum = default(OuterEnum?))
{
// to ensure "enumStringRequired" is required (not null)
if (enumStringRequired == null)
{
throw new InvalidDataException("enumStringRequired is a required property for EnumTest and cannot be null");
}
else
{
this.EnumStringRequired = enumStringRequired;
}
this.EnumString = enumString;
this.EnumInteger = enumInteger;
this.EnumNumber = enumNumber;
@@ -134,6 +180,7 @@ namespace IO.Swagger.Model
/// <summary>
/// Returns the string presentation of the object
/// </summary>
@@ -143,6 +190,7 @@ namespace IO.Swagger.Model
var sb = new StringBuilder();
sb.Append("class EnumTest {\n");
sb.Append(" EnumString: ").Append(EnumString).Append("\n");
sb.Append(" EnumStringRequired: ").Append(EnumStringRequired).Append("\n");
sb.Append(" EnumInteger: ").Append(EnumInteger).Append("\n");
sb.Append(" EnumNumber: ").Append(EnumNumber).Append("\n");
sb.Append(" OuterEnum: ").Append(OuterEnum).Append("\n");
@@ -185,6 +233,11 @@ namespace IO.Swagger.Model
(this.EnumString != null &&
this.EnumString.Equals(input.EnumString))
) &&
(
this.EnumStringRequired == input.EnumStringRequired ||
(this.EnumStringRequired != null &&
this.EnumStringRequired.Equals(input.EnumStringRequired))
) &&
(
this.EnumInteger == input.EnumInteger ||
(this.EnumInteger != null &&
@@ -213,6 +266,8 @@ namespace IO.Swagger.Model
int hashCode = 41;
if (this.EnumString != null)
hashCode = hashCode * 59 + this.EnumString.GetHashCode();
if (this.EnumStringRequired != null)
hashCode = hashCode * 59 + this.EnumStringRequired.GetHashCode();
if (this.EnumInteger != null)
hashCode = hashCode * 59 + this.EnumInteger.GetHashCode();
if (this.EnumNumber != null)

View File

@@ -51,7 +51,7 @@ namespace IO.Swagger.Model
/// <param name="dateTime">dateTime.</param>
/// <param name="uuid">uuid.</param>
/// <param name="password">password (required).</param>
public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), byte[] binary = default(byte[]), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string))
public FormatTest(int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), decimal? number = default(decimal?), float? _float = default(float?), double? _double = default(double?), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), Guid? uuid = default(Guid?), string password = default(string))
{
// to ensure "number" is required (not null)
if (number == null)
@@ -152,7 +152,7 @@ namespace IO.Swagger.Model
/// Gets or Sets Binary
/// </summary>
[DataMember(Name="binary", EmitDefaultValue=false)]
public byte[] Binary { get; set; }
public System.IO.Stream Binary { get; set; }
/// <summary>
/// Gets or Sets Date

View File

@@ -33,10 +33,10 @@ namespace IO.Swagger.Model
/// <summary>
/// Initializes a new instance of the <see cref="List" /> class.
/// </summary>
/// <param name="_123List">_123List.</param>
public List(string _123List = default(string))
/// <param name="_123list">_123list.</param>
public List(string _123list = default(string))
{
this._123List = _123List;
this._123List = _123list;
}
/// <summary>

View File

@@ -36,7 +36,7 @@ namespace IO.Swagger.Model
/// <param name="myNumber">myNumber.</param>
/// <param name="myString">myString.</param>
/// <param name="myBoolean">myBoolean.</param>
public OuterComposite(OuterNumber myNumber = default(OuterNumber), OuterString myString = default(OuterString), OuterBoolean myBoolean = default(OuterBoolean))
public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?))
{
this.MyNumber = myNumber;
this.MyString = myString;
@@ -47,19 +47,19 @@ namespace IO.Swagger.Model
/// Gets or Sets MyNumber
/// </summary>
[DataMember(Name="my_number", EmitDefaultValue=false)]
public OuterNumber MyNumber { get; set; }
public decimal? MyNumber { get; set; }
/// <summary>
/// Gets or Sets MyString
/// </summary>
[DataMember(Name="my_string", EmitDefaultValue=false)]
public OuterString MyString { get; set; }
public string MyString { get; set; }
/// <summary>
/// Gets or Sets MyBoolean
/// </summary>
[DataMember(Name="my_boolean", EmitDefaultValue=false)]
public OuterBoolean MyBoolean { get; set; }
public bool? MyBoolean { get; set; }
/// <summary>
/// Returns the string presentation of the object