forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 7.0.x
This commit is contained in:
@@ -63,6 +63,7 @@ docs/NullableGuidClass.md
|
||||
docs/NullableShape.md
|
||||
docs/NumberOnly.md
|
||||
docs/ObjectWithDeprecatedFields.md
|
||||
docs/OneOfString.md
|
||||
docs/Order.md
|
||||
docs/OuterComposite.md
|
||||
docs/OuterEnum.md
|
||||
@@ -180,6 +181,7 @@ src/Org.OpenAPITools/Model/NullableGuidClass.cs
|
||||
src/Org.OpenAPITools/Model/NullableShape.cs
|
||||
src/Org.OpenAPITools/Model/NumberOnly.cs
|
||||
src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs
|
||||
src/Org.OpenAPITools/Model/OneOfString.cs
|
||||
src/Org.OpenAPITools/Model/Order.cs
|
||||
src/Org.OpenAPITools/Model/OuterComposite.cs
|
||||
src/Org.OpenAPITools/Model/OuterEnum.cs
|
||||
|
||||
@@ -8,13 +8,13 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
|
||||
- SDK version: 1.0.0
|
||||
- Build package: org.openapitools.codegen.languages.CSharpNetCoreClientCodegen
|
||||
|
||||
<a name="frameworks-supported"></a>
|
||||
<a id="frameworks-supported"></a>
|
||||
## Frameworks supported
|
||||
- .NET Core >=1.0
|
||||
- .NET Framework >=4.6
|
||||
- Mono/Xamarin >=vNext
|
||||
|
||||
<a name="dependencies"></a>
|
||||
<a id="dependencies"></a>
|
||||
## Dependencies
|
||||
|
||||
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.13.0 or later
|
||||
@@ -35,7 +35,7 @@ Install-Package CompareNETObjects
|
||||
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See [RestSharp#742](https://github.com/restsharp/RestSharp/issues/742).
|
||||
NOTE: RestSharp for .Net Core creates a new socket for each api call, which can lead to a socket exhaustion problem. See [RestSharp#1406](https://github.com/restsharp/RestSharp/issues/1406).
|
||||
|
||||
<a name="installation"></a>
|
||||
<a id="installation"></a>
|
||||
## Installation
|
||||
Generate the DLL using your preferred tool (e.g. `dotnet build`)
|
||||
|
||||
@@ -45,7 +45,7 @@ using Org.OpenAPITools.Api;
|
||||
using Org.OpenAPITools.Client;
|
||||
using Org.OpenAPITools.Model;
|
||||
```
|
||||
<a name="usage"></a>
|
||||
<a id="usage"></a>
|
||||
## Usage
|
||||
|
||||
To use the API client with a HTTP proxy, setup a `System.Net.WebProxy`
|
||||
@@ -56,7 +56,7 @@ webProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
|
||||
c.Proxy = webProxy;
|
||||
```
|
||||
|
||||
<a name="getting-started"></a>
|
||||
<a id="getting-started"></a>
|
||||
## Getting Started
|
||||
|
||||
```csharp
|
||||
@@ -96,7 +96,7 @@ namespace Example
|
||||
}
|
||||
```
|
||||
|
||||
<a name="documentation-for-api-endpoints"></a>
|
||||
<a id="documentation-for-api-endpoints"></a>
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
@@ -146,7 +146,7 @@ Class | Method | HTTP request | Description
|
||||
*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
<a name="documentation-for-models"></a>
|
||||
<a id="documentation-for-models"></a>
|
||||
## Documentation for Models
|
||||
|
||||
- [Model.Activity](docs/Activity.md)
|
||||
@@ -205,6 +205,7 @@ Class | Method | HTTP request | Description
|
||||
- [Model.NullableShape](docs/NullableShape.md)
|
||||
- [Model.NumberOnly](docs/NumberOnly.md)
|
||||
- [Model.ObjectWithDeprecatedFields](docs/ObjectWithDeprecatedFields.md)
|
||||
- [Model.OneOfString](docs/OneOfString.md)
|
||||
- [Model.Order](docs/Order.md)
|
||||
- [Model.OuterComposite](docs/OuterComposite.md)
|
||||
- [Model.OuterEnum](docs/OuterEnum.md)
|
||||
@@ -235,10 +236,12 @@ Class | Method | HTTP request | Description
|
||||
- [Model.Zebra](docs/Zebra.md)
|
||||
|
||||
|
||||
<a name="documentation-for-authorization"></a>
|
||||
<a id="documentation-for-authorization"></a>
|
||||
## Documentation for Authorization
|
||||
|
||||
<a name="petstore_auth"></a>
|
||||
|
||||
Authentication schemes defined for the API:
|
||||
<a id="petstore_auth"></a>
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
@@ -248,31 +251,31 @@ Class | Method | HTTP request | Description
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
||||
<a name="api_key"></a>
|
||||
<a id="api_key"></a>
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
<a name="api_key_query"></a>
|
||||
<a id="api_key_query"></a>
|
||||
### api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
<a name="http_basic_test"></a>
|
||||
<a id="http_basic_test"></a>
|
||||
### http_basic_test
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
<a name="bearer_test"></a>
|
||||
<a id="bearer_test"></a>
|
||||
### bearer_test
|
||||
|
||||
- **Type**: Bearer Authentication
|
||||
|
||||
<a name="http_signature_test"></a>
|
||||
<a id="http_signature_test"></a>
|
||||
### http_signature_test
|
||||
|
||||
|
||||
|
||||
@@ -1497,6 +1497,11 @@ components:
|
||||
to three digits following i.e. Image_01.
|
||||
pattern: "/^image_\\d{1,3}$/i"
|
||||
type: string
|
||||
pattern_with_backslash:
|
||||
description: None
|
||||
pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\
|
||||
/([0-9]|[1-2][0-9]|3[0-2]))$"
|
||||
type: string
|
||||
required:
|
||||
- byte
|
||||
- date
|
||||
@@ -2195,6 +2200,12 @@ components:
|
||||
default: C:\Users\username
|
||||
type: string
|
||||
type: object
|
||||
OneOfString:
|
||||
oneOf:
|
||||
- pattern: ^a
|
||||
type: string
|
||||
- pattern: ^b
|
||||
type: string
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
||||
@@ -6,7 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|--------|--------------|-------------|
|
||||
| [**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags |
|
||||
|
||||
<a name="call123testspecialtags"></a>
|
||||
<a id="call123testspecialtags"></a>
|
||||
# **Call123TestSpecialTags**
|
||||
> ModelClient Call123TestSpecialTags (ModelClient modelClient)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello |
|
||||
|
||||
<a name="fooget"></a>
|
||||
<a id="fooget"></a>
|
||||
# **FooGet**
|
||||
> FooGetDefaultResponse FooGet ()
|
||||
|
||||
@@ -90,7 +90,7 @@ No authorization required
|
||||
|
||||
[[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="getcountry"></a>
|
||||
<a id="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
@@ -173,7 +173,7 @@ No authorization required
|
||||
|
||||
[[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="hello"></a>
|
||||
<a id="hello"></a>
|
||||
# **Hello**
|
||||
> List<Guid> Hello ()
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | |
|
||||
|
||||
<a name="fakehealthget"></a>
|
||||
<a id="fakehealthget"></a>
|
||||
# **FakeHealthGet**
|
||||
> HealthCheckResult FakeHealthGet ()
|
||||
|
||||
@@ -104,7 +104,7 @@ No authorization required
|
||||
|
||||
[[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="fakeouterbooleanserialize"></a>
|
||||
<a id="fakeouterbooleanserialize"></a>
|
||||
# **FakeOuterBooleanSerialize**
|
||||
> bool FakeOuterBooleanSerialize (bool? body = null)
|
||||
|
||||
@@ -193,7 +193,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="fakeoutercompositeserialize"></a>
|
||||
# **FakeOuterCompositeSerialize**
|
||||
> OuterComposite FakeOuterCompositeSerialize (OuterComposite outerComposite = null)
|
||||
|
||||
@@ -282,7 +282,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="fakeouternumberserialize"></a>
|
||||
# **FakeOuterNumberSerialize**
|
||||
> decimal FakeOuterNumberSerialize (decimal? body = null)
|
||||
|
||||
@@ -371,7 +371,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="fakeouterstringserialize"></a>
|
||||
# **FakeOuterStringSerialize**
|
||||
> string FakeOuterStringSerialize (Guid requiredStringUuid, string body = null)
|
||||
|
||||
@@ -462,7 +462,7 @@ No authorization required
|
||||
|
||||
[[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="getarrayofenums"></a>
|
||||
<a id="getarrayofenums"></a>
|
||||
# **GetArrayOfEnums**
|
||||
> List<OuterEnum> GetArrayOfEnums ()
|
||||
|
||||
@@ -546,7 +546,7 @@ No authorization required
|
||||
|
||||
[[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="testbodywithfileschema"></a>
|
||||
<a id="testbodywithfileschema"></a>
|
||||
# **TestBodyWithFileSchema**
|
||||
> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)
|
||||
|
||||
@@ -631,7 +631,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="testbodywithqueryparams"></a>
|
||||
# **TestBodyWithQueryParams**
|
||||
> void TestBodyWithQueryParams (string query, User user)
|
||||
|
||||
@@ -716,7 +716,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="testclientmodel"></a>
|
||||
# **TestClientModel**
|
||||
> ModelClient TestClientModel (ModelClient modelClient)
|
||||
|
||||
@@ -807,7 +807,7 @@ No authorization required
|
||||
|
||||
[[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="testendpointparameters"></a>
|
||||
<a id="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, System.IO.Stream binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null, string callback = null)
|
||||
|
||||
@@ -925,7 +925,7 @@ void (empty response body)
|
||||
|
||||
[[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>
|
||||
<a id="testenumparameters"></a>
|
||||
# **TestEnumParameters**
|
||||
> 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)
|
||||
|
||||
@@ -1027,7 +1027,7 @@ No authorization required
|
||||
|
||||
[[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="testgroupparameters"></a>
|
||||
<a id="testgroupparameters"></a>
|
||||
# **TestGroupParameters**
|
||||
> void TestGroupParameters (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = null, bool? booleanGroup = null, long? int64Group = null)
|
||||
|
||||
@@ -1127,7 +1127,7 @@ void (empty response body)
|
||||
|
||||
[[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>
|
||||
<a id="testinlineadditionalproperties"></a>
|
||||
# **TestInlineAdditionalProperties**
|
||||
> void TestInlineAdditionalProperties (Dictionary<string, string> requestBody)
|
||||
|
||||
@@ -1212,7 +1212,7 @@ No authorization required
|
||||
|
||||
[[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="testjsonformdata"></a>
|
||||
<a id="testjsonformdata"></a>
|
||||
# **TestJsonFormData**
|
||||
> void TestJsonFormData (string param, string param2)
|
||||
|
||||
@@ -1299,7 +1299,7 @@ No authorization required
|
||||
|
||||
[[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="testqueryparametercollectionformat"></a>
|
||||
<a id="testqueryparametercollectionformat"></a>
|
||||
# **TestQueryParameterCollectionFormat**
|
||||
> void TestQueryParameterCollectionFormat (List<string> pipe, List<string> ioutil, List<string> http, List<string> url, List<string> context)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|--------|--------------|-------------|
|
||||
| [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case |
|
||||
|
||||
<a name="testclassname"></a>
|
||||
<a id="testclassname"></a>
|
||||
# **TestClassname**
|
||||
> ModelClient TestClassname (ModelClient modelClient)
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ Name | Type | Description | Notes
|
||||
**Password** | **string** | |
|
||||
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
|
||||
**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
**PatternWithBackslash** | **string** | None | [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)
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Org.OpenAPITools.Model.OneOfString
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
@@ -14,7 +14,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image |
|
||||
| [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
|
||||
|
||||
<a name="addpet"></a>
|
||||
<a id="addpet"></a>
|
||||
# **AddPet**
|
||||
> void AddPet (Pet pet)
|
||||
|
||||
@@ -102,7 +102,7 @@ void (empty response body)
|
||||
|
||||
[[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="deletepet"></a>
|
||||
<a id="deletepet"></a>
|
||||
# **DeletePet**
|
||||
> void DeletePet (long petId, string apiKey = null)
|
||||
|
||||
@@ -192,7 +192,7 @@ void (empty response body)
|
||||
|
||||
[[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="findpetsbystatus"></a>
|
||||
<a id="findpetsbystatus"></a>
|
||||
# **FindPetsByStatus**
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
|
||||
@@ -287,7 +287,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="findpetsbytags"></a>
|
||||
<a id="findpetsbytags"></a>
|
||||
# **FindPetsByTags**
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
|
||||
@@ -382,7 +382,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="getpetbyid"></a>
|
||||
<a id="getpetbyid"></a>
|
||||
# **GetPetById**
|
||||
> Pet GetPetById (long petId)
|
||||
|
||||
@@ -480,7 +480,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="updatepet"></a>
|
||||
<a id="updatepet"></a>
|
||||
# **UpdatePet**
|
||||
> void UpdatePet (Pet pet)
|
||||
|
||||
@@ -570,7 +570,7 @@ void (empty response body)
|
||||
|
||||
[[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="updatepetwithform"></a>
|
||||
<a id="updatepetwithform"></a>
|
||||
# **UpdatePetWithForm**
|
||||
> void UpdatePetWithForm (long petId, string name = null, string status = null)
|
||||
|
||||
@@ -662,7 +662,7 @@ void (empty response body)
|
||||
|
||||
[[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="uploadfile"></a>
|
||||
<a id="uploadfile"></a>
|
||||
# **UploadFile**
|
||||
> ApiResponse UploadFile (long petId, string additionalMetadata = null, System.IO.Stream file = null)
|
||||
|
||||
@@ -758,7 +758,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="uploadfilewithrequiredfile"></a>
|
||||
<a id="uploadfilewithrequiredfile"></a>
|
||||
# **UploadFileWithRequiredFile**
|
||||
> ApiResponse UploadFileWithRequiredFile (long petId, System.IO.Stream requiredFile, string additionalMetadata = null)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID |
|
||||
| [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet |
|
||||
|
||||
<a name="deleteorder"></a>
|
||||
<a id="deleteorder"></a>
|
||||
# **DeleteOrder**
|
||||
> void DeleteOrder (string orderId)
|
||||
|
||||
@@ -97,7 +97,7 @@ No authorization required
|
||||
|
||||
[[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="getinventory"></a>
|
||||
<a id="getinventory"></a>
|
||||
# **GetInventory**
|
||||
> Dictionary<string, int> GetInventory ()
|
||||
|
||||
@@ -188,7 +188,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
[[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="getorderbyid"></a>
|
||||
<a id="getorderbyid"></a>
|
||||
# **GetOrderById**
|
||||
> Order GetOrderById (long orderId)
|
||||
|
||||
@@ -281,7 +281,7 @@ No authorization required
|
||||
|
||||
[[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="placeorder"></a>
|
||||
<a id="placeorder"></a>
|
||||
# **PlaceOrder**
|
||||
> Order PlaceOrder (Order order)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session |
|
||||
| [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user |
|
||||
|
||||
<a name="createuser"></a>
|
||||
<a id="createuser"></a>
|
||||
# **CreateUser**
|
||||
> void CreateUser (User user)
|
||||
|
||||
@@ -100,7 +100,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="createuserswitharrayinput"></a>
|
||||
# **CreateUsersWithArrayInput**
|
||||
> void CreateUsersWithArrayInput (List<User> user)
|
||||
|
||||
@@ -185,7 +185,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="createuserswithlistinput"></a>
|
||||
# **CreateUsersWithListInput**
|
||||
> void CreateUsersWithListInput (List<User> user)
|
||||
|
||||
@@ -270,7 +270,7 @@ No authorization required
|
||||
|
||||
[[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="deleteuser"></a>
|
||||
<a id="deleteuser"></a>
|
||||
# **DeleteUser**
|
||||
> void DeleteUser (string username)
|
||||
|
||||
@@ -358,7 +358,7 @@ No authorization required
|
||||
|
||||
[[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="getuserbyname"></a>
|
||||
<a id="getuserbyname"></a>
|
||||
# **GetUserByName**
|
||||
> User GetUserByName (string username)
|
||||
|
||||
@@ -449,7 +449,7 @@ No authorization required
|
||||
|
||||
[[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="loginuser"></a>
|
||||
<a id="loginuser"></a>
|
||||
# **LoginUser**
|
||||
> string LoginUser (string username, string password)
|
||||
|
||||
@@ -541,7 +541,7 @@ No authorization required
|
||||
|
||||
[[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="logoutuser"></a>
|
||||
<a id="logoutuser"></a>
|
||||
# **LogoutUser**
|
||||
> void LogoutUser ()
|
||||
|
||||
@@ -621,7 +621,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="updateuser"></a>
|
||||
# **UpdateUser**
|
||||
> void UpdateUser (string username, User user)
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* OpenAPI 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: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing OneOfString
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class OneOfStringTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for OneOfString
|
||||
//private OneOfString instance;
|
||||
|
||||
public OneOfStringTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of OneOfString
|
||||
//instance = new OneOfString();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of OneOfString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OneOfStringInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" OneOfString
|
||||
//Assert.IsType<OneOfString>(instance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
||||
@@ -183,14 +183,14 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
||||
@@ -61,7 +61,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="password">password (required).</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01..</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), 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), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
/// <param name="patternWithBackslash">None.</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), uint unsignedInteger = default(uint), long int64 = default(long), ulong unsignedLong = default(ulong), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), 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), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string), string patternWithBackslash = default(string))
|
||||
{
|
||||
this._Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
@@ -147,6 +148,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
this._flagPatternWithDigitsAndDelimiter = true;
|
||||
}
|
||||
this._PatternWithBackslash = patternWithBackslash;
|
||||
if (this.PatternWithBackslash != null)
|
||||
{
|
||||
this._flagPatternWithBackslash = true;
|
||||
}
|
||||
this.AdditionalProperties = new Dictionary<string, object>();
|
||||
}
|
||||
|
||||
@@ -589,6 +595,31 @@ namespace Org.OpenAPITools.Model
|
||||
return _flagPatternWithDigitsAndDelimiter;
|
||||
}
|
||||
/// <summary>
|
||||
/// None
|
||||
/// </summary>
|
||||
/// <value>None</value>
|
||||
[DataMember(Name = "pattern_with_backslash", EmitDefaultValue = false)]
|
||||
public string PatternWithBackslash
|
||||
{
|
||||
get{ return _PatternWithBackslash;}
|
||||
set
|
||||
{
|
||||
_PatternWithBackslash = value;
|
||||
_flagPatternWithBackslash = true;
|
||||
}
|
||||
}
|
||||
private string _PatternWithBackslash;
|
||||
private bool _flagPatternWithBackslash;
|
||||
|
||||
/// <summary>
|
||||
/// Returns false as PatternWithBackslash should not be serialized given that it's read-only.
|
||||
/// </summary>
|
||||
/// <returns>false (boolean)</returns>
|
||||
public bool ShouldSerializePatternWithBackslash()
|
||||
{
|
||||
return _flagPatternWithBackslash;
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets or Sets additional properties
|
||||
/// </summary>
|
||||
[JsonExtensionData]
|
||||
@@ -620,6 +651,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
|
||||
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
|
||||
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
|
||||
sb.Append(" AdditionalProperties: ").Append(AdditionalProperties).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
@@ -708,6 +740,10 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.PatternWithDigitsAndDelimiter.GetHashCode();
|
||||
}
|
||||
if (this.PatternWithBackslash != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.PatternWithBackslash.GetHashCode();
|
||||
}
|
||||
if (this.AdditionalProperties != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.AdditionalProperties.GetHashCode();
|
||||
@@ -796,7 +832,7 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// String (string) pattern
|
||||
Regex regexString = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexString = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexString.Match(this.String).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for String, must match a pattern of " + regexString, new [] { "String" });
|
||||
@@ -815,19 +851,26 @@ namespace Org.OpenAPITools.Model
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
}
|
||||
|
||||
// PatternWithBackslash (string) pattern
|
||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
/*
|
||||
* OpenAPI 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: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Converters;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using OpenAPIDateConverter = Org.OpenAPITools.Client.OpenAPIDateConverter;
|
||||
using OpenAPIClientUtils = Org.OpenAPITools.Client.ClientUtils;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// OneOfString
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(OneOfStringJsonConverter))]
|
||||
[DataContract(Name = "OneOfString")]
|
||||
public partial class OneOfString : AbstractOpenAPISchema, IEquatable<OneOfString>, IValidatableObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="OneOfString" /> class
|
||||
/// with the <see cref="string" /> class
|
||||
/// </summary>
|
||||
/// <param name="actualInstance">An instance of string.</param>
|
||||
public OneOfString(string actualInstance)
|
||||
{
|
||||
this.IsNullable = false;
|
||||
this.SchemaType= "oneOf";
|
||||
this.ActualInstance = actualInstance ?? throw new ArgumentException("Invalid instance found. Must not be null.");
|
||||
}
|
||||
|
||||
|
||||
private Object _actualInstance;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ActualInstance
|
||||
/// </summary>
|
||||
public override Object ActualInstance
|
||||
{
|
||||
get
|
||||
{
|
||||
return _actualInstance;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (value.GetType() == typeof(string))
|
||||
{
|
||||
this._actualInstance = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Invalid instance found. Must be the following types: string");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the actual instance of `string`. If the actual instance is not `string`,
|
||||
/// the InvalidClassException will be thrown
|
||||
/// </summary>
|
||||
/// <returns>An instance of string</returns>
|
||||
public string GetString()
|
||||
{
|
||||
return (string)this.ActualInstance;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("class OneOfString {\n");
|
||||
sb.Append(" ActualInstance: ").Append(this.ActualInstance).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public override string ToJson()
|
||||
{
|
||||
return JsonConvert.SerializeObject(this.ActualInstance, OneOfString.SerializerSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts the JSON string into an instance of OneOfString
|
||||
/// </summary>
|
||||
/// <param name="jsonString">JSON string</param>
|
||||
/// <returns>An instance of OneOfString</returns>
|
||||
public static OneOfString FromJson(string jsonString)
|
||||
{
|
||||
OneOfString newOneOfString = null;
|
||||
|
||||
if (string.IsNullOrEmpty(jsonString))
|
||||
{
|
||||
return newOneOfString;
|
||||
}
|
||||
int match = 0;
|
||||
List<string> matchedTypes = new List<string>();
|
||||
|
||||
try
|
||||
{
|
||||
// if it does not contains "AdditionalProperties", use SerializerSettings to deserialize
|
||||
if (typeof(string).GetProperty("AdditionalProperties") == null)
|
||||
{
|
||||
newOneOfString = new OneOfString(JsonConvert.DeserializeObject<string>(jsonString, OneOfString.SerializerSettings));
|
||||
}
|
||||
else
|
||||
{
|
||||
newOneOfString = new OneOfString(JsonConvert.DeserializeObject<string>(jsonString, OneOfString.AdditionalPropertiesSerializerSettings));
|
||||
}
|
||||
matchedTypes.Add("string");
|
||||
match++;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
// deserialization failed, try the next one
|
||||
System.Diagnostics.Debug.WriteLine(string.Format("Failed to deserialize `{0}` into string: {1}", jsonString, exception.ToString()));
|
||||
}
|
||||
|
||||
if (match == 0)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` cannot be deserialized into any schema defined.");
|
||||
}
|
||||
else if (match > 1)
|
||||
{
|
||||
throw new InvalidDataException("The JSON string `" + jsonString + "` incorrectly matches more than one schema (should be exactly one match): " + matchedTypes);
|
||||
}
|
||||
|
||||
// deserialization is considered successful at this point if no exception has been thrown.
|
||||
return newOneOfString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if objects are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Object to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public override bool Equals(object input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input as OneOfString).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true if OneOfString instances are equal
|
||||
/// </summary>
|
||||
/// <param name="input">Instance of OneOfString to be compared</param>
|
||||
/// <returns>Boolean</returns>
|
||||
public bool Equals(OneOfString input)
|
||||
{
|
||||
return OpenAPIClientUtils.compareLogic.Compare(this, input).AreEqual;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hash code
|
||||
/// </summary>
|
||||
/// <returns>Hash code</returns>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
unchecked // Overflow is fine, just wrap
|
||||
{
|
||||
int hashCode = 41;
|
||||
if (this.ActualInstance != null)
|
||||
hashCode = hashCode * 59 + this.ActualInstance.GetHashCode();
|
||||
return hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom JSON converter for OneOfString
|
||||
/// </summary>
|
||||
public class OneOfStringJsonConverter : JsonConverter
|
||||
{
|
||||
/// <summary>
|
||||
/// To write the JSON string
|
||||
/// </summary>
|
||||
/// <param name="writer">JSON writer</param>
|
||||
/// <param name="value">Object to be converted into a JSON string</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
writer.WriteRawValue((string)(typeof(OneOfString).GetMethod("ToJson").Invoke(value, null)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To convert a JSON string into an object
|
||||
/// </summary>
|
||||
/// <param name="reader">JSON reader</param>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <param name="existingValue">Existing value</param>
|
||||
/// <param name="serializer">JSON Serializer</param>
|
||||
/// <returns>The object converted from the JSON string</returns>
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if(reader.TokenType != JsonToken.Null)
|
||||
{
|
||||
return OneOfString.FromJson(JObject.Load(reader).ToString(Formatting.None));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the object can be converted
|
||||
/// </summary>
|
||||
/// <param name="objectType">Object type</param>
|
||||
/// <returns>True if the object can be converted</returns>
|
||||
public override bool CanConvert(Type objectType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -66,6 +66,7 @@ docs/models/NullableGuidClass.md
|
||||
docs/models/NullableShape.md
|
||||
docs/models/NumberOnly.md
|
||||
docs/models/ObjectWithDeprecatedFields.md
|
||||
docs/models/OneOfString.md
|
||||
docs/models/Order.md
|
||||
docs/models/OuterComposite.md
|
||||
docs/models/OuterEnum.md
|
||||
@@ -186,6 +187,7 @@ src/Org.OpenAPITools/Model/NullableGuidClass.cs
|
||||
src/Org.OpenAPITools/Model/NullableShape.cs
|
||||
src/Org.OpenAPITools/Model/NumberOnly.cs
|
||||
src/Org.OpenAPITools/Model/ObjectWithDeprecatedFields.cs
|
||||
src/Org.OpenAPITools/Model/OneOfString.cs
|
||||
src/Org.OpenAPITools/Model/Order.cs
|
||||
src/Org.OpenAPITools/Model/OuterComposite.cs
|
||||
src/Org.OpenAPITools/Model/OuterEnum.cs
|
||||
|
||||
@@ -1497,6 +1497,11 @@ components:
|
||||
to three digits following i.e. Image_01.
|
||||
pattern: "/^image_\\d{1,3}$/i"
|
||||
type: string
|
||||
pattern_with_backslash:
|
||||
description: None
|
||||
pattern: "^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\\\
|
||||
/([0-9]|[1-2][0-9]|3[0-2]))$"
|
||||
type: string
|
||||
required:
|
||||
- byte
|
||||
- date
|
||||
@@ -2195,6 +2200,12 @@ components:
|
||||
default: C:\Users\username
|
||||
type: string
|
||||
type: object
|
||||
OneOfString:
|
||||
oneOf:
|
||||
- pattern: ^a
|
||||
type: string
|
||||
- pattern: ^b
|
||||
type: string
|
||||
_foo_get_default_response:
|
||||
example:
|
||||
string:
|
||||
|
||||
@@ -6,7 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|--------|--------------|-------------|
|
||||
| [**Call123TestSpecialTags**](AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags |
|
||||
|
||||
<a name="call123testspecialtags"></a>
|
||||
<a id="call123testspecialtags"></a>
|
||||
# **Call123TestSpecialTags**
|
||||
> ModelClient Call123TestSpecialTags (ModelClient modelClient)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**GetCountry**](DefaultApi.md#getcountry) | **POST** /country | |
|
||||
| [**Hello**](DefaultApi.md#hello) | **GET** /hello | Hello |
|
||||
|
||||
<a name="fooget"></a>
|
||||
<a id="fooget"></a>
|
||||
# **FooGet**
|
||||
> FooGetDefaultResponse FooGet ()
|
||||
|
||||
@@ -90,7 +90,7 @@ No authorization required
|
||||
|
||||
[[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="getcountry"></a>
|
||||
<a id="getcountry"></a>
|
||||
# **GetCountry**
|
||||
> void GetCountry (string country)
|
||||
|
||||
@@ -173,7 +173,7 @@ No authorization required
|
||||
|
||||
[[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="hello"></a>
|
||||
<a id="hello"></a>
|
||||
# **Hello**
|
||||
> List<Guid> Hello ()
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**TestJsonFormData**](FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data |
|
||||
| [**TestQueryParameterCollectionFormat**](FakeApi.md#testqueryparametercollectionformat) | **PUT** /fake/test-query-parameters | |
|
||||
|
||||
<a name="fakehealthget"></a>
|
||||
<a id="fakehealthget"></a>
|
||||
# **FakeHealthGet**
|
||||
> HealthCheckResult FakeHealthGet ()
|
||||
|
||||
@@ -104,7 +104,7 @@ No authorization required
|
||||
|
||||
[[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="fakeouterbooleanserialize"></a>
|
||||
<a id="fakeouterbooleanserialize"></a>
|
||||
# **FakeOuterBooleanSerialize**
|
||||
> bool FakeOuterBooleanSerialize (bool? body = null)
|
||||
|
||||
@@ -193,7 +193,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="fakeoutercompositeserialize"></a>
|
||||
# **FakeOuterCompositeSerialize**
|
||||
> OuterComposite FakeOuterCompositeSerialize (OuterComposite? outerComposite = null)
|
||||
|
||||
@@ -282,7 +282,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="fakeouternumberserialize"></a>
|
||||
# **FakeOuterNumberSerialize**
|
||||
> decimal FakeOuterNumberSerialize (decimal? body = null)
|
||||
|
||||
@@ -371,7 +371,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="fakeouterstringserialize"></a>
|
||||
# **FakeOuterStringSerialize**
|
||||
> string FakeOuterStringSerialize (Guid requiredStringUuid, string? body = null)
|
||||
|
||||
@@ -462,7 +462,7 @@ No authorization required
|
||||
|
||||
[[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="getarrayofenums"></a>
|
||||
<a id="getarrayofenums"></a>
|
||||
# **GetArrayOfEnums**
|
||||
> List<OuterEnum> GetArrayOfEnums ()
|
||||
|
||||
@@ -546,7 +546,7 @@ No authorization required
|
||||
|
||||
[[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="testbodywithfileschema"></a>
|
||||
<a id="testbodywithfileschema"></a>
|
||||
# **TestBodyWithFileSchema**
|
||||
> void TestBodyWithFileSchema (FileSchemaTestClass fileSchemaTestClass)
|
||||
|
||||
@@ -631,7 +631,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="testbodywithqueryparams"></a>
|
||||
# **TestBodyWithQueryParams**
|
||||
> void TestBodyWithQueryParams (User user, string query)
|
||||
|
||||
@@ -716,7 +716,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="testclientmodel"></a>
|
||||
# **TestClientModel**
|
||||
> ModelClient TestClientModel (ModelClient modelClient)
|
||||
|
||||
@@ -807,7 +807,7 @@ No authorization required
|
||||
|
||||
[[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="testendpointparameters"></a>
|
||||
<a id="testendpointparameters"></a>
|
||||
# **TestEndpointParameters**
|
||||
> void TestEndpointParameters (byte[] _byte, decimal number, double _double, string patternWithoutDelimiter, DateTime? date = null, System.IO.Stream? binary = null, float? _float = null, int? integer = null, int? int32 = null, long? int64 = null, string? _string = null, string? password = null, string? callback = null, DateTime? dateTime = null)
|
||||
|
||||
@@ -925,7 +925,7 @@ void (empty response body)
|
||||
|
||||
[[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>
|
||||
<a id="testenumparameters"></a>
|
||||
# **TestEnumParameters**
|
||||
> void TestEnumParameters (List<string>? enumHeaderStringArray = null, List<string>? enumQueryStringArray = null, double? enumQueryDouble = null, int? enumQueryInteger = null, List<string>? enumFormStringArray = null, string? enumHeaderString = null, string? enumQueryString = null, string? enumFormString = null)
|
||||
|
||||
@@ -1027,7 +1027,7 @@ No authorization required
|
||||
|
||||
[[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="testgroupparameters"></a>
|
||||
<a id="testgroupparameters"></a>
|
||||
# **TestGroupParameters**
|
||||
> void TestGroupParameters (bool requiredBooleanGroup, int requiredStringGroup, long requiredInt64Group, bool? booleanGroup = null, int? stringGroup = null, long? int64Group = null)
|
||||
|
||||
@@ -1127,7 +1127,7 @@ void (empty response body)
|
||||
|
||||
[[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>
|
||||
<a id="testinlineadditionalproperties"></a>
|
||||
# **TestInlineAdditionalProperties**
|
||||
> void TestInlineAdditionalProperties (Dictionary<string, string> requestBody)
|
||||
|
||||
@@ -1212,7 +1212,7 @@ No authorization required
|
||||
|
||||
[[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="testjsonformdata"></a>
|
||||
<a id="testjsonformdata"></a>
|
||||
# **TestJsonFormData**
|
||||
> void TestJsonFormData (string param, string param2)
|
||||
|
||||
@@ -1299,7 +1299,7 @@ No authorization required
|
||||
|
||||
[[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="testqueryparametercollectionformat"></a>
|
||||
<a id="testqueryparametercollectionformat"></a>
|
||||
# **TestQueryParameterCollectionFormat**
|
||||
> void TestQueryParameterCollectionFormat (List<string> pipe, List<string> ioutil, List<string> http, List<string> url, List<string> context)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|--------|--------------|-------------|
|
||||
| [**TestClassname**](FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case |
|
||||
|
||||
<a name="testclassname"></a>
|
||||
<a id="testclassname"></a>
|
||||
# **TestClassname**
|
||||
> ModelClient TestClassname (ModelClient modelClient)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**UploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image |
|
||||
| [**UploadFileWithRequiredFile**](PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) |
|
||||
|
||||
<a name="addpet"></a>
|
||||
<a id="addpet"></a>
|
||||
# **AddPet**
|
||||
> void AddPet (Pet pet)
|
||||
|
||||
@@ -102,7 +102,7 @@ void (empty response body)
|
||||
|
||||
[[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="deletepet"></a>
|
||||
<a id="deletepet"></a>
|
||||
# **DeletePet**
|
||||
> void DeletePet (long petId, string? apiKey = null)
|
||||
|
||||
@@ -192,7 +192,7 @@ void (empty response body)
|
||||
|
||||
[[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="findpetsbystatus"></a>
|
||||
<a id="findpetsbystatus"></a>
|
||||
# **FindPetsByStatus**
|
||||
> List<Pet> FindPetsByStatus (List<string> status)
|
||||
|
||||
@@ -287,7 +287,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="findpetsbytags"></a>
|
||||
<a id="findpetsbytags"></a>
|
||||
# **FindPetsByTags**
|
||||
> List<Pet> FindPetsByTags (List<string> tags)
|
||||
|
||||
@@ -382,7 +382,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="getpetbyid"></a>
|
||||
<a id="getpetbyid"></a>
|
||||
# **GetPetById**
|
||||
> Pet GetPetById (long petId)
|
||||
|
||||
@@ -480,7 +480,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="updatepet"></a>
|
||||
<a id="updatepet"></a>
|
||||
# **UpdatePet**
|
||||
> void UpdatePet (Pet pet)
|
||||
|
||||
@@ -570,7 +570,7 @@ void (empty response body)
|
||||
|
||||
[[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="updatepetwithform"></a>
|
||||
<a id="updatepetwithform"></a>
|
||||
# **UpdatePetWithForm**
|
||||
> void UpdatePetWithForm (long petId, string? name = null, string? status = null)
|
||||
|
||||
@@ -662,7 +662,7 @@ void (empty response body)
|
||||
|
||||
[[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="uploadfile"></a>
|
||||
<a id="uploadfile"></a>
|
||||
# **UploadFile**
|
||||
> ApiResponse UploadFile (long petId, System.IO.Stream? file = null, string? additionalMetadata = null)
|
||||
|
||||
@@ -758,7 +758,7 @@ catch (ApiException e)
|
||||
|
||||
[[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="uploadfilewithrequiredfile"></a>
|
||||
<a id="uploadfilewithrequiredfile"></a>
|
||||
# **UploadFileWithRequiredFile**
|
||||
> ApiResponse UploadFileWithRequiredFile (System.IO.Stream requiredFile, long petId, string? additionalMetadata = null)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**GetOrderById**](StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID |
|
||||
| [**PlaceOrder**](StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet |
|
||||
|
||||
<a name="deleteorder"></a>
|
||||
<a id="deleteorder"></a>
|
||||
# **DeleteOrder**
|
||||
> void DeleteOrder (string orderId)
|
||||
|
||||
@@ -97,7 +97,7 @@ No authorization required
|
||||
|
||||
[[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="getinventory"></a>
|
||||
<a id="getinventory"></a>
|
||||
# **GetInventory**
|
||||
> Dictionary<string, int> GetInventory ()
|
||||
|
||||
@@ -188,7 +188,7 @@ This endpoint does not need any parameter.
|
||||
|
||||
[[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="getorderbyid"></a>
|
||||
<a id="getorderbyid"></a>
|
||||
# **GetOrderById**
|
||||
> Order GetOrderById (long orderId)
|
||||
|
||||
@@ -281,7 +281,7 @@ No authorization required
|
||||
|
||||
[[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="placeorder"></a>
|
||||
<a id="placeorder"></a>
|
||||
# **PlaceOrder**
|
||||
> Order PlaceOrder (Order order)
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
| [**LogoutUser**](UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session |
|
||||
| [**UpdateUser**](UserApi.md#updateuser) | **PUT** /user/{username} | Updated user |
|
||||
|
||||
<a name="createuser"></a>
|
||||
<a id="createuser"></a>
|
||||
# **CreateUser**
|
||||
> void CreateUser (User user)
|
||||
|
||||
@@ -100,7 +100,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="createuserswitharrayinput"></a>
|
||||
# **CreateUsersWithArrayInput**
|
||||
> void CreateUsersWithArrayInput (List<User> user)
|
||||
|
||||
@@ -185,7 +185,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="createuserswithlistinput"></a>
|
||||
# **CreateUsersWithListInput**
|
||||
> void CreateUsersWithListInput (List<User> user)
|
||||
|
||||
@@ -270,7 +270,7 @@ No authorization required
|
||||
|
||||
[[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="deleteuser"></a>
|
||||
<a id="deleteuser"></a>
|
||||
# **DeleteUser**
|
||||
> void DeleteUser (string username)
|
||||
|
||||
@@ -358,7 +358,7 @@ No authorization required
|
||||
|
||||
[[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="getuserbyname"></a>
|
||||
<a id="getuserbyname"></a>
|
||||
# **GetUserByName**
|
||||
> User GetUserByName (string username)
|
||||
|
||||
@@ -449,7 +449,7 @@ No authorization required
|
||||
|
||||
[[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="loginuser"></a>
|
||||
<a id="loginuser"></a>
|
||||
# **LoginUser**
|
||||
> string LoginUser (string username, string password)
|
||||
|
||||
@@ -541,7 +541,7 @@ No authorization required
|
||||
|
||||
[[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="logoutuser"></a>
|
||||
<a id="logoutuser"></a>
|
||||
# **LogoutUser**
|
||||
> void LogoutUser ()
|
||||
|
||||
@@ -621,7 +621,7 @@ No authorization required
|
||||
|
||||
[[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>
|
||||
<a id="updateuser"></a>
|
||||
# **UpdateUser**
|
||||
> void UpdateUser (User user, string username)
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ Name | Type | Description | Notes
|
||||
**Integer** | **int** | | [optional]
|
||||
**Number** | **decimal** | |
|
||||
**Password** | **string** | |
|
||||
**PatternWithBackslash** | **string** | None | [optional]
|
||||
**PatternWithDigits** | **string** | A string that is a 10 digit number. Can have leading zeros. | [optional]
|
||||
**PatternWithDigitsAndDelimiter** | **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
**StringProperty** | **string** | | [optional]
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
# Org.OpenAPITools.Model.OneOfString
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
|
||||
[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)
|
||||
|
||||
@@ -59,7 +59,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
ModelClient modelClient = default;
|
||||
var response = await _instance.Call123TestSpecialTagsAsync(modelClient);
|
||||
Assert.IsType<ModelClient>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<ModelClient>(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
public async Task FooGetAsyncTest()
|
||||
{
|
||||
var response = await _instance.FooGetAsync();
|
||||
Assert.IsType<FooGetDefaultResponse>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<FooGetDefaultResponse>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -78,7 +79,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
public async Task HelloAsyncTest()
|
||||
{
|
||||
var response = await _instance.HelloAsync();
|
||||
Assert.IsType<List<Guid>>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<List<Guid>>(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
public async Task FakeHealthGetAsyncTest()
|
||||
{
|
||||
var response = await _instance.FakeHealthGetAsync();
|
||||
Assert.IsType<HealthCheckResult>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<HealthCheckResult>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -69,7 +70,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
bool? body = default;
|
||||
var response = await _instance.FakeOuterBooleanSerializeAsync(body);
|
||||
Assert.IsType<bool>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<bool>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -80,7 +82,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
OuterComposite? outerComposite = default;
|
||||
var response = await _instance.FakeOuterCompositeSerializeAsync(outerComposite);
|
||||
Assert.IsType<OuterComposite>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<OuterComposite>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,7 +94,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
decimal? body = default;
|
||||
var response = await _instance.FakeOuterNumberSerializeAsync(body);
|
||||
Assert.IsType<decimal>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<decimal>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -103,7 +107,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
Guid requiredStringUuid = default;
|
||||
string? body = default;
|
||||
var response = await _instance.FakeOuterStringSerializeAsync(requiredStringUuid, body);
|
||||
Assert.IsType<string>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<string>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -113,7 +118,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
public async Task GetArrayOfEnumsAsyncTest()
|
||||
{
|
||||
var response = await _instance.GetArrayOfEnumsAsync();
|
||||
Assert.IsType<List<OuterEnum>>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<List<OuterEnum>>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -145,7 +151,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
ModelClient modelClient = default;
|
||||
var response = await _instance.TestClientModelAsync(modelClient);
|
||||
Assert.IsType<ModelClient>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<ModelClient>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -59,7 +59,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
ModelClient modelClient = default;
|
||||
var response = await _instance.TestClassnameAsync(modelClient);
|
||||
Assert.IsType<ModelClient>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<ModelClient>(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
List<string> status = default;
|
||||
var response = await _instance.FindPetsByStatusAsync(status);
|
||||
Assert.IsType<List<Pet>>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<List<Pet>>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -91,7 +92,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
List<string> tags = default;
|
||||
var response = await _instance.FindPetsByTagsAsync(tags);
|
||||
Assert.IsType<List<Pet>>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<List<Pet>>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -102,7 +104,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
long petId = default;
|
||||
var response = await _instance.GetPetByIdAsync(petId);
|
||||
Assert.IsType<Pet>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<Pet>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -137,7 +140,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
System.IO.Stream? file = default;
|
||||
string? additionalMetadata = default;
|
||||
var response = await _instance.UploadFileAsync(petId, file, additionalMetadata);
|
||||
Assert.IsType<ApiResponse>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<ApiResponse>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -150,7 +154,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
long petId = default;
|
||||
string? additionalMetadata = default;
|
||||
var response = await _instance.UploadFileWithRequiredFileAsync(requiredFile, petId, additionalMetadata);
|
||||
Assert.IsType<ApiResponse>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<ApiResponse>(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
public async Task GetInventoryAsyncTest()
|
||||
{
|
||||
var response = await _instance.GetInventoryAsync();
|
||||
Assert.IsType<Dictionary<string, int>>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<Dictionary<string, int>>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -79,7 +80,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
long orderId = default;
|
||||
var response = await _instance.GetOrderByIdAsync(orderId);
|
||||
Assert.IsType<Order>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<Order>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -90,7 +92,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
Order order = default;
|
||||
var response = await _instance.PlaceOrderAsync(order);
|
||||
Assert.IsType<Order>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<Order>(model);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
{
|
||||
string username = default;
|
||||
var response = await _instance.GetUserByNameAsync(username);
|
||||
Assert.IsType<User>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<User>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -111,7 +112,8 @@ namespace Org.OpenAPITools.Test.Api
|
||||
string username = default;
|
||||
string password = default;
|
||||
var response = await _instance.LoginUserAsync(username, password);
|
||||
Assert.IsType<string>(response);
|
||||
var model = response.ToModel();
|
||||
Assert.IsType<string>(model);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -151,6 +151,14 @@ namespace Org.OpenAPITools.Test.Model
|
||||
// TODO unit test for the property 'Password'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'PatternWithBackslash'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void PatternWithBackslashTest()
|
||||
{
|
||||
// TODO unit test for the property 'PatternWithBackslash'
|
||||
}
|
||||
/// <summary>
|
||||
/// Test the property 'PatternWithDigits'
|
||||
/// </summary>
|
||||
[Fact]
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* OpenAPI 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: \" \\
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0
|
||||
* Generated by: https://github.com/openapitools/openapi-generator.git
|
||||
*/
|
||||
|
||||
|
||||
using Xunit;
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using Org.OpenAPITools.Model;
|
||||
using Org.OpenAPITools.Client;
|
||||
using System.Reflection;
|
||||
|
||||
namespace Org.OpenAPITools.Test.Model
|
||||
{
|
||||
/// <summary>
|
||||
/// Class for testing OneOfString
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This file is automatically generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
/// Please update the test case below to test the model.
|
||||
/// </remarks>
|
||||
public class OneOfStringTests : IDisposable
|
||||
{
|
||||
// TODO uncomment below to declare an instance variable for OneOfString
|
||||
//private OneOfString instance;
|
||||
|
||||
public OneOfStringTests()
|
||||
{
|
||||
// TODO uncomment below to create an instance of OneOfString
|
||||
//instance = new OneOfString();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// Cleanup when everything is done.
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test an instance of OneOfString
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public void OneOfStringInstanceTest()
|
||||
{
|
||||
// TODO uncomment below to test "IsType" OneOfString
|
||||
//Assert.IsType<OneOfString>(instance);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,30 +39,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<ModelClient?>></returns>
|
||||
Task<ApiResponse<ModelClient?>> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// To test special tags
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To test special tags and operation ID starting with number
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<ModelClient></returns>
|
||||
Task<ModelClient> Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// To test special tags
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To test special tags and operation ID starting with number
|
||||
/// </remarks>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<ModelClient?></returns>
|
||||
Task<ModelClient?> Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<ModelClient>> Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,11 +91,11 @@ namespace Org.OpenAPITools.Api
|
||||
/// Initializes a new instance of the <see cref="AnotherFakeApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public AnotherFakeApi(ILogger<AnotherFakeApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
public AnotherFakeApi(ILogger<AnotherFakeApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
TokenProvider<OAuthToken> oauthTokenProvider)
|
||||
{
|
||||
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
|
||||
@@ -140,46 +117,6 @@ namespace Org.OpenAPITools.Api
|
||||
Logger.LogInformation("{0,-9} | {1} | {3}", (args.ReceivedAt - args.RequestedAt).TotalSeconds, args.HttpStatus, args.Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test special tags To test special tags and operation ID starting with number
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ModelClient"/>></returns>
|
||||
public async Task<ModelClient> Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<ModelClient?> apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test special tags To test special tags and operation ID starting with number
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ModelClient"/>></returns>
|
||||
public async Task<ModelClient?> Call123TestSpecialTagsOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<ModelClient?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await Call123TestSpecialTagsWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -204,7 +141,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="modelClient"></param>
|
||||
protected virtual void AfterCall123TestSpecialTags(ApiResponse<ModelClient?> apiResponseLocalVar, ModelClient modelClient)
|
||||
protected virtual void AfterCall123TestSpecialTags(ApiResponse<ModelClient> apiResponseLocalVar, ModelClient modelClient)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -227,7 +164,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="ModelClient"/></returns>
|
||||
public async Task<ApiResponse<ModelClient?>> Call123TestSpecialTagsWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<ModelClient>> Call123TestSpecialTagsAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -278,13 +215,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<ModelClient?> apiResponseLocalVar = new ApiResponse<ModelClient?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<ModelClient> apiResponseLocalVar = new ApiResponse<ModelClient>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<ModelClient>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterCall123TestSpecialTags(apiResponseLocalVar, modelClient);
|
||||
}
|
||||
AfterCall123TestSpecialTags(apiResponseLocalVar, modelClient);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
|
||||
@@ -38,28 +38,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<FooGetDefaultResponse?>></returns>
|
||||
Task<ApiResponse<FooGetDefaultResponse?>> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<FooGetDefaultResponse></returns>
|
||||
Task<FooGetDefaultResponse> FooGetAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<FooGetDefaultResponse?></returns>
|
||||
Task<FooGetDefaultResponse?> FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<FooGetDefaultResponse>> FooGetAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
@@ -71,30 +50,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Hello
|
||||
@@ -105,28 +61,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<List<Guid>?>></returns>
|
||||
Task<ApiResponse<List<Guid>?>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Hello
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Hello
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<List<Guid>></returns>
|
||||
Task<List<Guid>> HelloAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Hello
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Hello
|
||||
/// </remarks>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<List<Guid>?></returns>
|
||||
Task<List<Guid>?> HelloOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<List<Guid>>> HelloAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,11 +113,11 @@ namespace Org.OpenAPITools.Api
|
||||
/// Initializes a new instance of the <see cref="DefaultApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DefaultApi(ILogger<DefaultApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
public DefaultApi(ILogger<DefaultApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
TokenProvider<OAuthToken> oauthTokenProvider)
|
||||
{
|
||||
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
|
||||
@@ -204,44 +139,6 @@ namespace Org.OpenAPITools.Api
|
||||
Logger.LogInformation("{0,-9} | {1} | {3}", (args.ReceivedAt - args.RequestedAt).TotalSeconds, args.HttpStatus, args.Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="FooGetDefaultResponse"/>></returns>
|
||||
public async Task<FooGetDefaultResponse> FooGetAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<FooGetDefaultResponse?> apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="FooGetDefaultResponse"/>></returns>
|
||||
public async Task<FooGetDefaultResponse?> FooGetOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<FooGetDefaultResponse?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await FooGetWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -255,7 +152,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
protected virtual void AfterFooGet(ApiResponse<FooGetDefaultResponse?> apiResponseLocalVar)
|
||||
protected virtual void AfterFooGet(ApiResponse<FooGetDefaultResponse> apiResponseLocalVar)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -276,7 +173,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="FooGetDefaultResponse"/></returns>
|
||||
public async Task<ApiResponse<FooGetDefaultResponse?>> FooGetWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<FooGetDefaultResponse>> FooGetAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -314,13 +211,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<FooGetDefaultResponse?> apiResponseLocalVar = new ApiResponse<FooGetDefaultResponse?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<FooGetDefaultResponse> apiResponseLocalVar = new ApiResponse<FooGetDefaultResponse>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<FooGetDefaultResponse>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterFooGet(apiResponseLocalVar);
|
||||
}
|
||||
AfterFooGet(apiResponseLocalVar);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -333,46 +226,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> GetCountryOrDefaultAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await GetCountryWithHttpInfoAsync(country, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -397,7 +250,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="country"></param>
|
||||
protected virtual void AfterGetCountry(ApiResponse<object?> apiResponseLocalVar, string country)
|
||||
protected virtual void AfterGetCountry(ApiResponse<object> apiResponseLocalVar, string country)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -420,7 +273,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="country"></param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> GetCountryWithHttpInfoAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> GetCountryAsync(string country, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -468,13 +321,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterGetCountry(apiResponseLocalVar, country);
|
||||
}
|
||||
AfterGetCountry(apiResponseLocalVar, country);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -487,44 +336,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hello Hello
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="List<Guid>"/>></returns>
|
||||
public async Task<List<Guid>> HelloAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<List<Guid>?> apiResponseLocalVar = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Hello Hello
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="List<Guid>"/>></returns>
|
||||
public async Task<List<Guid>?> HelloOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<List<Guid>?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await HelloWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -538,7 +349,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
protected virtual void AfterHello(ApiResponse<List<Guid>?> apiResponseLocalVar)
|
||||
protected virtual void AfterHello(ApiResponse<List<Guid>> apiResponseLocalVar)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -559,7 +370,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="List<Guid>"/></returns>
|
||||
public async Task<ApiResponse<List<Guid>?>> HelloWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<List<Guid>>> HelloAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -597,13 +408,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<List<Guid>?> apiResponseLocalVar = new ApiResponse<List<Guid>?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<List<Guid>> apiResponseLocalVar = new ApiResponse<List<Guid>>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<List<Guid>>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterHello(apiResponseLocalVar);
|
||||
}
|
||||
AfterHello(apiResponseLocalVar);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,30 +39,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<ModelClient?>></returns>
|
||||
Task<ApiResponse<ModelClient?>> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// To test class name in snake case
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To test class name in snake case
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<ModelClient></returns>
|
||||
Task<ModelClient> TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// To test class name in snake case
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// To test class name in snake case
|
||||
/// </remarks>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<ModelClient?></returns>
|
||||
Task<ModelClient?> TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<ModelClient>> TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,11 +91,11 @@ namespace Org.OpenAPITools.Api
|
||||
/// Initializes a new instance of the <see cref="FakeClassnameTags123Api"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public FakeClassnameTags123Api(ILogger<FakeClassnameTags123Api> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
public FakeClassnameTags123Api(ILogger<FakeClassnameTags123Api> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
TokenProvider<OAuthToken> oauthTokenProvider)
|
||||
{
|
||||
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
|
||||
@@ -140,46 +117,6 @@ namespace Org.OpenAPITools.Api
|
||||
Logger.LogInformation("{0,-9} | {1} | {3}", (args.ReceivedAt - args.RequestedAt).TotalSeconds, args.HttpStatus, args.Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test class name in snake case To test class name in snake case
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ModelClient"/>></returns>
|
||||
public async Task<ModelClient> TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<ModelClient?> apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To test class name in snake case To test class name in snake case
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ModelClient"/>></returns>
|
||||
public async Task<ModelClient?> TestClassnameOrDefaultAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<ModelClient?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await TestClassnameWithHttpInfoAsync(modelClient, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -204,7 +141,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="modelClient"></param>
|
||||
protected virtual void AfterTestClassname(ApiResponse<ModelClient?> apiResponseLocalVar, ModelClient modelClient)
|
||||
protected virtual void AfterTestClassname(ApiResponse<ModelClient> apiResponseLocalVar, ModelClient modelClient)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -227,7 +164,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="modelClient">client model</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="ModelClient"/></returns>
|
||||
public async Task<ApiResponse<ModelClient?>> TestClassnameWithHttpInfoAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<ModelClient>> TestClassnameAsync(ModelClient modelClient, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -288,14 +225,11 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<ModelClient?> apiResponseLocalVar = new ApiResponse<ModelClient?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<ModelClient> apiResponseLocalVar = new ApiResponse<ModelClient>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<ModelClient>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterTestClassname(apiResponseLocalVar, modelClient);
|
||||
}
|
||||
else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429)
|
||||
AfterTestClassname(apiResponseLocalVar, modelClient);
|
||||
|
||||
if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars)
|
||||
tokenBaseLocalVar.BeginRateLimit();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,30 +39,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </remarks>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
@@ -73,28 +50,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<Dictionary<string, int>?>></returns>
|
||||
Task<ApiResponse<Dictionary<string, int>?>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<Dictionary<string, int>></returns>
|
||||
Task<Dictionary<string, int>> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Returns a map of status codes to quantities
|
||||
/// </remarks>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<Dictionary<string, int>?></returns>
|
||||
Task<Dictionary<string, int>?> GetInventoryOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<Dictionary<string, int>>> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
@@ -106,30 +62,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<Order?>></returns>
|
||||
Task<ApiResponse<Order?>> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<Order></returns>
|
||||
Task<Order> GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
/// </remarks>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<Order?></returns>
|
||||
Task<Order?> GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<Order>> GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
@@ -141,30 +74,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="order">order placed for purchasing the pet</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<Order?>></returns>
|
||||
Task<ApiResponse<Order?>> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="order">order placed for purchasing the pet</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<Order></returns>
|
||||
Task<Order> PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="order">order placed for purchasing the pet</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<Order?></returns>
|
||||
Task<Order?> PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<Order>> PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,11 +126,11 @@ namespace Org.OpenAPITools.Api
|
||||
/// Initializes a new instance of the <see cref="StoreApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public StoreApi(ILogger<StoreApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
public StoreApi(ILogger<StoreApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
TokenProvider<OAuthToken> oauthTokenProvider)
|
||||
{
|
||||
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
|
||||
@@ -242,46 +152,6 @@ namespace Org.OpenAPITools.Api
|
||||
Logger.LogInformation("{0,-9} | {1} | {3}", (args.ReceivedAt - args.RequestedAt).TotalSeconds, args.HttpStatus, args.Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> DeleteOrderOrDefaultAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await DeleteOrderWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -306,7 +176,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="orderId"></param>
|
||||
protected virtual void AfterDeleteOrder(ApiResponse<object?> apiResponseLocalVar, string orderId)
|
||||
protected virtual void AfterDeleteOrder(ApiResponse<object> apiResponseLocalVar, string orderId)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -329,7 +199,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="orderId">ID of the order that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> DeleteOrderWithHttpInfoAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> DeleteOrderAsync(string orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -358,13 +228,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterDeleteOrder(apiResponseLocalVar, orderId);
|
||||
}
|
||||
AfterDeleteOrder(apiResponseLocalVar, orderId);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -377,44 +243,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="Dictionary<string, int>"/>></returns>
|
||||
public async Task<Dictionary<string, int>> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<Dictionary<string, int>?> apiResponseLocalVar = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns pet inventories by status Returns a map of status codes to quantities
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="Dictionary<string, int>"/>></returns>
|
||||
public async Task<Dictionary<string, int>?> GetInventoryOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<Dictionary<string, int>?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await GetInventoryWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -428,7 +256,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
protected virtual void AfterGetInventory(ApiResponse<Dictionary<string, int>?> apiResponseLocalVar)
|
||||
protected virtual void AfterGetInventory(ApiResponse<Dictionary<string, int>> apiResponseLocalVar)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -449,7 +277,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="Dictionary<string, int>"/></returns>
|
||||
public async Task<ApiResponse<Dictionary<string, int>?>> GetInventoryWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<Dictionary<string, int>>> GetInventoryAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -493,14 +321,11 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<Dictionary<string, int>?> apiResponseLocalVar = new ApiResponse<Dictionary<string, int>?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<Dictionary<string, int>> apiResponseLocalVar = new ApiResponse<Dictionary<string, int>>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<Dictionary<string, int>>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterGetInventory(apiResponseLocalVar);
|
||||
}
|
||||
else if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429)
|
||||
AfterGetInventory(apiResponseLocalVar);
|
||||
|
||||
if (apiResponseLocalVar.StatusCode == (HttpStatusCode) 429)
|
||||
foreach(TokenBase tokenBaseLocalVar in tokenBaseLocalVars)
|
||||
tokenBaseLocalVar.BeginRateLimit();
|
||||
|
||||
@@ -515,46 +340,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="Order"/>></returns>
|
||||
public async Task<Order> GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<Order?> apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="Order"/>></returns>
|
||||
public async Task<Order?> GetOrderByIdOrDefaultAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<Order?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await GetOrderByIdWithHttpInfoAsync(orderId, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -579,7 +364,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="orderId"></param>
|
||||
protected virtual void AfterGetOrderById(ApiResponse<Order?> apiResponseLocalVar, long orderId)
|
||||
protected virtual void AfterGetOrderById(ApiResponse<Order> apiResponseLocalVar, long orderId)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -602,7 +387,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="orderId">ID of pet that needs to be fetched</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="Order"/></returns>
|
||||
public async Task<ApiResponse<Order?>> GetOrderByIdWithHttpInfoAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<Order>> GetOrderByIdAsync(long orderId, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -641,13 +426,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<Order?> apiResponseLocalVar = new ApiResponse<Order?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<Order> apiResponseLocalVar = new ApiResponse<Order>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<Order>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterGetOrderById(apiResponseLocalVar, orderId);
|
||||
}
|
||||
AfterGetOrderById(apiResponseLocalVar, orderId);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -660,46 +441,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="order">order placed for purchasing the pet</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="Order"/>></returns>
|
||||
public async Task<Order> PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<Order?> apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Place an order for a pet
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="order">order placed for purchasing the pet</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="Order"/>></returns>
|
||||
public async Task<Order?> PlaceOrderOrDefaultAsync(Order order, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<Order?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await PlaceOrderWithHttpInfoAsync(order, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -724,7 +465,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="order"></param>
|
||||
protected virtual void AfterPlaceOrder(ApiResponse<Order?> apiResponseLocalVar, Order order)
|
||||
protected virtual void AfterPlaceOrder(ApiResponse<Order> apiResponseLocalVar, Order order)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -747,7 +488,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="order">order placed for purchasing the pet</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="Order"/></returns>
|
||||
public async Task<ApiResponse<Order?>> PlaceOrderWithHttpInfoAsync(Order order, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<Order>> PlaceOrderAsync(Order order, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -799,13 +540,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<Order?> apiResponseLocalVar = new ApiResponse<Order?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<Order> apiResponseLocalVar = new ApiResponse<Order>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<Order>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterPlaceOrder(apiResponseLocalVar, order);
|
||||
}
|
||||
AfterPlaceOrder(apiResponseLocalVar, order);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
|
||||
@@ -39,30 +39,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="user">Created user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Create user
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">Created user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Create user
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <param name="user">Created user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
@@ -74,30 +51,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> CreateUsersWithArrayInputWithHttpInfoAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> CreateUsersWithArrayInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> CreateUsersWithArrayInputOrDefaultAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> CreateUsersWithArrayInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
@@ -109,30 +63,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> CreateUsersWithListInputWithHttpInfoAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> CreateUsersWithListInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> CreateUsersWithListInputOrDefaultAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> CreateUsersWithListInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete user
|
||||
@@ -144,30 +75,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete user
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Delete user
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get user by user name
|
||||
@@ -179,30 +87,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<User?>></returns>
|
||||
Task<ApiResponse<User?>> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get user by user name
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="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="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<User></returns>
|
||||
Task<User> GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Get user by user name
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<User?></returns>
|
||||
Task<User?> GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<User>> GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
@@ -215,32 +100,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<string?>></returns>
|
||||
Task<ApiResponse<string?>> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<string></returns>
|
||||
Task<string> LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<string?></returns>
|
||||
Task<string?> LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<string>> LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
@@ -251,28 +111,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Updated user
|
||||
@@ -285,32 +124,7 @@ namespace Org.OpenAPITools.IApi
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task<ApiResponse<object?>></returns>
|
||||
Task<ApiResponse<object?>> UpdateUserWithHttpInfoAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Updated user
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">Updated user object</param>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object></returns>
|
||||
Task<object> UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
|
||||
/// <summary>
|
||||
/// Updated user
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This can only be done by the logged in user.
|
||||
/// </remarks>
|
||||
/// <param name="user">Updated user object</param>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns>Task of ApiResponse<object?></returns>
|
||||
Task<object?> UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
Task<ApiResponse<object>> UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,11 +176,11 @@ namespace Org.OpenAPITools.Api
|
||||
/// Initializes a new instance of the <see cref="UserApi"/> class.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public UserApi(ILogger<UserApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
public UserApi(ILogger<UserApi> logger, HttpClient httpClient, JsonSerializerOptionsProvider jsonSerializerOptionsProvider,
|
||||
TokenProvider<ApiKeyToken> apiKeyProvider,
|
||||
TokenProvider<BearerToken> bearerTokenProvider,
|
||||
TokenProvider<BasicToken> basicTokenProvider,
|
||||
TokenProvider<HttpSignatureToken> httpSignatureTokenProvider,
|
||||
TokenProvider<OAuthToken> oauthTokenProvider)
|
||||
{
|
||||
_jsonSerializerOptions = jsonSerializerOptionsProvider.Options;
|
||||
@@ -388,46 +202,6 @@ namespace Org.OpenAPITools.Api
|
||||
Logger.LogInformation("{0,-9} | {1} | {3}", (args.ReceivedAt - args.RequestedAt).TotalSeconds, args.HttpStatus, args.Path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">Created user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">Created user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> CreateUserOrDefaultAsync(User user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await CreateUserWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -452,7 +226,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="user"></param>
|
||||
protected virtual void AfterCreateUser(ApiResponse<object?> apiResponseLocalVar, User user)
|
||||
protected virtual void AfterCreateUser(ApiResponse<object> apiResponseLocalVar, User user)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -475,7 +249,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="user">Created user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> CreateUserWithHttpInfoAsync(User user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> CreateUserAsync(User user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -517,13 +291,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterCreateUser(apiResponseLocalVar, user);
|
||||
}
|
||||
AfterCreateUser(apiResponseLocalVar, user);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -536,46 +306,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> CreateUsersWithArrayInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> CreateUsersWithArrayInputOrDefaultAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await CreateUsersWithArrayInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -600,7 +330,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="user"></param>
|
||||
protected virtual void AfterCreateUsersWithArrayInput(ApiResponse<object?> apiResponseLocalVar, List<User> user)
|
||||
protected virtual void AfterCreateUsersWithArrayInput(ApiResponse<object> apiResponseLocalVar, List<User> user)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -623,7 +353,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> CreateUsersWithArrayInputWithHttpInfoAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> CreateUsersWithArrayInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -665,13 +395,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterCreateUsersWithArrayInput(apiResponseLocalVar, user);
|
||||
}
|
||||
AfterCreateUsersWithArrayInput(apiResponseLocalVar, user);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -684,46 +410,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> CreateUsersWithListInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates list of users with given input array
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> CreateUsersWithListInputOrDefaultAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await CreateUsersWithListInputWithHttpInfoAsync(user, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -748,7 +434,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="user"></param>
|
||||
protected virtual void AfterCreateUsersWithListInput(ApiResponse<object?> apiResponseLocalVar, List<User> user)
|
||||
protected virtual void AfterCreateUsersWithListInput(ApiResponse<object> apiResponseLocalVar, List<User> user)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -771,7 +457,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="user">List of user object</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> CreateUsersWithListInputWithHttpInfoAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> CreateUsersWithListInputAsync(List<User> user, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -813,13 +499,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterCreateUsersWithListInput(apiResponseLocalVar, user);
|
||||
}
|
||||
AfterCreateUsersWithListInput(apiResponseLocalVar, user);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -832,46 +514,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delete user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> DeleteUserOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await DeleteUserWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -896,7 +538,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="username"></param>
|
||||
protected virtual void AfterDeleteUser(ApiResponse<object?> apiResponseLocalVar, string username)
|
||||
protected virtual void AfterDeleteUser(ApiResponse<object> apiResponseLocalVar, string username)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -919,7 +561,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="username">The name that needs to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> DeleteUserWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> DeleteUserAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -948,13 +590,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterDeleteUser(apiResponseLocalVar, username);
|
||||
}
|
||||
AfterDeleteUser(apiResponseLocalVar, username);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -967,46 +605,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user by user name
|
||||
/// </summary>
|
||||
/// <exception cref="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="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="User"/>></returns>
|
||||
public async Task<User> GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<User?> apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get user by user name
|
||||
/// </summary>
|
||||
/// <exception cref="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="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="User"/>></returns>
|
||||
public async Task<User?> GetUserByNameOrDefaultAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<User?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await GetUserByNameWithHttpInfoAsync(username, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -1031,7 +629,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="username"></param>
|
||||
protected virtual void AfterGetUserByName(ApiResponse<User?> apiResponseLocalVar, string username)
|
||||
protected virtual void AfterGetUserByName(ApiResponse<User> apiResponseLocalVar, string username)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1054,7 +652,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="username">The name that needs to be fetched. Use user1 for testing.</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="User"/></returns>
|
||||
public async Task<ApiResponse<User?>> GetUserByNameWithHttpInfoAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<User>> GetUserByNameAsync(string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -1093,13 +691,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<User?> apiResponseLocalVar = new ApiResponse<User?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<User> apiResponseLocalVar = new ApiResponse<User>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<User>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterGetUserByName(apiResponseLocalVar, username);
|
||||
}
|
||||
AfterGetUserByName(apiResponseLocalVar, username);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -1112,48 +706,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="string"/>></returns>
|
||||
public async Task<string> LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<string?> apiResponseLocalVar = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs user into the system
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="username">The user name for login</param>
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="string"/>></returns>
|
||||
public async Task<string?> LoginUserOrDefaultAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<string?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await LoginUserWithHttpInfoAsync(username, password, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -1183,7 +735,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="username"></param>
|
||||
/// <param name="password"></param>
|
||||
protected virtual void AfterLoginUser(ApiResponse<string?> apiResponseLocalVar, string username, string password)
|
||||
protected virtual void AfterLoginUser(ApiResponse<string> apiResponseLocalVar, string username, string password)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1208,7 +760,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="password">The password for login in clear text</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="string"/></returns>
|
||||
public async Task<ApiResponse<string?>> LoginUserWithHttpInfoAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<string>> LoginUserAsync(string username, string password, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -1256,13 +808,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<string?> apiResponseLocalVar = new ApiResponse<string?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<string> apiResponseLocalVar = new ApiResponse<string>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<string>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterLoginUser(apiResponseLocalVar, username, password);
|
||||
}
|
||||
AfterLoginUser(apiResponseLocalVar, username, password);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -1275,44 +823,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Logs out current logged in user session
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> LogoutUserOrDefaultAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await LogoutUserWithHttpInfoAsync(cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -1326,7 +836,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// Processes the server response
|
||||
/// </summary>
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
protected virtual void AfterLogoutUser(ApiResponse<object?> apiResponseLocalVar)
|
||||
protected virtual void AfterLogoutUser(ApiResponse<object> apiResponseLocalVar)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1347,7 +857,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> LogoutUserWithHttpInfoAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> LogoutUserAsync(System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -1376,13 +886,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterLogoutUser(apiResponseLocalVar);
|
||||
}
|
||||
AfterLogoutUser(apiResponseLocalVar);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
@@ -1395,48 +901,6 @@ namespace Org.OpenAPITools.Api
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updated user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">Updated user object</param>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object> UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?> apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (apiResponseLocalVar.Content == null)
|
||||
throw new ApiException(apiResponseLocalVar.ReasonPhrase, apiResponseLocalVar.StatusCode, apiResponseLocalVar.RawContent);
|
||||
|
||||
return apiResponseLocalVar.Content;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updated user This can only be done by the logged in user.
|
||||
/// </summary>
|
||||
/// <exception cref="ApiException">Thrown when fails to make API call</exception>
|
||||
/// <param name="user">Updated user object</param>
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="object"/>></returns>
|
||||
public async Task<object?> UpdateUserOrDefaultAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
ApiResponse<object?>? apiResponseLocalVar = null;
|
||||
try
|
||||
{
|
||||
apiResponseLocalVar = await UpdateUserWithHttpInfoAsync(user, username, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return apiResponseLocalVar != null && apiResponseLocalVar.IsSuccessStatusCode
|
||||
? apiResponseLocalVar.Content
|
||||
: null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validates the request parameters
|
||||
/// </summary>
|
||||
@@ -1466,7 +930,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="apiResponseLocalVar"></param>
|
||||
/// <param name="user"></param>
|
||||
/// <param name="username"></param>
|
||||
protected virtual void AfterUpdateUser(ApiResponse<object?> apiResponseLocalVar, User user, string username)
|
||||
protected virtual void AfterUpdateUser(ApiResponse<object> apiResponseLocalVar, User user, string username)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1491,7 +955,7 @@ namespace Org.OpenAPITools.Api
|
||||
/// <param name="username">name that need to be deleted</param>
|
||||
/// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
|
||||
/// <returns><see cref="Task"/><<see cref="ApiResponse{T}"/>> where T : <see cref="object"/></returns>
|
||||
public async Task<ApiResponse<object?>> UpdateUserWithHttpInfoAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
public async Task<ApiResponse<object>> UpdateUserAsync(User user, string username, System.Threading.CancellationToken? cancellationToken = null)
|
||||
{
|
||||
UriBuilder uriBuilderLocalVar = new UriBuilder();
|
||||
|
||||
@@ -1535,13 +999,9 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
string responseContentLocalVar = await httpResponseMessageLocalVar.Content.ReadAsStringAsync(cancellationToken.GetValueOrDefault()).ConfigureAwait(false);
|
||||
|
||||
ApiResponse<object?> apiResponseLocalVar = new ApiResponse<object?>(httpResponseMessageLocalVar, responseContentLocalVar);
|
||||
ApiResponse<object> apiResponseLocalVar = new ApiResponse<object>(httpRequestMessageLocalVar, httpResponseMessageLocalVar, responseContentLocalVar, _jsonSerializerOptions);
|
||||
|
||||
if (apiResponseLocalVar.IsSuccessStatusCode)
|
||||
{
|
||||
apiResponseLocalVar.Content = JsonSerializer.Deserialize<object>(apiResponseLocalVar.RawContent, _jsonSerializerOptions);
|
||||
AfterUpdateUser(apiResponseLocalVar, user, username);
|
||||
}
|
||||
AfterUpdateUser(apiResponseLocalVar, user, username);
|
||||
|
||||
return apiResponseLocalVar;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
@@ -22,7 +23,7 @@ namespace Org.OpenAPITools.Client
|
||||
public interface IApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// The data type of <see cref="Data"/>
|
||||
/// The type that represents the server's response.
|
||||
/// </summary>
|
||||
Type ResponseType { get; }
|
||||
|
||||
@@ -48,11 +49,6 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public partial class ApiResponse<T> : IApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// The deserialized content
|
||||
/// </summary>
|
||||
public T? Content { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the status code (HTTP status code)
|
||||
/// </summary>
|
||||
@@ -60,7 +56,7 @@ namespace Org.OpenAPITools.Client
|
||||
public HttpStatusCode StatusCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The content of this response
|
||||
/// The type that represents the server's response.
|
||||
/// </summary>
|
||||
public Type ResponseType
|
||||
{
|
||||
@@ -70,7 +66,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// The raw data
|
||||
/// </summary>
|
||||
public string RawContent { get; }
|
||||
public string RawContent { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// The IsSuccessStatusCode from the api response
|
||||
@@ -92,18 +88,56 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public DateTime DownloadedAt { get; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// The JsonSerialzierOptions
|
||||
/// </summary>
|
||||
private System.Text.Json.JsonSerializerOptions _jsonSerializerOptions;
|
||||
|
||||
/// <summary>
|
||||
/// Construct the response using an HttpResponseMessage
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <param name="httpRequestMessage"></param>
|
||||
/// <param name="httpResponseMessage"></param>
|
||||
/// <param name="rawContent"></param>
|
||||
public ApiResponse(System.Net.Http.HttpResponseMessage response, string rawContent)
|
||||
/// <param name="jsonSerializerOptions"></param>
|
||||
public ApiResponse(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage, string rawContent, System.Text.Json.JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
StatusCode = response.StatusCode;
|
||||
Headers = response.Headers;
|
||||
IsSuccessStatusCode = response.IsSuccessStatusCode;
|
||||
ReasonPhrase = response.ReasonPhrase;
|
||||
StatusCode = httpResponseMessage.StatusCode;
|
||||
Headers = httpResponseMessage.Headers;
|
||||
IsSuccessStatusCode = httpResponseMessage.IsSuccessStatusCode;
|
||||
ReasonPhrase = httpResponseMessage.ReasonPhrase;
|
||||
RawContent = rawContent;
|
||||
_jsonSerializerOptions = jsonSerializerOptions;
|
||||
OnCreated(httpRequestMessage, httpResponseMessage);
|
||||
}
|
||||
|
||||
partial void OnCreated(System.Net.Http.HttpRequestMessage httpRequestMessage, System.Net.Http.HttpResponseMessage httpResponseMessage);
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes the server's response
|
||||
/// </summary>
|
||||
public T? ToModel(System.Text.Json.JsonSerializerOptions? options = null)
|
||||
{
|
||||
return IsSuccessStatusCode
|
||||
? System.Text.Json.JsonSerializer.Deserialize<T>(RawContent, options ?? _jsonSerializerOptions)
|
||||
: default(T);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when the model can be deserialized
|
||||
/// </summary>
|
||||
public bool TryToModel([NotNullWhen(true)] out T? model, System.Text.Json.JsonSerializerOptions? options = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
model = ToModel(options);
|
||||
return model != null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
model = default(T);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Filename</returns>
|
||||
public static string SanitizeFilename(string filename)
|
||||
{
|
||||
Match match = Regex.Match(filename, ".*[/\\](.*)$");
|
||||
Match match = Regex.Match(filename, @".*[/\\](.*)$");
|
||||
return match.Success ? match.Groups[1].Value : filename;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,6 +104,7 @@ namespace Org.OpenAPITools.Client
|
||||
_jsonOptions.Converters.Add(new NullableShapeJsonConverter());
|
||||
_jsonOptions.Converters.Add(new NumberOnlyJsonConverter());
|
||||
_jsonOptions.Converters.Add(new ObjectWithDeprecatedFieldsJsonConverter());
|
||||
_jsonOptions.Converters.Add(new OneOfStringJsonConverter());
|
||||
_jsonOptions.Converters.Add(new OrderJsonConverter());
|
||||
_jsonOptions.Converters.Add(new OuterCompositeJsonConverter());
|
||||
_jsonOptions.Converters.Add(new OuterEnumConverter());
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public Activity(Dictionary<string, List<ActivityOutputElementRepresentation>> activityOutputs)
|
||||
{
|
||||
ActivityOutputs = activityOutputs;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ActivityOutputs
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Prop1 = prop1;
|
||||
Prop2 = prop2;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Prop1
|
||||
/// </summary>
|
||||
|
||||
@@ -52,8 +52,11 @@ namespace Org.OpenAPITools.Model
|
||||
MapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
|
||||
MapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString;
|
||||
Anytype1 = anytype1;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// an object with no declared properties and no undeclared properties, hence it's an empty map.
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
ClassName = className;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
|
||||
@@ -42,8 +42,11 @@ namespace Org.OpenAPITools.Model
|
||||
Code = code;
|
||||
Message = message;
|
||||
Type = type;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Code
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Cultivar = cultivar;
|
||||
Origin = origin;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
@@ -83,14 +86,14 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// Cultivar (string) pattern
|
||||
Regex regexCultivar = new Regex("^[a-zA-Z\\s]*$", RegexOptions.CultureInvariant);
|
||||
Regex regexCultivar = new Regex(@"^[a-zA-Z\s]*$", RegexOptions.CultureInvariant);
|
||||
if (false == regexCultivar.Match(this.Cultivar).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Cultivar, must match a pattern of " + regexCultivar, new [] { "Cultivar" });
|
||||
}
|
||||
|
||||
// Origin (string) pattern
|
||||
Regex regexOrigin = new Regex("^[A-Z\\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexOrigin = new Regex(@"^[A-Z\s]*$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexOrigin.Match(this.Origin).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Origin, must match a pattern of " + regexOrigin, new [] { "Origin" });
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Cultivar = cultivar;
|
||||
Mealy = mealy;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Cultivar
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public ArrayOfArrayOfNumberOnly(List<List<decimal>> arrayArrayNumber)
|
||||
{
|
||||
ArrayArrayNumber = arrayArrayNumber;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayArrayNumber
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public ArrayOfNumberOnly(List<decimal> arrayNumber)
|
||||
{
|
||||
ArrayNumber = arrayNumber;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayNumber
|
||||
/// </summary>
|
||||
|
||||
@@ -42,8 +42,11 @@ namespace Org.OpenAPITools.Model
|
||||
ArrayArrayOfInteger = arrayArrayOfInteger;
|
||||
ArrayArrayOfModel = arrayArrayOfModel;
|
||||
ArrayOfString = arrayOfString;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayArrayOfInteger
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public Banana(decimal lengthCm)
|
||||
{
|
||||
LengthCm = lengthCm;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
LengthCm = lengthCm;
|
||||
Sweet = sweet;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets LengthCm
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public BasquePig(string className)
|
||||
{
|
||||
ClassName = className;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
|
||||
@@ -48,8 +48,11 @@ namespace Org.OpenAPITools.Model
|
||||
SCAETHFlowPoints = sCAETHFlowPoints;
|
||||
SmallCamel = smallCamel;
|
||||
SmallSnake = smallSnake;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Name of the pet
|
||||
/// </summary>
|
||||
|
||||
@@ -42,8 +42,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Dictionary = dictionary;
|
||||
CatAllOf = catAllOf;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Dictionary
|
||||
/// </summary>
|
||||
@@ -138,12 +141,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Cat cat, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, cat.Dictionary, jsonSerializerOptions);
|
||||
|
||||
writer.WriteString("className", cat.ClassName);
|
||||
writer.WriteString("color", cat.Color);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, cat.CatAllOf, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public CatAllOf(bool declawed)
|
||||
{
|
||||
Declawed = declawed;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Declawed
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Id
|
||||
/// </summary>
|
||||
|
||||
@@ -39,8 +39,11 @@ namespace Org.OpenAPITools.Model
|
||||
internal ChildCat(ChildCatAllOf childCatAllOf, string petType) : base(petType)
|
||||
{
|
||||
ChildCatAllOf = childCatAllOf;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ChildCatAllOf
|
||||
/// </summary>
|
||||
@@ -123,11 +126,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ChildCat childCat, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, childCat.ChildCatAllOf, jsonSerializerOptions);
|
||||
|
||||
writer.WriteString("pet_type", childCat.PetType);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Name = name;
|
||||
PetType = petType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines PetType
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public ClassModel(string classProperty)
|
||||
{
|
||||
ClassProperty = classProperty;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassProperty
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
QuadrilateralInterface = quadrilateralInterface;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// </summary>
|
||||
@@ -144,10 +147,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, ComplexQuadrilateral complexQuadrilateral, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, complexQuadrilateral.ShapeInterface, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, complexQuadrilateral.QuadrilateralInterface, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public DanishPig(string className)
|
||||
{
|
||||
ClassName = className;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassName
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public DateOnlyClass(DateTime dateOnlyProperty)
|
||||
{
|
||||
DateOnlyProperty = dateOnlyProperty;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DateOnlyProperty
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public DeprecatedObject(string name)
|
||||
{
|
||||
Name = name;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Name
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
internal Dog(DogAllOf dogAllOf, string className, string color = @"red") : base(className, color)
|
||||
{
|
||||
DogAllOf = dogAllOf;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DogAllOf
|
||||
/// </summary>
|
||||
@@ -128,12 +131,8 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Dog dog, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, dog.DogAllOf, jsonSerializerOptions);
|
||||
|
||||
writer.WriteString("className", dog.ClassName);
|
||||
writer.WriteString("color", dog.Color);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public DogAllOf(string breed)
|
||||
{
|
||||
Breed = breed;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Breed
|
||||
/// </summary>
|
||||
|
||||
@@ -44,8 +44,11 @@ namespace Org.OpenAPITools.Model
|
||||
ShapeOrNull = shapeOrNull;
|
||||
Shapes = shapes;
|
||||
NullableShape = nullableShape;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets MainShape
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
ArrayEnum = arrayEnum;
|
||||
JustSymbol = justSymbol;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines ArrayEnum
|
||||
/// </summary>
|
||||
|
||||
@@ -54,8 +54,11 @@ namespace Org.OpenAPITools.Model
|
||||
OuterEnumInteger = outerEnumInteger;
|
||||
OuterEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
|
||||
OuterEnum = outerEnum;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines EnumInteger
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// </summary>
|
||||
@@ -144,10 +147,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, EquilateralTriangle equilateralTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, equilateralTriangle.ShapeInterface, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, equilateralTriangle.TriangleInterface, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public File(string sourceURI)
|
||||
{
|
||||
SourceURI = sourceURI;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Test capitalization
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
File = file;
|
||||
Files = files;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets File
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public Foo(string bar = @"bar")
|
||||
{
|
||||
Bar = bar;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Bar
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public FooGetDefaultResponse(Foo stringProperty)
|
||||
{
|
||||
StringProperty = stringProperty;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets StringProperty
|
||||
/// </summary>
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="integer">integer</param>
|
||||
/// <param name="number">number</param>
|
||||
/// <param name="password">password</param>
|
||||
/// <param name="patternWithBackslash">None</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros.</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.</param>
|
||||
/// <param name="stringProperty">stringProperty</param>
|
||||
@@ -52,7 +53,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="unsignedLong">unsignedLong</param>
|
||||
/// <param name="uuid">uuid</param>
|
||||
[JsonConstructor]
|
||||
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
|
||||
public FormatTest(System.IO.Stream binary, byte[] byteProperty, DateTime date, DateTime dateTime, decimal decimalProperty, double doubleProperty, float floatProperty, int int32, long int64, int integer, decimal number, string password, string patternWithBackslash, string patternWithDigits, string patternWithDigitsAndDelimiter, string stringProperty, uint unsignedInteger, ulong unsignedLong, Guid uuid)
|
||||
{
|
||||
Binary = binary;
|
||||
ByteProperty = byteProperty;
|
||||
@@ -66,14 +67,18 @@ namespace Org.OpenAPITools.Model
|
||||
Integer = integer;
|
||||
Number = number;
|
||||
Password = password;
|
||||
PatternWithBackslash = patternWithBackslash;
|
||||
PatternWithDigits = patternWithDigits;
|
||||
PatternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
|
||||
StringProperty = stringProperty;
|
||||
UnsignedInteger = unsignedInteger;
|
||||
UnsignedLong = unsignedLong;
|
||||
Uuid = uuid;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Binary
|
||||
/// </summary>
|
||||
@@ -148,6 +153,13 @@ namespace Org.OpenAPITools.Model
|
||||
[JsonPropertyName("password")]
|
||||
public string Password { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// None
|
||||
/// </summary>
|
||||
/// <value>None</value>
|
||||
[JsonPropertyName("pattern_with_backslash")]
|
||||
public string PatternWithBackslash { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// A string that is a 10 digit number. Can have leading zeros.
|
||||
/// </summary>
|
||||
@@ -213,6 +225,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" Integer: ").Append(Integer).Append("\n");
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" Password: ").Append(Password).Append("\n");
|
||||
sb.Append(" PatternWithBackslash: ").Append(PatternWithBackslash).Append("\n");
|
||||
sb.Append(" PatternWithDigits: ").Append(PatternWithDigits).Append("\n");
|
||||
sb.Append(" PatternWithDigitsAndDelimiter: ").Append(PatternWithDigitsAndDelimiter).Append("\n");
|
||||
sb.Append(" StringProperty: ").Append(StringProperty).Append("\n");
|
||||
@@ -303,22 +316,29 @@ namespace Org.OpenAPITools.Model
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for Password, length must be greater than 10.", new [] { "Password" });
|
||||
}
|
||||
|
||||
// PatternWithBackslash (string) pattern
|
||||
Regex regexPatternWithBackslash = new Regex(@"^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithBackslash.Match(this.PatternWithBackslash).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithBackslash, must match a pattern of " + regexPatternWithBackslash, new [] { "PatternWithBackslash" });
|
||||
}
|
||||
|
||||
// PatternWithDigits (string) pattern
|
||||
Regex regexPatternWithDigits = new Regex("^\\d{10}$", RegexOptions.CultureInvariant);
|
||||
Regex regexPatternWithDigits = new Regex(@"^\d{10}$", RegexOptions.CultureInvariant);
|
||||
if (false == regexPatternWithDigits.Match(this.PatternWithDigits).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigits, must match a pattern of " + regexPatternWithDigits, new [] { "PatternWithDigits" });
|
||||
}
|
||||
|
||||
// PatternWithDigitsAndDelimiter (string) pattern
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex("^image_\\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexPatternWithDigitsAndDelimiter = new Regex(@"^image_\d{1,3}$", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexPatternWithDigitsAndDelimiter.Match(this.PatternWithDigitsAndDelimiter).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for PatternWithDigitsAndDelimiter, must match a pattern of " + regexPatternWithDigitsAndDelimiter, new [] { "PatternWithDigitsAndDelimiter" });
|
||||
}
|
||||
|
||||
// StringProperty (string) pattern
|
||||
Regex regexStringProperty = new Regex("[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
Regex regexStringProperty = new Regex(@"[a-z]", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase);
|
||||
if (false == regexStringProperty.Match(this.StringProperty).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for StringProperty, must match a pattern of " + regexStringProperty, new [] { "StringProperty" });
|
||||
@@ -384,6 +404,7 @@ namespace Org.OpenAPITools.Model
|
||||
int integer = default;
|
||||
decimal number = default;
|
||||
string password = default;
|
||||
string patternWithBackslash = default;
|
||||
string patternWithDigits = default;
|
||||
string patternWithDigitsAndDelimiter = default;
|
||||
string stringProperty = default;
|
||||
@@ -453,6 +474,9 @@ namespace Org.OpenAPITools.Model
|
||||
case "password":
|
||||
password = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "pattern_with_backslash":
|
||||
patternWithBackslash = utf8JsonReader.GetString();
|
||||
break;
|
||||
case "pattern_with_digits":
|
||||
patternWithDigits = utf8JsonReader.GetString();
|
||||
break;
|
||||
@@ -537,10 +561,13 @@ namespace Org.OpenAPITools.Model
|
||||
if (patternWithDigitsAndDelimiter == null)
|
||||
throw new ArgumentNullException(nameof(patternWithDigitsAndDelimiter), "Property is required for class FormatTest.");
|
||||
|
||||
if (patternWithBackslash == null)
|
||||
throw new ArgumentNullException(nameof(patternWithBackslash), "Property is required for class FormatTest.");
|
||||
|
||||
#pragma warning restore CS0472 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
#pragma warning restore CS8073 // The result of the expression is always the same since a value of this type is never equal to 'null'
|
||||
|
||||
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
|
||||
return new FormatTest(binary, byteProperty, date, dateTime, decimalProperty, doubleProperty, floatProperty, int32, int64, integer, number, password, patternWithBackslash, patternWithDigits, patternWithDigitsAndDelimiter, stringProperty, unsignedInteger, unsignedLong, uuid);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -569,6 +596,7 @@ namespace Org.OpenAPITools.Model
|
||||
writer.WriteNumber("integer", formatTest.Integer);
|
||||
writer.WriteNumber("number", formatTest.Number);
|
||||
writer.WriteString("password", formatTest.Password);
|
||||
writer.WriteString("pattern_with_backslash", formatTest.PatternWithBackslash);
|
||||
writer.WriteString("pattern_with_digits", formatTest.PatternWithDigits);
|
||||
writer.WriteString("pattern_with_digits_and_delimiter", formatTest.PatternWithDigitsAndDelimiter);
|
||||
writer.WriteString("string", formatTest.StringProperty);
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Apple = apple;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -52,8 +53,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Banana = banana;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Apple
|
||||
/// </summary>
|
||||
@@ -175,11 +179,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Fruit fruit, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, fruit.Apple, jsonSerializerOptions);
|
||||
|
||||
writer.WriteString("color", fruit.Color);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, fruit.Banana, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Org.OpenAPITools.Model
|
||||
internal FruitReq(AppleReq appleReq)
|
||||
{
|
||||
AppleReq = appleReq;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -48,8 +49,11 @@ namespace Org.OpenAPITools.Model
|
||||
internal FruitReq(BananaReq bananaReq)
|
||||
{
|
||||
BananaReq = bananaReq;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets AppleReq
|
||||
/// </summary>
|
||||
@@ -151,10 +155,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, FruitReq fruitReq, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, fruitReq.AppleReq, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, fruitReq.BananaReq, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,11 @@ namespace Org.OpenAPITools.Model
|
||||
Apple = Apple;
|
||||
Banana = Banana;
|
||||
Color = color;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Apple
|
||||
/// </summary>
|
||||
@@ -159,11 +162,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, GmFruit gmFruit, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, gmFruit.Apple, jsonSerializerOptions);
|
||||
|
||||
writer.WriteString("color", gmFruit.Color);
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, gmFruit.Banana, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public GrandparentAnimal(string petType)
|
||||
{
|
||||
PetType = petType;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets PetType
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
Bar = bar;
|
||||
Foo = foo;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Bar
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public HealthCheckResult(string? nullableMessage = default)
|
||||
{
|
||||
NullableMessage = nullableMessage;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets NullableMessage
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
ShapeInterface = shapeInterface;
|
||||
TriangleInterface = triangleInterface;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ShapeInterface
|
||||
/// </summary>
|
||||
@@ -137,10 +140,10 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, IsoscelesTriangle isoscelesTriangle, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, isoscelesTriangle.ShapeInterface, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, isoscelesTriangle.TriangleInterface, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public List(string _123list)
|
||||
{
|
||||
_123List = _123list;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _123List
|
||||
/// </summary>
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
EscapedLiteralString = escapedLiteralString;
|
||||
UnescapedLiteralString = unescapedLiteralString;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets EscapedLiteralString
|
||||
/// </summary>
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace Org.OpenAPITools.Model
|
||||
internal Mammal(Whale whale)
|
||||
{
|
||||
Whale = whale;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -48,6 +49,7 @@ namespace Org.OpenAPITools.Model
|
||||
internal Mammal(Zebra zebra)
|
||||
{
|
||||
Zebra = zebra;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -58,8 +60,11 @@ namespace Org.OpenAPITools.Model
|
||||
internal Mammal(Pig pig)
|
||||
{
|
||||
Pig = pig;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Whale
|
||||
/// </summary>
|
||||
@@ -189,10 +194,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <exception cref="NotImplementedException"></exception>
|
||||
public override void Write(Utf8JsonWriter writer, Mammal mammal, JsonSerializerOptions jsonSerializerOptions)
|
||||
{
|
||||
writer.WriteStartObject();
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, mammal.Whale, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, mammal.Zebra, jsonSerializerOptions);
|
||||
|
||||
System.Text.Json.JsonSerializer.Serialize(writer, mammal.Pig, jsonSerializerOptions);
|
||||
|
||||
writer.WriteEndObject();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,8 +44,11 @@ namespace Org.OpenAPITools.Model
|
||||
IndirectMap = indirectMap;
|
||||
MapMapOfString = mapMapOfString;
|
||||
MapOfEnumString = mapOfEnumString;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Defines Inner
|
||||
/// </summary>
|
||||
|
||||
@@ -44,8 +44,11 @@ namespace Org.OpenAPITools.Model
|
||||
Map = map;
|
||||
Uuid = uuid;
|
||||
UuidWithPattern = uuidWithPattern;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets DateTime
|
||||
/// </summary>
|
||||
@@ -101,7 +104,7 @@ namespace Org.OpenAPITools.Model
|
||||
IEnumerable<System.ComponentModel.DataAnnotations.ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
// UuidWithPattern (Guid) pattern
|
||||
Regex regexUuidWithPattern = new Regex("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
Regex regexUuidWithPattern = new Regex(@"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}", RegexOptions.CultureInvariant);
|
||||
if (false == regexUuidWithPattern.Match(this.UuidWithPattern.ToString()).Success)
|
||||
{
|
||||
yield return new System.ComponentModel.DataAnnotations.ValidationResult("Invalid value for UuidWithPattern, must match a pattern of " + regexUuidWithPattern, new [] { "UuidWithPattern" });
|
||||
|
||||
@@ -40,8 +40,11 @@ namespace Org.OpenAPITools.Model
|
||||
{
|
||||
ClassProperty = classProperty;
|
||||
Name = name;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ClassProperty
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public ModelClient(string clientProperty)
|
||||
{
|
||||
_ClientProperty = clientProperty;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets _ClientProperty
|
||||
/// </summary>
|
||||
|
||||
@@ -44,8 +44,11 @@ namespace Org.OpenAPITools.Model
|
||||
Property = property;
|
||||
SnakeCase = snakeCase;
|
||||
_123Number = _123number;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets NameProperty
|
||||
/// </summary>
|
||||
|
||||
@@ -60,8 +60,11 @@ namespace Org.OpenAPITools.Model
|
||||
ObjectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||
ObjectNullableProp = objectNullableProp;
|
||||
StringProp = stringProp;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrayItemsNullable
|
||||
/// </summary>
|
||||
|
||||
@@ -38,8 +38,11 @@ namespace Org.OpenAPITools.Model
|
||||
public NullableGuidClass(Guid? uuid = default)
|
||||
{
|
||||
Uuid = uuid;
|
||||
OnCreated();
|
||||
}
|
||||
|
||||
partial void OnCreated();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Uuid
|
||||
/// </summary>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user