forked from loafle/openapi-generator-original
Merge remote-tracking branch 'origin/master' into 5.0.x
This commit is contained in:
@@ -17,7 +17,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
|
||||
<a name="dependencies"></a>
|
||||
## Dependencies
|
||||
|
||||
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later
|
||||
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later
|
||||
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
|
||||
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
|
||||
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
|
||||
|
||||
@@ -24,13 +24,8 @@ OpenAPI spec version: 1.0.0
|
||||
<EmbeddedResource Include="linux-logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1567,13 +1567,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (query != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query));
|
||||
}
|
||||
localVarRequestOptions.Data = body;
|
||||
|
||||
@@ -1639,13 +1633,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (query != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query));
|
||||
}
|
||||
localVarRequestOptions.Data = body;
|
||||
|
||||
@@ -1823,14 +1811,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string))
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||
if (patternWithoutDelimiter == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters");
|
||||
@@ -1867,18 +1847,12 @@ namespace Org.OpenAPITools.Api
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter
|
||||
}
|
||||
if (number != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
if (_float != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter
|
||||
}
|
||||
if (_double != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
if (_string != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter
|
||||
@@ -1977,14 +1951,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string))
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||
if (patternWithoutDelimiter == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters");
|
||||
@@ -2022,18 +1988,12 @@ namespace Org.OpenAPITools.Api
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter
|
||||
}
|
||||
if (number != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
if (_float != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter
|
||||
}
|
||||
if (_double != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
if (_string != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter
|
||||
@@ -2138,43 +2098,19 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (enumQueryStringArray != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray));
|
||||
}
|
||||
if (enumQueryString != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString));
|
||||
}
|
||||
if (enumQueryInteger != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger));
|
||||
}
|
||||
if (enumQueryDouble != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble));
|
||||
}
|
||||
if (enumHeaderStringArray != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter
|
||||
@@ -2255,43 +2191,19 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (enumQueryStringArray != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray));
|
||||
}
|
||||
if (enumQueryString != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString));
|
||||
}
|
||||
if (enumQueryInteger != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger));
|
||||
}
|
||||
if (enumQueryDouble != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble));
|
||||
}
|
||||
if (enumHeaderStringArray != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter
|
||||
@@ -2349,18 +2261,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?))
|
||||
{
|
||||
// verify the required parameter 'requiredStringGroup' is set
|
||||
if (requiredStringGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredBooleanGroup' is set
|
||||
if (requiredBooleanGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredInt64Group' is set
|
||||
if (requiredInt64Group == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -2376,48 +2276,17 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (requiredStringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requiredInt64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup));
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group));
|
||||
if (stringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup));
|
||||
}
|
||||
if (int64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group));
|
||||
}
|
||||
if (requiredBooleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
if (booleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter
|
||||
|
||||
@@ -2464,18 +2333,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?))
|
||||
{
|
||||
// verify the required parameter 'requiredStringGroup' is set
|
||||
if (requiredStringGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredBooleanGroup' is set
|
||||
if (requiredBooleanGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredInt64Group' is set
|
||||
if (requiredInt64Group == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -2492,48 +2349,17 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (requiredStringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requiredInt64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup));
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group));
|
||||
if (stringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup));
|
||||
}
|
||||
if (int64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group));
|
||||
}
|
||||
if (requiredBooleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
if (booleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter
|
||||
|
||||
@@ -2863,53 +2689,23 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (pipe != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
|
||||
}
|
||||
if (ioutil != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
|
||||
}
|
||||
if (http != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
|
||||
}
|
||||
if (url != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
|
||||
}
|
||||
if (context != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));
|
||||
}
|
||||
|
||||
|
||||
@@ -2991,53 +2787,23 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (pipe != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
|
||||
}
|
||||
if (ioutil != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
|
||||
}
|
||||
if (http != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
|
||||
}
|
||||
if (url != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
|
||||
}
|
||||
if (context != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -244,13 +244,7 @@ namespace Org.OpenAPITools.Api
|
||||
// authentication (api_key_query) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")));
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
@@ -313,13 +307,7 @@ namespace Org.OpenAPITools.Api
|
||||
// authentication (api_key_query) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")));
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
|
||||
@@ -708,10 +708,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> DeletePetWithHttpInfo (long petId, string apiKey = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -727,8 +723,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (apiKey != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter
|
||||
|
||||
@@ -773,10 +768,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -793,8 +784,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (apiKey != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter
|
||||
|
||||
@@ -861,13 +851,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -934,13 +918,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -1006,13 +984,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (tags != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -1079,13 +1051,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (tags != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -1128,10 +1094,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Pet</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long petId)
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -1149,8 +1111,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
@@ -1191,10 +1152,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (Pet)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Pet>> GetPetByIdAsyncWithHttpInfo (long petId)
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -1213,8 +1170,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
@@ -1383,10 +1339,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -1403,8 +1355,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (name != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter
|
||||
@@ -1457,10 +1408,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -1478,8 +1425,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (name != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter
|
||||
@@ -1533,10 +1479,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of ApiResponse</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -1554,8 +1496,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
@@ -1609,10 +1550,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (ApiResponse)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ApiResponse>> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -1631,8 +1568,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
@@ -1686,10 +1622,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of ApiResponse</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile");
|
||||
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile");
|
||||
@@ -1711,8 +1643,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
@@ -1766,10 +1697,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (ApiResponse)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ApiResponse>> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile");
|
||||
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile");
|
||||
@@ -1792,8 +1719,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
|
||||
@@ -560,10 +560,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (long orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -581,8 +577,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (orderId != null)
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
@@ -618,10 +613,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -640,8 +631,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (orderId != null)
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
|
||||
@@ -1100,23 +1100,11 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (username != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username));
|
||||
}
|
||||
if (password != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password));
|
||||
}
|
||||
|
||||
|
||||
@@ -1183,23 +1171,11 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (username != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username));
|
||||
}
|
||||
if (password != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -36,37 +36,34 @@ namespace Org.OpenAPITools.Client
|
||||
internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer
|
||||
{
|
||||
private readonly IReadableConfiguration _configuration;
|
||||
private readonly JsonSerializer _serializer;
|
||||
private string _contentType = "application/json";
|
||||
private static readonly string _contentType = "application/json";
|
||||
private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy()
|
||||
{
|
||||
OverrideSpecifiedNames = true
|
||||
}
|
||||
OverrideSpecifiedNames = true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public CustomJsonCodec(IReadableConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_serializer = JsonSerializer.Create(_serializerSettings);
|
||||
}
|
||||
|
||||
public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
|
||||
{
|
||||
_serializerSettings = serializerSettings;
|
||||
_serializer = JsonSerializer.Create(_serializerSettings);
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public string Serialize(object obj)
|
||||
{
|
||||
String result = JsonConvert.SerializeObject(obj, _serializerSettings);
|
||||
var result = JsonConvert.SerializeObject(obj, _serializerSettings);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -181,7 +178,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public ApiClient(String basePath)
|
||||
{
|
||||
if (String.IsNullOrEmpty(basePath))
|
||||
if (string.IsNullOrEmpty(basePath))
|
||||
throw new ArgumentException("basePath cannot be empty");
|
||||
|
||||
_baseUrl = basePath;
|
||||
@@ -238,7 +235,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>[private] A new RestRequest instance.</returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private RestRequest newRequest(
|
||||
private RestRequest NewRequest(
|
||||
HttpMethod method,
|
||||
String path,
|
||||
RequestOptions options,
|
||||
@@ -347,7 +344,7 @@ namespace Org.OpenAPITools.Client
|
||||
return request;
|
||||
}
|
||||
|
||||
private ApiResponse<T> toApiResponse<T>(IRestResponse<T> response)
|
||||
private ApiResponse<T> ToApiResponse<T>(IRestResponse<T> response)
|
||||
{
|
||||
T result = response.Data;
|
||||
string rawContent = response.Content;
|
||||
@@ -383,7 +380,7 @@ namespace Org.OpenAPITools.Client
|
||||
return transformed;
|
||||
}
|
||||
|
||||
private async Task<ApiResponse<T>> Exec<T>(RestRequest req, IReadableConfiguration configuration)
|
||||
private ApiResponse<T> Exec<T>(RestRequest req, IReadableConfiguration configuration)
|
||||
{
|
||||
RestClient client = new RestClient(_baseUrl);
|
||||
|
||||
@@ -391,15 +388,14 @@ namespace Org.OpenAPITools.Client
|
||||
var existingDeserializer = req.JsonSerializer as IDeserializer;
|
||||
if (existingDeserializer != null)
|
||||
{
|
||||
client.AddHandler(existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
else
|
||||
{
|
||||
var codec = new CustomJsonCodec(configuration);
|
||||
client.AddHandler(codec, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
|
||||
client.AddHandler(new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
|
||||
client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
|
||||
|
||||
client.Timeout = configuration.Timeout;
|
||||
|
||||
@@ -409,10 +405,12 @@ namespace Org.OpenAPITools.Client
|
||||
}
|
||||
|
||||
InterceptRequest(req);
|
||||
var response = await client.ExecuteTaskAsync<T>(req);
|
||||
|
||||
var response = client.Execute<T>(req);
|
||||
|
||||
InterceptResponse(req, response);
|
||||
|
||||
var result = toApiResponse(response);
|
||||
var result = ToApiResponse(response);
|
||||
if (response.ErrorMessage != null)
|
||||
{
|
||||
result.ErrorText = response.ErrorMessage;
|
||||
@@ -440,13 +438,78 @@ namespace Org.OpenAPITools.Client
|
||||
Secure = restResponseCookie.Secure,
|
||||
Version = restResponseCookie.Version
|
||||
};
|
||||
|
||||
|
||||
result.Cookies.Add(cookie);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, IReadableConfiguration configuration)
|
||||
{
|
||||
RestClient client = new RestClient(_baseUrl);
|
||||
|
||||
client.ClearHandlers();
|
||||
var existingDeserializer = req.JsonSerializer as IDeserializer;
|
||||
if (existingDeserializer != null)
|
||||
{
|
||||
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
else
|
||||
{
|
||||
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
|
||||
client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
|
||||
|
||||
client.Timeout = configuration.Timeout;
|
||||
|
||||
if (configuration.UserAgent != null)
|
||||
{
|
||||
client.UserAgent = configuration.UserAgent;
|
||||
}
|
||||
|
||||
InterceptRequest(req);
|
||||
|
||||
var response = await client.ExecuteAsync<T>(req);
|
||||
|
||||
InterceptResponse(req, response);
|
||||
|
||||
var result = ToApiResponse(response);
|
||||
if (response.ErrorMessage != null)
|
||||
{
|
||||
result.ErrorText = response.ErrorMessage;
|
||||
}
|
||||
|
||||
if (response.Cookies != null && response.Cookies.Count > 0)
|
||||
{
|
||||
if(result.Cookies == null) result.Cookies = new List<Cookie>();
|
||||
foreach (var restResponseCookie in response.Cookies)
|
||||
{
|
||||
var cookie = new Cookie(
|
||||
restResponseCookie.Name,
|
||||
restResponseCookie.Value,
|
||||
restResponseCookie.Path,
|
||||
restResponseCookie.Domain
|
||||
)
|
||||
{
|
||||
Comment = restResponseCookie.Comment,
|
||||
CommentUri = restResponseCookie.CommentUri,
|
||||
Discard = restResponseCookie.Discard,
|
||||
Expired = restResponseCookie.Expired,
|
||||
Expires = restResponseCookie.Expires,
|
||||
HttpOnly = restResponseCookie.HttpOnly,
|
||||
Port = restResponseCookie.Port,
|
||||
Secure = restResponseCookie.Secure,
|
||||
Version = restResponseCookie.Version
|
||||
};
|
||||
|
||||
result.Cookies.Add(cookie);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#region IAsynchronousClient
|
||||
/// <summary>
|
||||
/// Make a HTTP GET request (async).
|
||||
@@ -456,10 +519,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Get, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -470,10 +533,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Post, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -484,10 +547,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Put, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -498,10 +561,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Delete, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -512,10 +575,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Head, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -526,10 +589,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Options, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -540,10 +603,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Patch, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), config);
|
||||
}
|
||||
#endregion IAsynchronousClient
|
||||
|
||||
@@ -558,7 +621,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return GetAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Get, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -571,7 +635,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return PostAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Post, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -584,7 +649,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return PutAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Put, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -597,7 +663,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return DeleteAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Delete, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -610,7 +677,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return HeadAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Head, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -623,7 +691,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return OptionsAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Options, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -636,7 +705,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return PatchAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), config);
|
||||
}
|
||||
#endregion ISynchronousClient
|
||||
}
|
||||
|
||||
@@ -11,13 +11,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using KellermanSoftware.CompareNetObjects;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
@@ -63,15 +60,11 @@ namespace Org.OpenAPITools.Client
|
||||
{
|
||||
var parameters = new Multimap<string, string>();
|
||||
|
||||
if (IsCollection(value) && collectionFormat == "multi")
|
||||
if (value is ICollection collection && collectionFormat == "multi")
|
||||
{
|
||||
var valueCollection = value as IEnumerable;
|
||||
if (valueCollection != null)
|
||||
foreach (var item in collection)
|
||||
{
|
||||
foreach (var item in valueCollection)
|
||||
{
|
||||
parameters.Add(name, ParameterToString(item));
|
||||
}
|
||||
parameters.Add(name, ParameterToString(item));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -92,47 +85,26 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Formatted string.</returns>
|
||||
public static string ParameterToString(object obj, IReadableConfiguration configuration = null)
|
||||
{
|
||||
if (obj is DateTime)
|
||||
if (obj is DateTime dateTime)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return ((DateTime)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
else if (obj is DateTimeOffset)
|
||||
return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
if (obj is DateTimeOffset dateTimeOffset)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
else
|
||||
{
|
||||
if (obj is IList)
|
||||
{
|
||||
var list = obj as IList;
|
||||
var flattenedString = new StringBuilder();
|
||||
foreach (var param in list)
|
||||
{
|
||||
if (flattenedString.Length > 0)
|
||||
flattenedString.Append(",");
|
||||
flattenedString.Append(param);
|
||||
}
|
||||
return flattenedString.ToString();
|
||||
}
|
||||
|
||||
return Convert.ToString (obj);
|
||||
}
|
||||
return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
if (obj is bool boolean)
|
||||
return boolean ? "true" : "false";
|
||||
if (obj is ICollection collection)
|
||||
return string.Join(",", collection.Cast<object>());
|
||||
|
||||
return Convert.ToString(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if generic object is a collection.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns>True if object is a collection type</returns>
|
||||
private static bool IsCollection(object value)
|
||||
{
|
||||
return value is IList || value is ICollection;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// URL encode a string
|
||||
/// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50
|
||||
@@ -175,7 +147,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Encoded string.</returns>
|
||||
public static string Base64Encode(string text)
|
||||
{
|
||||
return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text));
|
||||
return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -185,14 +157,9 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Byte array</returns>
|
||||
public static byte[] ReadAsBytes(Stream inputStream)
|
||||
{
|
||||
byte[] buf = new byte[16*1024];
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
int count;
|
||||
while ((count = inputStream.Read(buf, 0, buf.Length)) > 0)
|
||||
{
|
||||
ms.Write(buf, 0, count);
|
||||
}
|
||||
inputStream.CopyTo(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
@@ -19,14 +18,13 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// A dictionary in which one key has many associated values.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the key</typeparam>
|
||||
/// <typeparam name="TKey">The type of the key</typeparam>
|
||||
/// <typeparam name="TValue">The type of the value associated with the key.</typeparam>
|
||||
public class Multimap<T, TValue> : IDictionary<T, IList<TValue>>
|
||||
public class Multimap<TKey, TValue> : IDictionary<TKey, IList<TValue>>
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ConcurrentDictionary<T, IList<TValue>> _dictionary =
|
||||
new ConcurrentDictionary<T, IList<TValue>>();
|
||||
private readonly Dictionary<TKey, IList<TValue>> _dictionary;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -37,15 +35,16 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public Multimap()
|
||||
{
|
||||
_dictionary = new ConcurrentDictionary<T, IList<TValue>>();
|
||||
_dictionary = new Dictionary<TKey, IList<TValue>>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with comparer.
|
||||
/// </summary>
|
||||
/// <param name="comparer"></param>
|
||||
public Multimap(IEqualityComparer<T> comparer) {
|
||||
_dictionary = new ConcurrentDictionary<T, IList<TValue>>(comparer);
|
||||
public Multimap(IEqualityComparer<TKey> comparer)
|
||||
{
|
||||
_dictionary = new Dictionary<TKey, IList<TValue>>(comparer);
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
@@ -56,7 +55,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// To get the enumerator.
|
||||
/// </summary>
|
||||
/// <returns>Enumerator</returns>
|
||||
public IEnumerator<KeyValuePair<T, IList<TValue>>> GetEnumerator()
|
||||
public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator()
|
||||
{
|
||||
return _dictionary.GetEnumerator();
|
||||
}
|
||||
@@ -77,12 +76,25 @@ namespace Org.OpenAPITools.Client
|
||||
/// Add values to Multimap
|
||||
/// </summary>
|
||||
/// <param name="item">Key value pair</param>
|
||||
public void Add(KeyValuePair<T, IList<TValue>> item)
|
||||
public void Add(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
if (!TryAdd(item.Key, item.Value))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Multimap to Multimap
|
||||
/// </summary>
|
||||
/// <param name="multimap">Multimap</param>
|
||||
public void Add(Multimap<TKey, TValue> multimap)
|
||||
{
|
||||
foreach (var item in multimap)
|
||||
{
|
||||
if (!TryAdd(item.Key, item.Value))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear Multimap
|
||||
/// </summary>
|
||||
@@ -97,7 +109,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="item">Key value pair</param>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
/// <returns>true if the Multimap contains the item; otherwise, false.</returns>
|
||||
public bool Contains(KeyValuePair<T, IList<TValue>> item)
|
||||
public bool Contains(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -110,7 +122,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// from Multimap. The array must have zero-based indexing.</param>
|
||||
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
public void CopyTo(KeyValuePair<T, IList<TValue>>[] array, int arrayIndex)
|
||||
public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -121,7 +133,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="item">Key value pair</param>
|
||||
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
public bool Remove(KeyValuePair<T, IList<TValue>> item)
|
||||
public bool Remove(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -129,24 +141,12 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Gets the number of items contained in the Multimap.
|
||||
/// </summary>
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary.Count;
|
||||
}
|
||||
}
|
||||
public int Count => _dictionary.Count;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Multimap is read-only.
|
||||
/// </summary>
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
/// <summary>
|
||||
/// Adds an item with the provided key and value to the Multimap.
|
||||
@@ -154,12 +154,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||
/// <exception cref="InvalidOperationException">Thrown when couldn't add the value to Multimap.</exception>
|
||||
public void Add(T key, IList<TValue> value)
|
||||
public void Add(TKey key, IList<TValue> value)
|
||||
{
|
||||
if (value != null && value.Count > 0)
|
||||
{
|
||||
IList<TValue> list;
|
||||
if (_dictionary.TryGetValue(key, out list))
|
||||
if (_dictionary.TryGetValue(key, out var list))
|
||||
{
|
||||
foreach (var k in value) list.Add(k);
|
||||
}
|
||||
@@ -178,7 +177,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="key">The key to locate in the Multimap.</param>
|
||||
/// <returns>true if the Multimap contains an item with
|
||||
/// the key; otherwise, false.</returns>
|
||||
public bool ContainsKey(T key)
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
return _dictionary.ContainsKey(key);
|
||||
}
|
||||
@@ -188,10 +187,9 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="key">The key to locate in the Multimap.</param>
|
||||
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||
public bool Remove(T key)
|
||||
public bool Remove(TKey key)
|
||||
{
|
||||
IList<TValue> list;
|
||||
return TryRemove(key, out list);
|
||||
return TryRemove(key, out var _);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -203,7 +201,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// This parameter is passed uninitialized.</param>
|
||||
/// <returns> true if the object that implements Multimap contains
|
||||
/// an item with the specified key; otherwise, false.</returns>
|
||||
public bool TryGetValue(T key, out IList<TValue> value)
|
||||
public bool TryGetValue(TKey key, out IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryGetValue(key, out value);
|
||||
}
|
||||
@@ -213,36 +211,21 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="key">The key of the item to get or set.</param>
|
||||
/// <returns>The value of the specified key.</returns>
|
||||
public IList<TValue> this[T key]
|
||||
public IList<TValue> this[TKey key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary[key];
|
||||
}
|
||||
set { _dictionary[key] = value; }
|
||||
get => _dictionary[key];
|
||||
set => _dictionary[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
|
||||
/// </summary>
|
||||
public ICollection<T> Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary.Keys;
|
||||
}
|
||||
}
|
||||
public ICollection<TKey> Keys => _dictionary.Keys;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
|
||||
/// </summary>
|
||||
public ICollection<IList<TValue>> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary.Values;
|
||||
}
|
||||
}
|
||||
public ICollection<IList<TValue>> Values => _dictionary.Values;
|
||||
|
||||
/// <summary>
|
||||
/// Copy the items of the Multimap to an System.Array,
|
||||
@@ -253,7 +236,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="index">The zero-based index in array at which copying begins.</param>
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
((ICollection) _dictionary).CopyTo(array, index);
|
||||
((ICollection)_dictionary).CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -262,19 +245,17 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||
/// <exception cref="InvalidOperationException">Thrown when couldn't add value to Multimap.</exception>
|
||||
public void Add(T key, TValue value)
|
||||
public void Add(TKey key, TValue value)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
IList<TValue> list;
|
||||
if (_dictionary.TryGetValue(key, out list))
|
||||
if (_dictionary.TryGetValue(key, out var list))
|
||||
{
|
||||
list.Add(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = new List<TValue>();
|
||||
list.Add(value);
|
||||
list = new List<TValue> { value };
|
||||
if (!TryAdd(key, list))
|
||||
throw new InvalidOperationException("Could not add value to Multimap.");
|
||||
}
|
||||
@@ -288,18 +269,27 @@ namespace Org.OpenAPITools.Client
|
||||
/**
|
||||
* Helper method to encapsulate generator differences between dictionary types.
|
||||
*/
|
||||
private bool TryRemove(T key, out IList<TValue> value)
|
||||
private bool TryRemove(TKey key, out IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryRemove(key, out value);
|
||||
|
||||
_dictionary.TryGetValue(key, out value);
|
||||
return _dictionary.Remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to encapsulate generator differences between dictionary types.
|
||||
*/
|
||||
private bool TryAdd(T key, IList<TValue> value)
|
||||
private bool TryAdd(TKey key, IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryAdd(key, value);
|
||||
try
|
||||
{
|
||||
_dictionary.Add(key, value);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion Private Members
|
||||
}
|
||||
|
||||
@@ -53,24 +53,9 @@ namespace Org.OpenAPITools.Model
|
||||
public Animal(string className = default(string), string color = "red")
|
||||
{
|
||||
// to ensure "className" is required (not null)
|
||||
if (className == null)
|
||||
{
|
||||
throw new InvalidDataException("className is a required property for Animal and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassName = className;
|
||||
}
|
||||
|
||||
this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null");;
|
||||
// use default value if no "color" provided
|
||||
if (color == null)
|
||||
{
|
||||
this.Color = "red";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Color = color;
|
||||
}
|
||||
this.Color = color ?? "red";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -45,15 +45,7 @@ namespace Org.OpenAPITools.Model
|
||||
public Category(long id = default(long), string name = "default-name")
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new InvalidDataException("name is a required property for Category and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null");;
|
||||
this.Id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,46 +56,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="bigDecimal">bigDecimal.</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), decimal bigDecimal = default(decimal))
|
||||
{
|
||||
// to ensure "number" is required (not null)
|
||||
if (number == null)
|
||||
{
|
||||
throw new InvalidDataException("number is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Number = number;
|
||||
}
|
||||
|
||||
this.Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
if (_byte == null)
|
||||
{
|
||||
throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Byte = _byte;
|
||||
}
|
||||
|
||||
// to ensure "date" is required (not null)
|
||||
if (date == null)
|
||||
{
|
||||
throw new InvalidDataException("date is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Date = date;
|
||||
}
|
||||
|
||||
this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null");;
|
||||
this.Date = date;
|
||||
// to ensure "password" is required (not null)
|
||||
if (password == null)
|
||||
{
|
||||
throw new InvalidDataException("password is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Password = password;
|
||||
}
|
||||
|
||||
this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null");;
|
||||
this.Integer = integer;
|
||||
this.Int32 = int32;
|
||||
this.Int64 = int64;
|
||||
|
||||
@@ -44,16 +44,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="property">property.</param>
|
||||
public Name(int name = default(int), string property = default(string))
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new InvalidDataException("name is a required property for Name and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Name = name;
|
||||
}
|
||||
|
||||
this._Name = name;
|
||||
this.Property = property;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,15 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.Quantity = quantity;
|
||||
this.ShipDate = shipDate;
|
||||
this.Status = status;
|
||||
// use default value if no "complete" provided
|
||||
if (complete == null)
|
||||
{
|
||||
this.Complete = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Complete = complete;
|
||||
}
|
||||
this.Complete = complete;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -82,25 +82,9 @@ namespace Org.OpenAPITools.Model
|
||||
public Pet(long id = default(long), Category category = default(Category), string name = default(string), List<string> photoUrls = default(List<string>), List<Tag> tags = default(List<Tag>), StatusEnum? status = default(StatusEnum?))
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new InvalidDataException("name is a required property for Pet and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null");;
|
||||
// to ensure "photoUrls" is required (not null)
|
||||
if (photoUrls == null)
|
||||
{
|
||||
throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PhotoUrls = photoUrls;
|
||||
}
|
||||
|
||||
this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null");;
|
||||
this.Id = id;
|
||||
this.Category = category;
|
||||
this.Tags = tags;
|
||||
|
||||
@@ -48,55 +48,12 @@ namespace Org.OpenAPITools.Model
|
||||
public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List<int> arrayItem = default(List<int>))
|
||||
{
|
||||
// to ensure "stringItem" is required (not null)
|
||||
if (stringItem == null)
|
||||
{
|
||||
throw new InvalidDataException("stringItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.StringItem = stringItem;
|
||||
}
|
||||
|
||||
// to ensure "numberItem" is required (not null)
|
||||
if (numberItem == null)
|
||||
{
|
||||
throw new InvalidDataException("numberItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NumberItem = numberItem;
|
||||
}
|
||||
|
||||
// to ensure "integerItem" is required (not null)
|
||||
if (integerItem == null)
|
||||
{
|
||||
throw new InvalidDataException("integerItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IntegerItem = integerItem;
|
||||
}
|
||||
|
||||
// to ensure "boolItem" is required (not null)
|
||||
if (boolItem == null)
|
||||
{
|
||||
throw new InvalidDataException("boolItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BoolItem = boolItem;
|
||||
}
|
||||
|
||||
this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderDefault and cannot be null");;
|
||||
this.NumberItem = numberItem;
|
||||
this.IntegerItem = integerItem;
|
||||
this.BoolItem = boolItem;
|
||||
// to ensure "arrayItem" is required (not null)
|
||||
if (arrayItem == null)
|
||||
{
|
||||
throw new InvalidDataException("arrayItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ArrayItem = arrayItem;
|
||||
}
|
||||
|
||||
this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderDefault and cannot be null");;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -49,65 +49,13 @@ namespace Org.OpenAPITools.Model
|
||||
public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), float floatItem = default(float), int integerItem = default(int), bool boolItem = default(bool), List<int> arrayItem = default(List<int>))
|
||||
{
|
||||
// to ensure "stringItem" is required (not null)
|
||||
if (stringItem == null)
|
||||
{
|
||||
throw new InvalidDataException("stringItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.StringItem = stringItem;
|
||||
}
|
||||
|
||||
// to ensure "numberItem" is required (not null)
|
||||
if (numberItem == null)
|
||||
{
|
||||
throw new InvalidDataException("numberItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NumberItem = numberItem;
|
||||
}
|
||||
|
||||
// to ensure "floatItem" is required (not null)
|
||||
if (floatItem == null)
|
||||
{
|
||||
throw new InvalidDataException("floatItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.FloatItem = floatItem;
|
||||
}
|
||||
|
||||
// to ensure "integerItem" is required (not null)
|
||||
if (integerItem == null)
|
||||
{
|
||||
throw new InvalidDataException("integerItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IntegerItem = integerItem;
|
||||
}
|
||||
|
||||
// to ensure "boolItem" is required (not null)
|
||||
if (boolItem == null)
|
||||
{
|
||||
throw new InvalidDataException("boolItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BoolItem = boolItem;
|
||||
}
|
||||
|
||||
this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderExample and cannot be null");;
|
||||
this.NumberItem = numberItem;
|
||||
this.FloatItem = floatItem;
|
||||
this.IntegerItem = integerItem;
|
||||
this.BoolItem = boolItem;
|
||||
// to ensure "arrayItem" is required (not null)
|
||||
if (arrayItem == null)
|
||||
{
|
||||
throw new InvalidDataException("arrayItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ArrayItem = arrayItem;
|
||||
}
|
||||
|
||||
this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderExample and cannot be null");;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,20 +11,20 @@
|
||||
<AssemblyTitle>OpenAPI Library</AssemblyTitle>
|
||||
<Description>A library generated from a OpenAPI doc</Description>
|
||||
<Copyright>No Copyright</Copyright>
|
||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<RootNamespace>Org.OpenAPITools</RootNamespace>
|
||||
<Version>1.0.0</Version>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml</DocumentationFile>
|
||||
<RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>Minor update</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="RestSharp" Version="106.10.1" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -14,7 +14,7 @@ This C# SDK is automatically generated by the [OpenAPI Generator](https://openap
|
||||
<a name="dependencies"></a>
|
||||
## Dependencies
|
||||
|
||||
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.6.7 or later
|
||||
- [RestSharp](https://www.nuget.org/packages/RestSharp) - 106.10.1 or later
|
||||
- [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 12.0.1 or later
|
||||
- [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.5.2 or later
|
||||
- [CompareNETObjects](https://www.nuget.org/packages/CompareNETObjects) - 4.57.0 or later
|
||||
|
||||
@@ -24,13 +24,8 @@ OpenAPI spec version: 1.0.0
|
||||
<EmbeddedResource Include="linux-logo.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1567,13 +1567,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (query != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query));
|
||||
}
|
||||
localVarRequestOptions.Data = body;
|
||||
|
||||
@@ -1639,13 +1633,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (query != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "query", query));
|
||||
}
|
||||
localVarRequestOptions.Data = body;
|
||||
|
||||
@@ -1823,14 +1811,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> TestEndpointParametersWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string))
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||
if (patternWithoutDelimiter == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters");
|
||||
@@ -1867,18 +1847,12 @@ namespace Org.OpenAPITools.Api
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter
|
||||
}
|
||||
if (number != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
if (_float != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter
|
||||
}
|
||||
if (_double != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
if (_string != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter
|
||||
@@ -1977,14 +1951,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal number, double _double, string patternWithoutDelimiter, byte[] _byte, int? integer = default(int?), int? int32 = default(int?), long? int64 = default(long?), float? _float = default(float?), string _string = default(string), System.IO.Stream binary = default(System.IO.Stream), DateTime? date = default(DateTime?), DateTime? dateTime = default(DateTime?), string password = default(string), string callback = default(string))
|
||||
{
|
||||
// verify the required parameter 'number' is set
|
||||
if (number == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'number' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter '_double' is set
|
||||
if (_double == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter '_double' when calling FakeApi->TestEndpointParameters");
|
||||
|
||||
// verify the required parameter 'patternWithoutDelimiter' is set
|
||||
if (patternWithoutDelimiter == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'patternWithoutDelimiter' when calling FakeApi->TestEndpointParameters");
|
||||
@@ -2022,18 +1988,12 @@ namespace Org.OpenAPITools.Api
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("int64", Org.OpenAPITools.Client.ClientUtils.ParameterToString(int64)); // form parameter
|
||||
}
|
||||
if (number != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("number", Org.OpenAPITools.Client.ClientUtils.ParameterToString(number)); // form parameter
|
||||
if (_float != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("float", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_float)); // form parameter
|
||||
}
|
||||
if (_double != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
}
|
||||
localVarRequestOptions.FormParameters.Add("double", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_double)); // form parameter
|
||||
if (_string != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("string", Org.OpenAPITools.Client.ClientUtils.ParameterToString(_string)); // form parameter
|
||||
@@ -2138,43 +2098,19 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (enumQueryStringArray != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray));
|
||||
}
|
||||
if (enumQueryString != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString));
|
||||
}
|
||||
if (enumQueryInteger != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger));
|
||||
}
|
||||
if (enumQueryDouble != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble));
|
||||
}
|
||||
if (enumHeaderStringArray != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter
|
||||
@@ -2255,43 +2191,19 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (enumQueryStringArray != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "enum_query_string_array", enumQueryStringArray));
|
||||
}
|
||||
if (enumQueryString != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_string", enumQueryString));
|
||||
}
|
||||
if (enumQueryInteger != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_integer", enumQueryInteger));
|
||||
}
|
||||
if (enumQueryDouble != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "enum_query_double", enumQueryDouble));
|
||||
}
|
||||
if (enumHeaderStringArray != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("enum_header_string_array", Org.OpenAPITools.Client.ClientUtils.ParameterToString(enumHeaderStringArray)); // header parameter
|
||||
@@ -2349,18 +2261,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> TestGroupParametersWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?))
|
||||
{
|
||||
// verify the required parameter 'requiredStringGroup' is set
|
||||
if (requiredStringGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredBooleanGroup' is set
|
||||
if (requiredBooleanGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredInt64Group' is set
|
||||
if (requiredInt64Group == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -2376,48 +2276,17 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (requiredStringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requiredInt64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup));
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group));
|
||||
if (stringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup));
|
||||
}
|
||||
if (int64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group));
|
||||
}
|
||||
if (requiredBooleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
if (booleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter
|
||||
|
||||
@@ -2464,18 +2333,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> TestGroupParametersAsyncWithHttpInfo (int requiredStringGroup, bool requiredBooleanGroup, long requiredInt64Group, int? stringGroup = default(int?), bool? booleanGroup = default(bool?), long? int64Group = default(long?))
|
||||
{
|
||||
// verify the required parameter 'requiredStringGroup' is set
|
||||
if (requiredStringGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredStringGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredBooleanGroup' is set
|
||||
if (requiredBooleanGroup == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredBooleanGroup' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
// verify the required parameter 'requiredInt64Group' is set
|
||||
if (requiredInt64Group == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredInt64Group' when calling FakeApi->TestGroupParameters");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -2492,48 +2349,17 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (requiredStringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (requiredInt64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_string_group", requiredStringGroup));
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "required_int64_group", requiredInt64Group));
|
||||
if (stringGroup != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "string_group", stringGroup));
|
||||
}
|
||||
if (int64Group != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "int64_group", int64Group));
|
||||
}
|
||||
if (requiredBooleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
localVarRequestOptions.HeaderParameters.Add("required_boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(requiredBooleanGroup)); // header parameter
|
||||
if (booleanGroup != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("boolean_group", Org.OpenAPITools.Client.ClientUtils.ParameterToString(booleanGroup)); // header parameter
|
||||
|
||||
@@ -2863,53 +2689,23 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (pipe != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
|
||||
}
|
||||
if (ioutil != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
|
||||
}
|
||||
if (http != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
|
||||
}
|
||||
if (url != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
|
||||
}
|
||||
if (context != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));
|
||||
}
|
||||
|
||||
|
||||
@@ -2991,53 +2787,23 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (pipe != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "pipe", pipe));
|
||||
}
|
||||
if (ioutil != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "ioutil", ioutil));
|
||||
}
|
||||
if (http != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("space", "http", http));
|
||||
}
|
||||
if (url != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "url", url));
|
||||
}
|
||||
if (context != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("multi", "context", context));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -244,13 +244,7 @@ namespace Org.OpenAPITools.Api
|
||||
// authentication (api_key_query) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")));
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
@@ -313,13 +307,7 @@ namespace Org.OpenAPITools.Api
|
||||
// authentication (api_key_query) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "api_key_query", this.Configuration.GetApiKeyWithPrefix("api_key_query")));
|
||||
}
|
||||
|
||||
// make the HTTP request
|
||||
|
||||
@@ -708,10 +708,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> DeletePetWithHttpInfo (long petId, string apiKey = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -727,8 +723,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (apiKey != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter
|
||||
|
||||
@@ -773,10 +768,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> DeletePetAsyncWithHttpInfo (long petId, string apiKey = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->DeletePet");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -793,8 +784,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (apiKey != null)
|
||||
localVarRequestOptions.HeaderParameters.Add("api_key", Org.OpenAPITools.Client.ClientUtils.ParameterToString(apiKey)); // header parameter
|
||||
|
||||
@@ -861,13 +851,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -934,13 +918,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (status != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "status", status));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -1006,13 +984,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (tags != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -1079,13 +1051,7 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (tags != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("csv", "tags", tags));
|
||||
}
|
||||
|
||||
// authentication (petstore_auth) required
|
||||
@@ -1128,10 +1094,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Pet</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< Pet > GetPetByIdWithHttpInfo (long petId)
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -1149,8 +1111,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
@@ -1191,10 +1152,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (Pet)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Pet>> GetPetByIdAsyncWithHttpInfo (long petId)
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->GetPetById");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -1213,8 +1170,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
|
||||
// authentication (api_key) required
|
||||
if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("api_key")))
|
||||
@@ -1383,10 +1339,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Object(void)</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse<Object> UpdatePetWithFormWithHttpInfo (long petId, string name = default(string), string status = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -1403,8 +1355,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (name != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter
|
||||
@@ -1457,10 +1408,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Object>> UpdatePetWithFormAsyncWithHttpInfo (long petId, string name = default(string), string status = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -1478,8 +1425,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (name != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("name", Org.OpenAPITools.Client.ClientUtils.ParameterToString(name)); // form parameter
|
||||
@@ -1533,10 +1479,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of ApiResponse</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -1554,8 +1496,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
@@ -1609,10 +1550,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (ApiResponse)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ApiResponse>> UploadFileAsyncWithHttpInfo (long petId, string additionalMetadata = default(string), System.IO.Stream file = default(System.IO.Stream))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFile");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -1631,8 +1568,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
@@ -1686,10 +1622,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of ApiResponse</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< ApiResponse > UploadFileWithRequiredFileWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile");
|
||||
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile");
|
||||
@@ -1711,8 +1643,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
@@ -1766,10 +1697,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (ApiResponse)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<ApiResponse>> UploadFileWithRequiredFileAsyncWithHttpInfo (long petId, System.IO.Stream requiredFile, string additionalMetadata = default(string))
|
||||
{
|
||||
// verify the required parameter 'petId' is set
|
||||
if (petId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'petId' when calling PetApi->UploadFileWithRequiredFile");
|
||||
|
||||
// verify the required parameter 'requiredFile' is set
|
||||
if (requiredFile == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'requiredFile' when calling PetApi->UploadFileWithRequiredFile");
|
||||
@@ -1792,8 +1719,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (petId != null)
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("petId", Org.OpenAPITools.Client.ClientUtils.ParameterToString(petId)); // path parameter
|
||||
if (additionalMetadata != null)
|
||||
{
|
||||
localVarRequestOptions.FormParameters.Add("additionalMetadata", Org.OpenAPITools.Client.ClientUtils.ParameterToString(additionalMetadata)); // form parameter
|
||||
|
||||
@@ -560,10 +560,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>ApiResponse of Order</returns>
|
||||
public Org.OpenAPITools.Client.ApiResponse< Order > GetOrderByIdWithHttpInfo (long orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
String[] _contentTypes = new String[] {
|
||||
@@ -581,8 +577,7 @@ namespace Org.OpenAPITools.Api
|
||||
var localVarAccept = Org.OpenAPITools.Client.ClientUtils.SelectHeaderAccept(_accepts);
|
||||
if (localVarAccept != null) localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
|
||||
|
||||
if (orderId != null)
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
@@ -618,10 +613,6 @@ namespace Org.OpenAPITools.Api
|
||||
/// <returns>Task of ApiResponse (Order)</returns>
|
||||
public async System.Threading.Tasks.Task<Org.OpenAPITools.Client.ApiResponse<Order>> GetOrderByIdAsyncWithHttpInfo (long orderId)
|
||||
{
|
||||
// verify the required parameter 'orderId' is set
|
||||
if (orderId == null)
|
||||
throw new Org.OpenAPITools.Client.ApiException(400, "Missing required parameter 'orderId' when calling StoreApi->GetOrderById");
|
||||
|
||||
|
||||
Org.OpenAPITools.Client.RequestOptions localVarRequestOptions = new Org.OpenAPITools.Client.RequestOptions();
|
||||
|
||||
@@ -640,8 +631,7 @@ namespace Org.OpenAPITools.Api
|
||||
foreach (var _accept in _accepts)
|
||||
localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
|
||||
|
||||
if (orderId != null)
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
localVarRequestOptions.PathParameters.Add("order_id", Org.OpenAPITools.Client.ClientUtils.ParameterToString(orderId)); // path parameter
|
||||
|
||||
|
||||
// make the HTTP request
|
||||
|
||||
@@ -1100,23 +1100,11 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (username != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username));
|
||||
}
|
||||
if (password != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password));
|
||||
}
|
||||
|
||||
|
||||
@@ -1183,23 +1171,11 @@ namespace Org.OpenAPITools.Api
|
||||
|
||||
if (username != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "username", username));
|
||||
}
|
||||
if (password != null)
|
||||
{
|
||||
foreach (var _kvp in Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password))
|
||||
{
|
||||
foreach (var _kvpValue in _kvp.Value)
|
||||
{
|
||||
localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
|
||||
}
|
||||
}
|
||||
localVarRequestOptions.QueryParameters.Add(Org.OpenAPITools.Client.ClientUtils.ParameterToMultiMap("", "password", password));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -37,37 +37,34 @@ namespace Org.OpenAPITools.Client
|
||||
internal class CustomJsonCodec : RestSharp.Serializers.ISerializer, RestSharp.Deserializers.IDeserializer
|
||||
{
|
||||
private readonly IReadableConfiguration _configuration;
|
||||
private readonly JsonSerializer _serializer;
|
||||
private string _contentType = "application/json";
|
||||
private static readonly string _contentType = "application/json";
|
||||
private readonly JsonSerializerSettings _serializerSettings = new JsonSerializerSettings
|
||||
{
|
||||
// OpenAPI generated types generally hide default constructors.
|
||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor,
|
||||
ContractResolver = new DefaultContractResolver
|
||||
ContractResolver = new DefaultContractResolver
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy
|
||||
{
|
||||
NamingStrategy = new CamelCaseNamingStrategy()
|
||||
{
|
||||
OverrideSpecifiedNames = true
|
||||
}
|
||||
OverrideSpecifiedNames = true
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public CustomJsonCodec(IReadableConfiguration configuration)
|
||||
{
|
||||
_configuration = configuration;
|
||||
_serializer = JsonSerializer.Create(_serializerSettings);
|
||||
}
|
||||
|
||||
public CustomJsonCodec(JsonSerializerSettings serializerSettings, IReadableConfiguration configuration)
|
||||
{
|
||||
_serializerSettings = serializerSettings;
|
||||
_serializer = JsonSerializer.Create(_serializerSettings);
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public string Serialize(object obj)
|
||||
{
|
||||
String result = JsonConvert.SerializeObject(obj, _serializerSettings);
|
||||
var result = JsonConvert.SerializeObject(obj, _serializerSettings);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -182,7 +179,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <exception cref="ArgumentException"></exception>
|
||||
public ApiClient(String basePath)
|
||||
{
|
||||
if (String.IsNullOrEmpty(basePath))
|
||||
if (string.IsNullOrEmpty(basePath))
|
||||
throw new ArgumentException("basePath cannot be empty");
|
||||
|
||||
_baseUrl = basePath;
|
||||
@@ -239,7 +236,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>[private] A new RestRequest instance.</returns>
|
||||
/// <exception cref="ArgumentNullException"></exception>
|
||||
private RestRequest newRequest(
|
||||
private RestRequest NewRequest(
|
||||
HttpMethod method,
|
||||
String path,
|
||||
RequestOptions options,
|
||||
@@ -348,7 +345,7 @@ namespace Org.OpenAPITools.Client
|
||||
return request;
|
||||
}
|
||||
|
||||
private ApiResponse<T> toApiResponse<T>(IRestResponse<T> response)
|
||||
private ApiResponse<T> ToApiResponse<T>(IRestResponse<T> response)
|
||||
{
|
||||
T result = response.Data;
|
||||
string rawContent = response.Content;
|
||||
@@ -384,7 +381,7 @@ namespace Org.OpenAPITools.Client
|
||||
return transformed;
|
||||
}
|
||||
|
||||
private async Task<ApiResponse<T>> Exec<T>(RestRequest req, IReadableConfiguration configuration)
|
||||
private ApiResponse<T> Exec<T>(RestRequest req, IReadableConfiguration configuration)
|
||||
{
|
||||
RestClient client = new RestClient(_baseUrl);
|
||||
|
||||
@@ -392,15 +389,14 @@ namespace Org.OpenAPITools.Client
|
||||
var existingDeserializer = req.JsonSerializer as IDeserializer;
|
||||
if (existingDeserializer != null)
|
||||
{
|
||||
client.AddHandler(existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
else
|
||||
{
|
||||
var codec = new CustomJsonCodec(configuration);
|
||||
client.AddHandler(codec, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
|
||||
client.AddHandler(new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
|
||||
client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
|
||||
|
||||
client.Timeout = configuration.Timeout;
|
||||
|
||||
@@ -410,10 +406,12 @@ namespace Org.OpenAPITools.Client
|
||||
}
|
||||
|
||||
InterceptRequest(req);
|
||||
var response = await client.ExecuteTaskAsync<T>(req);
|
||||
|
||||
var response = client.Execute<T>(req);
|
||||
|
||||
InterceptResponse(req, response);
|
||||
|
||||
var result = toApiResponse(response);
|
||||
var result = ToApiResponse(response);
|
||||
if (response.ErrorMessage != null)
|
||||
{
|
||||
result.ErrorText = response.ErrorMessage;
|
||||
@@ -441,13 +439,78 @@ namespace Org.OpenAPITools.Client
|
||||
Secure = restResponseCookie.Secure,
|
||||
Version = restResponseCookie.Version
|
||||
};
|
||||
|
||||
|
||||
result.Cookies.Add(cookie);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private async Task<ApiResponse<T>> ExecAsync<T>(RestRequest req, IReadableConfiguration configuration)
|
||||
{
|
||||
RestClient client = new RestClient(_baseUrl);
|
||||
|
||||
client.ClearHandlers();
|
||||
var existingDeserializer = req.JsonSerializer as IDeserializer;
|
||||
if (existingDeserializer != null)
|
||||
{
|
||||
client.AddHandler(() => existingDeserializer, "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
else
|
||||
{
|
||||
client.AddHandler(() => new CustomJsonCodec(configuration), "application/json", "text/json", "text/x-json", "text/javascript", "*+json");
|
||||
}
|
||||
|
||||
client.AddHandler(() => new XmlDeserializer(), "application/xml", "text/xml", "*+xml", "*");
|
||||
|
||||
client.Timeout = configuration.Timeout;
|
||||
|
||||
if (configuration.UserAgent != null)
|
||||
{
|
||||
client.UserAgent = configuration.UserAgent;
|
||||
}
|
||||
|
||||
InterceptRequest(req);
|
||||
|
||||
var response = await client.ExecuteAsync<T>(req);
|
||||
|
||||
InterceptResponse(req, response);
|
||||
|
||||
var result = ToApiResponse(response);
|
||||
if (response.ErrorMessage != null)
|
||||
{
|
||||
result.ErrorText = response.ErrorMessage;
|
||||
}
|
||||
|
||||
if (response.Cookies != null && response.Cookies.Count > 0)
|
||||
{
|
||||
if(result.Cookies == null) result.Cookies = new List<Cookie>();
|
||||
foreach (var restResponseCookie in response.Cookies)
|
||||
{
|
||||
var cookie = new Cookie(
|
||||
restResponseCookie.Name,
|
||||
restResponseCookie.Value,
|
||||
restResponseCookie.Path,
|
||||
restResponseCookie.Domain
|
||||
)
|
||||
{
|
||||
Comment = restResponseCookie.Comment,
|
||||
CommentUri = restResponseCookie.CommentUri,
|
||||
Discard = restResponseCookie.Discard,
|
||||
Expired = restResponseCookie.Expired,
|
||||
Expires = restResponseCookie.Expires,
|
||||
HttpOnly = restResponseCookie.HttpOnly,
|
||||
Port = restResponseCookie.Port,
|
||||
Secure = restResponseCookie.Secure,
|
||||
Version = restResponseCookie.Version
|
||||
};
|
||||
|
||||
result.Cookies.Add(cookie);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
#region IAsynchronousClient
|
||||
/// <summary>
|
||||
/// Make a HTTP GET request (async).
|
||||
@@ -457,10 +520,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> GetAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Get, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Get, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -471,10 +534,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> PostAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Post, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Post, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -485,10 +548,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> PutAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Put, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Put, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -499,10 +562,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> DeleteAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Delete, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Delete, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -513,10 +576,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> HeadAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Head, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Head, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -527,10 +590,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> OptionsAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Options, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Options, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -541,10 +604,10 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="configuration">A per-request configuration object. It is assumed that any merge with
|
||||
/// GlobalConfiguration has been done before calling this method.</param>
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public async Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
public Task<ApiResponse<T>> PatchAsync<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return await Exec<T>(newRequest(HttpMethod.Patch, path, options, config), config);
|
||||
return ExecAsync<T>(NewRequest(HttpMethod.Patch, path, options, config), config);
|
||||
}
|
||||
#endregion IAsynchronousClient
|
||||
|
||||
@@ -559,7 +622,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Get<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return GetAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Get, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -572,7 +636,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Post<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return PostAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Post, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -585,7 +650,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Put<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return PutAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Put, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -598,7 +664,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Delete<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return DeleteAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Delete, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -611,7 +678,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Head<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return HeadAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Head, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -624,7 +692,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Options<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return OptionsAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Options, path, options, config), config);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -637,7 +706,8 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>A Task containing ApiResponse</returns>
|
||||
public ApiResponse<T> Patch<T>(string path, RequestOptions options, IReadableConfiguration configuration = null)
|
||||
{
|
||||
return PatchAsync<T>(path, options, configuration).Result;
|
||||
var config = configuration ?? GlobalConfiguration.Instance;
|
||||
return Exec<T>(NewRequest(HttpMethod.Patch, path, options, config), config);
|
||||
}
|
||||
#endregion ISynchronousClient
|
||||
}
|
||||
|
||||
@@ -11,13 +11,10 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using KellermanSoftware.CompareNetObjects;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
@@ -63,15 +60,11 @@ namespace Org.OpenAPITools.Client
|
||||
{
|
||||
var parameters = new Multimap<string, string>();
|
||||
|
||||
if (IsCollection(value) && collectionFormat == "multi")
|
||||
if (value is ICollection collection && collectionFormat == "multi")
|
||||
{
|
||||
var valueCollection = value as IEnumerable;
|
||||
if (valueCollection != null)
|
||||
foreach (var item in collection)
|
||||
{
|
||||
foreach (var item in valueCollection)
|
||||
{
|
||||
parameters.Add(name, ParameterToString(item));
|
||||
}
|
||||
parameters.Add(name, ParameterToString(item));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -92,47 +85,26 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Formatted string.</returns>
|
||||
public static string ParameterToString(object obj, IReadableConfiguration configuration = null)
|
||||
{
|
||||
if (obj is DateTime)
|
||||
if (obj is DateTime dateTime)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return ((DateTime)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
else if (obj is DateTimeOffset)
|
||||
return dateTime.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
if (obj is DateTimeOffset dateTimeOffset)
|
||||
// Return a formatted date string - Can be customized with Configuration.DateTimeFormat
|
||||
// Defaults to an ISO 8601, using the known as a Round-trip date/time pattern ("o")
|
||||
// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx#Anchor_8
|
||||
// For example: 2009-06-15T13:45:30.0000000
|
||||
return ((DateTimeOffset)obj).ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
else
|
||||
{
|
||||
if (obj is IList)
|
||||
{
|
||||
var list = obj as IList;
|
||||
var flattenedString = new StringBuilder();
|
||||
foreach (var param in list)
|
||||
{
|
||||
if (flattenedString.Length > 0)
|
||||
flattenedString.Append(",");
|
||||
flattenedString.Append(param);
|
||||
}
|
||||
return flattenedString.ToString();
|
||||
}
|
||||
|
||||
return Convert.ToString (obj);
|
||||
}
|
||||
return dateTimeOffset.ToString((configuration ?? GlobalConfiguration.Instance).DateTimeFormat);
|
||||
if (obj is bool boolean)
|
||||
return boolean ? "true" : "false";
|
||||
if (obj is ICollection collection)
|
||||
return string.Join(",", collection.Cast<object>());
|
||||
|
||||
return Convert.ToString(obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if generic object is a collection.
|
||||
/// </summary>
|
||||
/// <param name="value"></param>
|
||||
/// <returns>True if object is a collection type</returns>
|
||||
private static bool IsCollection(object value)
|
||||
{
|
||||
return value is IList || value is ICollection;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// URL encode a string
|
||||
/// Credit/Ref: https://github.com/restsharp/RestSharp/blob/master/RestSharp/Extensions/StringExtensions.cs#L50
|
||||
@@ -175,7 +147,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Encoded string.</returns>
|
||||
public static string Base64Encode(string text)
|
||||
{
|
||||
return System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text));
|
||||
return Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(text));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -185,14 +157,9 @@ namespace Org.OpenAPITools.Client
|
||||
/// <returns>Byte array</returns>
|
||||
public static byte[] ReadAsBytes(Stream inputStream)
|
||||
{
|
||||
byte[] buf = new byte[16*1024];
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
using (var ms = new MemoryStream())
|
||||
{
|
||||
int count;
|
||||
while ((count = inputStream.Read(buf, 0, buf.Length)) > 0)
|
||||
{
|
||||
ms.Write(buf, 0, count);
|
||||
}
|
||||
inputStream.CopyTo(ms);
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Org.OpenAPITools.Client
|
||||
@@ -19,14 +18,13 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// A dictionary in which one key has many associated values.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of the key</typeparam>
|
||||
/// <typeparam name="TKey">The type of the key</typeparam>
|
||||
/// <typeparam name="TValue">The type of the value associated with the key.</typeparam>
|
||||
public class Multimap<T, TValue> : IDictionary<T, IList<TValue>>
|
||||
public class Multimap<TKey, TValue> : IDictionary<TKey, IList<TValue>>
|
||||
{
|
||||
#region Private Fields
|
||||
|
||||
private readonly ConcurrentDictionary<T, IList<TValue>> _dictionary =
|
||||
new ConcurrentDictionary<T, IList<TValue>>();
|
||||
private readonly Dictionary<TKey, IList<TValue>> _dictionary;
|
||||
|
||||
#endregion Private Fields
|
||||
|
||||
@@ -37,15 +35,16 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
public Multimap()
|
||||
{
|
||||
_dictionary = new ConcurrentDictionary<T, IList<TValue>>();
|
||||
_dictionary = new Dictionary<TKey, IList<TValue>>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor with comparer.
|
||||
/// </summary>
|
||||
/// <param name="comparer"></param>
|
||||
public Multimap(IEqualityComparer<T> comparer) {
|
||||
_dictionary = new ConcurrentDictionary<T, IList<TValue>>(comparer);
|
||||
public Multimap(IEqualityComparer<TKey> comparer)
|
||||
{
|
||||
_dictionary = new Dictionary<TKey, IList<TValue>>(comparer);
|
||||
}
|
||||
|
||||
#endregion Constructors
|
||||
@@ -56,7 +55,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// To get the enumerator.
|
||||
/// </summary>
|
||||
/// <returns>Enumerator</returns>
|
||||
public IEnumerator<KeyValuePair<T, IList<TValue>>> GetEnumerator()
|
||||
public IEnumerator<KeyValuePair<TKey, IList<TValue>>> GetEnumerator()
|
||||
{
|
||||
return _dictionary.GetEnumerator();
|
||||
}
|
||||
@@ -77,12 +76,25 @@ namespace Org.OpenAPITools.Client
|
||||
/// Add values to Multimap
|
||||
/// </summary>
|
||||
/// <param name="item">Key value pair</param>
|
||||
public void Add(KeyValuePair<T, IList<TValue>> item)
|
||||
public void Add(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
if (!TryAdd(item.Key, item.Value))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Add Multimap to Multimap
|
||||
/// </summary>
|
||||
/// <param name="multimap">Multimap</param>
|
||||
public void Add(Multimap<TKey, TValue> multimap)
|
||||
{
|
||||
foreach (var item in multimap)
|
||||
{
|
||||
if (!TryAdd(item.Key, item.Value))
|
||||
throw new InvalidOperationException("Could not add values to Multimap.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clear Multimap
|
||||
/// </summary>
|
||||
@@ -97,7 +109,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="item">Key value pair</param>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
/// <returns>true if the Multimap contains the item; otherwise, false.</returns>
|
||||
public bool Contains(KeyValuePair<T, IList<TValue>> item)
|
||||
public bool Contains(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -110,7 +122,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// from Multimap. The array must have zero-based indexing.</param>
|
||||
/// <param name="arrayIndex">The zero-based index in array at which copying begins.</param>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
public void CopyTo(KeyValuePair<T, IList<TValue>>[] array, int arrayIndex)
|
||||
public void CopyTo(KeyValuePair<TKey, IList<TValue>>[] array, int arrayIndex)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -121,7 +133,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="item">Key value pair</param>
|
||||
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||
/// <exception cref="NotImplementedException">Method needs to be implemented</exception>
|
||||
public bool Remove(KeyValuePair<T, IList<TValue>> item)
|
||||
public bool Remove(KeyValuePair<TKey, IList<TValue>> item)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
@@ -129,24 +141,12 @@ namespace Org.OpenAPITools.Client
|
||||
/// <summary>
|
||||
/// Gets the number of items contained in the Multimap.
|
||||
/// </summary>
|
||||
public int Count
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary.Count;
|
||||
}
|
||||
}
|
||||
public int Count => _dictionary.Count;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Multimap is read-only.
|
||||
/// </summary>
|
||||
public bool IsReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public bool IsReadOnly => false;
|
||||
|
||||
/// <summary>
|
||||
/// Adds an item with the provided key and value to the Multimap.
|
||||
@@ -154,12 +154,11 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||
/// <exception cref="InvalidOperationException">Thrown when couldn't add the value to Multimap.</exception>
|
||||
public void Add(T key, IList<TValue> value)
|
||||
public void Add(TKey key, IList<TValue> value)
|
||||
{
|
||||
if (value != null && value.Count > 0)
|
||||
{
|
||||
IList<TValue> list;
|
||||
if (_dictionary.TryGetValue(key, out list))
|
||||
if (_dictionary.TryGetValue(key, out var list))
|
||||
{
|
||||
foreach (var k in value) list.Add(k);
|
||||
}
|
||||
@@ -178,7 +177,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="key">The key to locate in the Multimap.</param>
|
||||
/// <returns>true if the Multimap contains an item with
|
||||
/// the key; otherwise, false.</returns>
|
||||
public bool ContainsKey(T key)
|
||||
public bool ContainsKey(TKey key)
|
||||
{
|
||||
return _dictionary.ContainsKey(key);
|
||||
}
|
||||
@@ -188,10 +187,9 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="key">The key to locate in the Multimap.</param>
|
||||
/// <returns>true if the item is successfully removed; otherwise, false.</returns>
|
||||
public bool Remove(T key)
|
||||
public bool Remove(TKey key)
|
||||
{
|
||||
IList<TValue> list;
|
||||
return TryRemove(key, out list);
|
||||
return TryRemove(key, out var _);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -203,7 +201,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// This parameter is passed uninitialized.</param>
|
||||
/// <returns> true if the object that implements Multimap contains
|
||||
/// an item with the specified key; otherwise, false.</returns>
|
||||
public bool TryGetValue(T key, out IList<TValue> value)
|
||||
public bool TryGetValue(TKey key, out IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryGetValue(key, out value);
|
||||
}
|
||||
@@ -213,36 +211,21 @@ namespace Org.OpenAPITools.Client
|
||||
/// </summary>
|
||||
/// <param name="key">The key of the item to get or set.</param>
|
||||
/// <returns>The value of the specified key.</returns>
|
||||
public IList<TValue> this[T key]
|
||||
public IList<TValue> this[TKey key]
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary[key];
|
||||
}
|
||||
set { _dictionary[key] = value; }
|
||||
get => _dictionary[key];
|
||||
set => _dictionary[key] = value;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Collections.Generic.ICollection containing the keys of the Multimap.
|
||||
/// </summary>
|
||||
public ICollection<T> Keys
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary.Keys;
|
||||
}
|
||||
}
|
||||
public ICollection<TKey> Keys => _dictionary.Keys;
|
||||
|
||||
/// <summary>
|
||||
/// Gets a System.Collections.Generic.ICollection containing the values of the Multimap.
|
||||
/// </summary>
|
||||
public ICollection<IList<TValue>> Values
|
||||
{
|
||||
get
|
||||
{
|
||||
return _dictionary.Values;
|
||||
}
|
||||
}
|
||||
public ICollection<IList<TValue>> Values => _dictionary.Values;
|
||||
|
||||
/// <summary>
|
||||
/// Copy the items of the Multimap to an System.Array,
|
||||
@@ -253,7 +236,7 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="index">The zero-based index in array at which copying begins.</param>
|
||||
public void CopyTo(Array array, int index)
|
||||
{
|
||||
((ICollection) _dictionary).CopyTo(array, index);
|
||||
((ICollection)_dictionary).CopyTo(array, index);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -262,19 +245,17 @@ namespace Org.OpenAPITools.Client
|
||||
/// <param name="key">The object to use as the key of the item to add.</param>
|
||||
/// <param name="value">The object to use as the value of the item to add.</param>
|
||||
/// <exception cref="InvalidOperationException">Thrown when couldn't add value to Multimap.</exception>
|
||||
public void Add(T key, TValue value)
|
||||
public void Add(TKey key, TValue value)
|
||||
{
|
||||
if (value != null)
|
||||
{
|
||||
IList<TValue> list;
|
||||
if (_dictionary.TryGetValue(key, out list))
|
||||
if (_dictionary.TryGetValue(key, out var list))
|
||||
{
|
||||
list.Add(value);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = new List<TValue>();
|
||||
list.Add(value);
|
||||
list = new List<TValue> { value };
|
||||
if (!TryAdd(key, list))
|
||||
throw new InvalidOperationException("Could not add value to Multimap.");
|
||||
}
|
||||
@@ -288,18 +269,27 @@ namespace Org.OpenAPITools.Client
|
||||
/**
|
||||
* Helper method to encapsulate generator differences between dictionary types.
|
||||
*/
|
||||
private bool TryRemove(T key, out IList<TValue> value)
|
||||
private bool TryRemove(TKey key, out IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryRemove(key, out value);
|
||||
|
||||
_dictionary.TryGetValue(key, out value);
|
||||
return _dictionary.Remove(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper method to encapsulate generator differences between dictionary types.
|
||||
*/
|
||||
private bool TryAdd(T key, IList<TValue> value)
|
||||
private bool TryAdd(TKey key, IList<TValue> value)
|
||||
{
|
||||
return _dictionary.TryAdd(key, value);
|
||||
try
|
||||
{
|
||||
_dictionary.Add(key, value);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
#endregion Private Members
|
||||
}
|
||||
|
||||
@@ -53,24 +53,9 @@ namespace Org.OpenAPITools.Model
|
||||
public Animal(string className = default(string), string color = "red")
|
||||
{
|
||||
// to ensure "className" is required (not null)
|
||||
if (className == null)
|
||||
{
|
||||
throw new InvalidDataException("className is a required property for Animal and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ClassName = className;
|
||||
}
|
||||
|
||||
this.ClassName = className ?? throw new ArgumentNullException("className is a required property for Animal and cannot be null");;
|
||||
// use default value if no "color" provided
|
||||
if (color == null)
|
||||
{
|
||||
this.Color = "red";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Color = color;
|
||||
}
|
||||
this.Color = color ?? "red";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -45,15 +45,7 @@ namespace Org.OpenAPITools.Model
|
||||
public Category(long id = default(long), string name = "default-name")
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new InvalidDataException("name is a required property for Category and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
this.Name = name ?? throw new ArgumentNullException("name is a required property for Category and cannot be null");;
|
||||
this.Id = id;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,46 +56,12 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="bigDecimal">bigDecimal.</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), decimal bigDecimal = default(decimal))
|
||||
{
|
||||
// to ensure "number" is required (not null)
|
||||
if (number == null)
|
||||
{
|
||||
throw new InvalidDataException("number is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Number = number;
|
||||
}
|
||||
|
||||
this.Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
if (_byte == null)
|
||||
{
|
||||
throw new InvalidDataException("_byte is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Byte = _byte;
|
||||
}
|
||||
|
||||
// to ensure "date" is required (not null)
|
||||
if (date == null)
|
||||
{
|
||||
throw new InvalidDataException("date is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Date = date;
|
||||
}
|
||||
|
||||
this.Byte = _byte ?? throw new ArgumentNullException("_byte is a required property for FormatTest and cannot be null");;
|
||||
this.Date = date;
|
||||
// to ensure "password" is required (not null)
|
||||
if (password == null)
|
||||
{
|
||||
throw new InvalidDataException("password is a required property for FormatTest and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Password = password;
|
||||
}
|
||||
|
||||
this.Password = password ?? throw new ArgumentNullException("password is a required property for FormatTest and cannot be null");;
|
||||
this.Integer = integer;
|
||||
this.Int32 = int32;
|
||||
this.Int64 = int64;
|
||||
|
||||
@@ -44,16 +44,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="property">property.</param>
|
||||
public Name(int name = default(int), string property = default(string))
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new InvalidDataException("name is a required property for Name and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this._Name = name;
|
||||
}
|
||||
|
||||
this._Name = name;
|
||||
this.Property = property;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,15 +81,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.Quantity = quantity;
|
||||
this.ShipDate = shipDate;
|
||||
this.Status = status;
|
||||
// use default value if no "complete" provided
|
||||
if (complete == null)
|
||||
{
|
||||
this.Complete = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Complete = complete;
|
||||
}
|
||||
this.Complete = complete;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -82,25 +82,9 @@ namespace Org.OpenAPITools.Model
|
||||
public Pet(long id = default(long), Category category = default(Category), string name = default(string), List<string> photoUrls = default(List<string>), List<Tag> tags = default(List<Tag>), StatusEnum? status = default(StatusEnum?))
|
||||
{
|
||||
// to ensure "name" is required (not null)
|
||||
if (name == null)
|
||||
{
|
||||
throw new InvalidDataException("name is a required property for Pet and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Name = name;
|
||||
}
|
||||
|
||||
this.Name = name ?? throw new ArgumentNullException("name is a required property for Pet and cannot be null");;
|
||||
// to ensure "photoUrls" is required (not null)
|
||||
if (photoUrls == null)
|
||||
{
|
||||
throw new InvalidDataException("photoUrls is a required property for Pet and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.PhotoUrls = photoUrls;
|
||||
}
|
||||
|
||||
this.PhotoUrls = photoUrls ?? throw new ArgumentNullException("photoUrls is a required property for Pet and cannot be null");;
|
||||
this.Id = id;
|
||||
this.Category = category;
|
||||
this.Tags = tags;
|
||||
|
||||
@@ -48,55 +48,12 @@ namespace Org.OpenAPITools.Model
|
||||
public TypeHolderDefault(string stringItem = "what", decimal numberItem = default(decimal), int integerItem = default(int), bool boolItem = true, List<int> arrayItem = default(List<int>))
|
||||
{
|
||||
// to ensure "stringItem" is required (not null)
|
||||
if (stringItem == null)
|
||||
{
|
||||
throw new InvalidDataException("stringItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.StringItem = stringItem;
|
||||
}
|
||||
|
||||
// to ensure "numberItem" is required (not null)
|
||||
if (numberItem == null)
|
||||
{
|
||||
throw new InvalidDataException("numberItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NumberItem = numberItem;
|
||||
}
|
||||
|
||||
// to ensure "integerItem" is required (not null)
|
||||
if (integerItem == null)
|
||||
{
|
||||
throw new InvalidDataException("integerItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IntegerItem = integerItem;
|
||||
}
|
||||
|
||||
// to ensure "boolItem" is required (not null)
|
||||
if (boolItem == null)
|
||||
{
|
||||
throw new InvalidDataException("boolItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BoolItem = boolItem;
|
||||
}
|
||||
|
||||
this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderDefault and cannot be null");;
|
||||
this.NumberItem = numberItem;
|
||||
this.IntegerItem = integerItem;
|
||||
this.BoolItem = boolItem;
|
||||
// to ensure "arrayItem" is required (not null)
|
||||
if (arrayItem == null)
|
||||
{
|
||||
throw new InvalidDataException("arrayItem is a required property for TypeHolderDefault and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ArrayItem = arrayItem;
|
||||
}
|
||||
|
||||
this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderDefault and cannot be null");;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -49,65 +49,13 @@ namespace Org.OpenAPITools.Model
|
||||
public TypeHolderExample(string stringItem = default(string), decimal numberItem = default(decimal), float floatItem = default(float), int integerItem = default(int), bool boolItem = default(bool), List<int> arrayItem = default(List<int>))
|
||||
{
|
||||
// to ensure "stringItem" is required (not null)
|
||||
if (stringItem == null)
|
||||
{
|
||||
throw new InvalidDataException("stringItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.StringItem = stringItem;
|
||||
}
|
||||
|
||||
// to ensure "numberItem" is required (not null)
|
||||
if (numberItem == null)
|
||||
{
|
||||
throw new InvalidDataException("numberItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.NumberItem = numberItem;
|
||||
}
|
||||
|
||||
// to ensure "floatItem" is required (not null)
|
||||
if (floatItem == null)
|
||||
{
|
||||
throw new InvalidDataException("floatItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.FloatItem = floatItem;
|
||||
}
|
||||
|
||||
// to ensure "integerItem" is required (not null)
|
||||
if (integerItem == null)
|
||||
{
|
||||
throw new InvalidDataException("integerItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.IntegerItem = integerItem;
|
||||
}
|
||||
|
||||
// to ensure "boolItem" is required (not null)
|
||||
if (boolItem == null)
|
||||
{
|
||||
throw new InvalidDataException("boolItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.BoolItem = boolItem;
|
||||
}
|
||||
|
||||
this.StringItem = stringItem ?? throw new ArgumentNullException("stringItem is a required property for TypeHolderExample and cannot be null");;
|
||||
this.NumberItem = numberItem;
|
||||
this.FloatItem = floatItem;
|
||||
this.IntegerItem = integerItem;
|
||||
this.BoolItem = boolItem;
|
||||
// to ensure "arrayItem" is required (not null)
|
||||
if (arrayItem == null)
|
||||
{
|
||||
throw new InvalidDataException("arrayItem is a required property for TypeHolderExample and cannot be null");
|
||||
}
|
||||
else
|
||||
{
|
||||
this.ArrayItem = arrayItem;
|
||||
}
|
||||
|
||||
this.ArrayItem = arrayItem ?? throw new ArgumentNullException("arrayItem is a required property for TypeHolderExample and cannot be null");;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,20 +11,20 @@
|
||||
<AssemblyTitle>OpenAPI Library</AssemblyTitle>
|
||||
<Description>A library generated from a OpenAPI doc</Description>
|
||||
<Copyright>No Copyright</Copyright>
|
||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
|
||||
<RootNamespace>Org.OpenAPITools</RootNamespace>
|
||||
<Version>1.0.0</Version>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\Org.OpenAPITools.xml</DocumentationFile>
|
||||
<RepositoryUrl>https://github.com/GIT_USER_ID/GIT_REPO_ID.git</RepositoryUrl>
|
||||
<RepositoryType>git</RepositoryType>
|
||||
<PackageReleaseNotes>Minor update</PackageReleaseNotes>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="RestSharp" Version="106.6.7" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||
<PackageReference Include="CompareNETObjects" Version="4.57.0" />
|
||||
<PackageReference Include="JsonSubTypes" Version="1.5.2" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
|
||||
<PackageReference Include="RestSharp" Version="106.10.1" />
|
||||
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user