forked from loafle/openapi-generator-original
[csharp] Regenerate petstore client
This commit is contained in:
parent
196930cf49
commit
c209cb25ef
@ -2,7 +2,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio 2012
|
# Visual Studio 2012
|
||||||
VisualStudioVersion = 12.0.0.0
|
VisualStudioVersion = 12.0.0.0
|
||||||
MinimumVisualStudioVersion = 10.0.0.1
|
MinimumVisualStudioVersion = 10.0.0.1
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{C81D6286-7BA5-4920-8591-F59169CCE4A4}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{EE727567-9CAF-4258-AA0E-FDF89487D7D6}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "src\IO.Swagger.Test\IO.Swagger.Test.csproj", "{19F1DEBC-DE5E-4517-8062-F000CD499087}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -12,10 +12,10 @@ Debug|Any CPU = Debug|Any CPU
|
|||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{C81D6286-7BA5-4920-8591-F59169CCE4A4}.Release|Any CPU.Build.0 = Release|Any CPU
|
{EE727567-9CAF-4258-AA0E-FDF89487D7D6}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{19F1DEBC-DE5E-4517-8062-F000CD499087}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
@ -6,7 +6,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c
|
|||||||
|
|
||||||
- API version: 1.0.0
|
- API version: 1.0.0
|
||||||
- SDK version: 1.0.0
|
- SDK version: 1.0.0
|
||||||
- Build date: 2016-05-29T17:27:36.037+08:00
|
- Build date: 2016-06-10T08:07:39.769-04:00
|
||||||
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
- Build package: class io.swagger.codegen.languages.CSharpClientCodegen
|
||||||
|
|
||||||
## Frameworks supported
|
## Frameworks supported
|
||||||
@ -54,7 +54,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
var apiInstance = new FakeApi();
|
var apiInstance = new FakeApi();
|
||||||
var number = 3.4; // double? | None
|
var number = 3.4; // decimal? | None
|
||||||
var _double = 1.2; // double? | None
|
var _double = 1.2; // double? | None
|
||||||
var _string = _string_example; // string | None
|
var _string = _string_example; // string | None
|
||||||
var _byte = B; // byte[] | None
|
var _byte = B; // byte[] | None
|
||||||
@ -138,12 +138,6 @@ Class | Method | HTTP request | Description
|
|||||||
## Documentation for Authorization
|
## Documentation for Authorization
|
||||||
|
|
||||||
|
|
||||||
### api_key
|
|
||||||
|
|
||||||
- **Type**: API key
|
|
||||||
- **API key parameter name**: api_key
|
|
||||||
- **Location**: HTTP header
|
|
||||||
|
|
||||||
### petstore_auth
|
### petstore_auth
|
||||||
|
|
||||||
- **Type**: OAuth
|
- **Type**: OAuth
|
||||||
@ -153,3 +147,9 @@ Class | Method | HTTP request | Description
|
|||||||
- write:pets: modify pets in your account
|
- write:pets: modify pets in your account
|
||||||
- read:pets: read your pets
|
- read:pets: read your pets
|
||||||
|
|
||||||
|
### api_key
|
||||||
|
|
||||||
|
- **Type**: API key
|
||||||
|
- **API key parameter name**: api_key
|
||||||
|
- **Location**: HTTP header
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
# **TestEndpointParameters**
|
# **TestEndpointParameters**
|
||||||
> void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
> void TestEndpointParameters (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||||
|
|
||||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ namespace Example
|
|||||||
{
|
{
|
||||||
|
|
||||||
var apiInstance = new FakeApi();
|
var apiInstance = new FakeApi();
|
||||||
var number = 3.4; // double? | None
|
var number = 3.4; // decimal? | None
|
||||||
var _double = 1.2; // double? | None
|
var _double = 1.2; // double? | None
|
||||||
var _string = _string_example; // string | None
|
var _string = _string_example; // string | None
|
||||||
var _byte = B; // byte[] | None
|
var _byte = B; // byte[] | None
|
||||||
@ -61,7 +61,7 @@ namespace Example
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**number** | **double?**| None |
|
**number** | **decimal?**| None |
|
||||||
**_double** | **double?**| None |
|
**_double** | **double?**| None |
|
||||||
**_string** | **string**| None |
|
**_string** | **string**| None |
|
||||||
**_byte** | **byte[]**| None |
|
**_byte** | **byte[]**| None |
|
||||||
|
@ -6,7 +6,7 @@ Name | Type | Description | Notes
|
|||||||
**Integer** | **int?** | | [optional]
|
**Integer** | **int?** | | [optional]
|
||||||
**Int32** | **int?** | | [optional]
|
**Int32** | **int?** | | [optional]
|
||||||
**Int64** | **long?** | | [optional]
|
**Int64** | **long?** | | [optional]
|
||||||
**Number** | **double?** | |
|
**Number** | **decimal?** | |
|
||||||
**_Float** | **float?** | | [optional]
|
**_Float** | **float?** | | [optional]
|
||||||
**_Double** | **double?** | | [optional]
|
**_Double** | **double?** | | [optional]
|
||||||
**_String** | **string** | | [optional]
|
**_String** | **string** | | [optional]
|
||||||
|
@ -86,7 +86,7 @@ limitations under the License.
|
|||||||
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MsBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
|
<ProjectReference Include="..\IO.Swagger\IO.Swagger.csproj">
|
||||||
<Project>{C81D6286-7BA5-4920-8591-F59169CCE4A4}</Project>
|
<Project>{EE727567-9CAF-4258-AA0E-FDF89487D7D6}</Project>
|
||||||
<Name>IO.Swagger</Name>
|
<Name>IO.Swagger</Name>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
@ -55,7 +55,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
void TestEndpointParameters (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
@ -77,7 +77,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns>ApiResponse of Object(void)</returns>
|
/// <returns>ApiResponse of Object(void)</returns>
|
||||||
ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
ApiResponse<Object> TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||||
#endregion Synchronous Operations
|
#endregion Synchronous Operations
|
||||||
#region Asynchronous Operations
|
#region Asynchronous Operations
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -100,7 +100,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns>Task of void</returns>
|
/// <returns>Task of void</returns>
|
||||||
System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||||
@ -122,7 +122,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns>Task of ApiResponse</returns>
|
/// <returns>Task of ApiResponse</returns>
|
||||||
System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null);
|
||||||
#endregion Asynchronous Operations
|
#endregion Asynchronous Operations
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,6 +131,8 @@ namespace IO.Swagger.Api
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class FakeApi : IFakeApi
|
public partial class FakeApi : IFakeApi
|
||||||
{
|
{
|
||||||
|
private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="FakeApi"/> class.
|
/// Initializes a new instance of the <see cref="FakeApi"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -139,6 +141,8 @@ namespace IO.Swagger.Api
|
|||||||
{
|
{
|
||||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -159,6 +163,8 @@ namespace IO.Swagger.Api
|
|||||||
else
|
else
|
||||||
this.Configuration = configuration;
|
this.Configuration = configuration;
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -191,6 +197,22 @@ namespace IO.Swagger.Api
|
|||||||
/// <value>An instance of the Configuration</value>
|
/// <value>An instance of the Configuration</value>
|
||||||
public Configuration Configuration {get; set;}
|
public Configuration Configuration {get; set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a factory method hook for the creation of exceptions.
|
||||||
|
/// </summary>
|
||||||
|
public IO.Swagger.Client.ExceptionFactory ExceptionFactory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||||
|
}
|
||||||
|
return _exceptionFactory;
|
||||||
|
}
|
||||||
|
set { _exceptionFactory = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default header.
|
/// Gets the default header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -230,7 +252,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public void TestEndpointParameters (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
public void TestEndpointParameters (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||||
{
|
{
|
||||||
TestEndpointParametersWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
TestEndpointParametersWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||||
}
|
}
|
||||||
@ -252,7 +274,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns>ApiResponse of Object(void)</returns>
|
/// <returns>ApiResponse of Object(void)</returns>
|
||||||
public ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
public ApiResponse<Object> TestEndpointParametersWithHttpInfo (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||||
{
|
{
|
||||||
// verify the required parameter 'number' is set
|
// verify the required parameter 'number' is set
|
||||||
if (number == null)
|
if (number == null)
|
||||||
@ -315,10 +337,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -343,7 +366,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns>Task of void</returns>
|
/// <returns>Task of void</returns>
|
||||||
public async System.Threading.Tasks.Task TestEndpointParametersAsync (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
public async System.Threading.Tasks.Task TestEndpointParametersAsync (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||||
{
|
{
|
||||||
await TestEndpointParametersAsyncWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
await TestEndpointParametersAsyncWithHttpInfo(number, _double, _string, _byte, integer, int32, int64, _float, binary, date, dateTime, password);
|
||||||
|
|
||||||
@ -366,7 +389,7 @@ namespace IO.Swagger.Api
|
|||||||
/// <param name="dateTime">None (optional)</param>
|
/// <param name="dateTime">None (optional)</param>
|
||||||
/// <param name="password">None (optional)</param>
|
/// <param name="password">None (optional)</param>
|
||||||
/// <returns>Task of ApiResponse</returns>
|
/// <returns>Task of ApiResponse</returns>
|
||||||
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (double? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParametersAsyncWithHttpInfo (decimal? number, double? _double, string _string, byte[] _byte, int? integer = null, int? int32 = null, long? int64 = null, float? _float = null, byte[] binary = null, DateTime? date = null, DateTime? dateTime = null, string password = null)
|
||||||
{
|
{
|
||||||
// verify the required parameter 'number' is set
|
// verify the required parameter 'number' is set
|
||||||
if (number == null)
|
if (number == null)
|
||||||
@ -429,10 +452,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("TestEndpointParameters", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling TestEndpointParameters: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
@ -402,6 +402,8 @@ namespace IO.Swagger.Api
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class PetApi : IPetApi
|
public partial class PetApi : IPetApi
|
||||||
{
|
{
|
||||||
|
private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="PetApi"/> class.
|
/// Initializes a new instance of the <see cref="PetApi"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -410,6 +412,8 @@ namespace IO.Swagger.Api
|
|||||||
{
|
{
|
||||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -430,6 +434,8 @@ namespace IO.Swagger.Api
|
|||||||
else
|
else
|
||||||
this.Configuration = configuration;
|
this.Configuration = configuration;
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -462,6 +468,22 @@ namespace IO.Swagger.Api
|
|||||||
/// <value>An instance of the Configuration</value>
|
/// <value>An instance of the Configuration</value>
|
||||||
public Configuration Configuration {get; set;}
|
public Configuration Configuration {get; set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a factory method hook for the creation of exceptions.
|
||||||
|
/// </summary>
|
||||||
|
public IO.Swagger.Client.ExceptionFactory ExceptionFactory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||||
|
}
|
||||||
|
return _exceptionFactory;
|
||||||
|
}
|
||||||
|
set { _exceptionFactory = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default header.
|
/// Gets the default header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -557,10 +579,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling AddPet: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("AddPet", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling AddPet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -642,10 +665,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling AddPet: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("AddPet", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling AddPet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -720,10 +744,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeletePet: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("DeletePet", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeletePet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -799,10 +824,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeletePet: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("DeletePet", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeletePet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -875,10 +901,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByStatus: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -952,10 +979,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByStatus: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("FindPetsByStatus", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByStatus: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1028,10 +1056,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByTags: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByTags: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1105,10 +1134,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByTags: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("FindPetsByTags", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling FindPetsByTags: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
return new ApiResponse<List<Pet>>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1181,10 +1211,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetPetById: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetPetById", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetPetById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Pet>(localVarStatusCode,
|
return new ApiResponse<Pet>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1257,10 +1288,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetPetById: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetPetById", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetPetById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Pet>(localVarStatusCode,
|
return new ApiResponse<Pet>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1341,10 +1373,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePet: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UpdatePet", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1426,10 +1459,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePet: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UpdatePet", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePet: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1508,10 +1542,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePetWithForm: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePetWithForm: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1591,10 +1626,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePetWithForm: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UpdatePetWithForm", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdatePetWithForm: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1673,10 +1709,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UploadFile: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UploadFile", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UploadFile: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<ApiResponse>(localVarStatusCode,
|
return new ApiResponse<ApiResponse>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1756,10 +1793,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UploadFile: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UploadFile", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UploadFile: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<ApiResponse>(localVarStatusCode,
|
return new ApiResponse<ApiResponse>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
|
@ -210,6 +210,8 @@ namespace IO.Swagger.Api
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class StoreApi : IStoreApi
|
public partial class StoreApi : IStoreApi
|
||||||
{
|
{
|
||||||
|
private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="StoreApi"/> class.
|
/// Initializes a new instance of the <see cref="StoreApi"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -218,6 +220,8 @@ namespace IO.Swagger.Api
|
|||||||
{
|
{
|
||||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -238,6 +242,8 @@ namespace IO.Swagger.Api
|
|||||||
else
|
else
|
||||||
this.Configuration = configuration;
|
this.Configuration = configuration;
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -270,6 +276,22 @@ namespace IO.Swagger.Api
|
|||||||
/// <value>An instance of the Configuration</value>
|
/// <value>An instance of the Configuration</value>
|
||||||
public Configuration Configuration {get; set;}
|
public Configuration Configuration {get; set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a factory method hook for the creation of exceptions.
|
||||||
|
/// </summary>
|
||||||
|
public IO.Swagger.Client.ExceptionFactory ExceptionFactory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||||
|
}
|
||||||
|
return _exceptionFactory;
|
||||||
|
}
|
||||||
|
set { _exceptionFactory = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default header.
|
/// Gets the default header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -350,10 +372,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("DeleteOrder", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -420,10 +443,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("DeleteOrder", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -489,10 +513,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetInventory", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -558,10 +583,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetInventory", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetInventory: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
return new ApiResponse<Dictionary<string, int?>>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -628,10 +654,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetOrderById", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Order>(localVarStatusCode,
|
return new ApiResponse<Order>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -699,10 +726,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetOrderById", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetOrderById: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Order>(localVarStatusCode,
|
return new ApiResponse<Order>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -776,10 +804,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("PlaceOrder", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Order>(localVarStatusCode,
|
return new ApiResponse<Order>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -854,10 +883,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("PlaceOrder", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling PlaceOrder: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<Order>(localVarStatusCode,
|
return new ApiResponse<Order>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
|
@ -386,6 +386,8 @@ namespace IO.Swagger.Api
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class UserApi : IUserApi
|
public partial class UserApi : IUserApi
|
||||||
{
|
{
|
||||||
|
private IO.Swagger.Client.ExceptionFactory _exceptionFactory = (name, response) => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="UserApi"/> class.
|
/// Initializes a new instance of the <see cref="UserApi"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -394,6 +396,8 @@ namespace IO.Swagger.Api
|
|||||||
{
|
{
|
||||||
this.Configuration = new Configuration(new ApiClient(basePath));
|
this.Configuration = new Configuration(new ApiClient(basePath));
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -414,6 +418,8 @@ namespace IO.Swagger.Api
|
|||||||
else
|
else
|
||||||
this.Configuration = configuration;
|
this.Configuration = configuration;
|
||||||
|
|
||||||
|
ExceptionFactory = IO.Swagger.Client.Configuration.DefaultExceptionFactory;
|
||||||
|
|
||||||
// ensure API client has configuration ready
|
// ensure API client has configuration ready
|
||||||
if (Configuration.ApiClient.Configuration == null)
|
if (Configuration.ApiClient.Configuration == null)
|
||||||
{
|
{
|
||||||
@ -446,6 +452,22 @@ namespace IO.Swagger.Api
|
|||||||
/// <value>An instance of the Configuration</value>
|
/// <value>An instance of the Configuration</value>
|
||||||
public Configuration Configuration {get; set;}
|
public Configuration Configuration {get; set;}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a factory method hook for the creation of exceptions.
|
||||||
|
/// </summary>
|
||||||
|
public IO.Swagger.Client.ExceptionFactory ExceptionFactory
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1)
|
||||||
|
{
|
||||||
|
throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported.");
|
||||||
|
}
|
||||||
|
return _exceptionFactory;
|
||||||
|
}
|
||||||
|
set { _exceptionFactory = value; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the default header.
|
/// Gets the default header.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -533,10 +555,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("CreateUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -610,10 +633,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("CreateUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -686,10 +710,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithArrayInput: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithArrayInput: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -763,10 +788,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithArrayInput: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("CreateUsersWithArrayInput", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithArrayInput: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -839,10 +865,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithListInput: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithListInput: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -916,10 +943,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithListInput: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("CreateUsersWithListInput", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling CreateUsersWithListInput: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -985,10 +1013,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("DeleteUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1055,10 +1084,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("DeleteUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling DeleteUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1125,10 +1155,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetUserByName", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<User>(localVarStatusCode,
|
return new ApiResponse<User>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1196,10 +1227,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("GetUserByName", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling GetUserByName: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<User>(localVarStatusCode,
|
return new ApiResponse<User>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1272,10 +1304,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LoginUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("LoginUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LoginUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<string>(localVarStatusCode,
|
return new ApiResponse<string>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1349,10 +1382,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LoginUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("LoginUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LoginUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
return new ApiResponse<string>(localVarStatusCode,
|
return new ApiResponse<string>(localVarStatusCode,
|
||||||
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
|
||||||
@ -1412,10 +1446,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LogoutUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("LogoutUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LogoutUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1476,10 +1511,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LogoutUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("LogoutUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling LogoutUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1558,10 +1594,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdateUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UpdateUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdateUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
@ -1641,10 +1678,11 @@ namespace IO.Swagger.Api
|
|||||||
|
|
||||||
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
int localVarStatusCode = (int) localVarResponse.StatusCode;
|
||||||
|
|
||||||
if (localVarStatusCode >= 400)
|
if (ExceptionFactory != null)
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdateUser: " + localVarResponse.Content, localVarResponse.Content);
|
{
|
||||||
else if (localVarStatusCode == 0)
|
Exception exception = ExceptionFactory("UpdateUser", localVarResponse);
|
||||||
throw new ApiException (localVarStatusCode, "Error calling UpdateUser: " + localVarResponse.ErrorMessage, localVarResponse.ErrorMessage);
|
if (exception != null) throw exception;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new ApiResponse<Object>(localVarStatusCode,
|
return new ApiResponse<Object>(localVarStatusCode,
|
||||||
|
@ -36,15 +36,28 @@ using RestSharp;
|
|||||||
namespace IO.Swagger.Client
|
namespace IO.Swagger.Client
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// API client is mainly responible for making the HTTP call to the API backend.
|
/// API client is mainly responsible for making the HTTP call to the API backend.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ApiClient
|
public partial class ApiClient
|
||||||
{
|
{
|
||||||
private JsonSerializerSettings serializerSettings = new JsonSerializerSettings
|
private JsonSerializerSettings serializerSettings = new JsonSerializerSettings
|
||||||
{
|
{
|
||||||
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor
|
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows for extending request processing for <see cref="ApiClient"/> generated code.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The RestSharp request object</param>
|
||||||
|
partial void InterceptRequest(IRestRequest request);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Allows for extending response processing for <see cref="ApiClient"/> generated code.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The RestSharp request object</param>
|
||||||
|
/// <param name="response">The RestSharp response object</param>
|
||||||
|
partial void InterceptResponse(IRestRequest request, IRestResponse response);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="ApiClient" /> class
|
/// Initializes a new instance of the <see cref="ApiClient" /> class
|
||||||
/// with default configuration and base path (http://petstore.swagger.io/v2).
|
/// with default configuration and base path (http://petstore.swagger.io/v2).
|
||||||
@ -177,7 +190,10 @@ namespace IO.Swagger.Client
|
|||||||
// set user agent
|
// set user agent
|
||||||
RestClient.UserAgent = Configuration.UserAgent;
|
RestClient.UserAgent = Configuration.UserAgent;
|
||||||
|
|
||||||
|
InterceptRequest(request);
|
||||||
var response = RestClient.Execute(request);
|
var response = RestClient.Execute(request);
|
||||||
|
InterceptResponse(request, response);
|
||||||
|
|
||||||
return (Object) response;
|
return (Object) response;
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -202,7 +218,9 @@ namespace IO.Swagger.Client
|
|||||||
var request = PrepareRequest(
|
var request = PrepareRequest(
|
||||||
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
path, method, queryParams, postBody, headerParams, formParams, fileParams,
|
||||||
pathParams, contentType);
|
pathParams, contentType);
|
||||||
|
InterceptRequest(request);
|
||||||
var response = await RestClient.ExecuteTaskAsync(request);
|
var response = await RestClient.ExecuteTaskAsync(request);
|
||||||
|
InterceptResponse(request, response);
|
||||||
return (Object)response;
|
return (Object)response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +101,17 @@ namespace IO.Swagger.Client
|
|||||||
/// <value>Configuration.</value>
|
/// <value>Configuration.</value>
|
||||||
public static Configuration Default = new Configuration();
|
public static Configuration Default = new Configuration();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Default creation of exceptions for a given method name and response object
|
||||||
|
/// </summary>
|
||||||
|
public static readonly ExceptionFactory DefaultExceptionFactory = (methodName, response) =>
|
||||||
|
{
|
||||||
|
int status = (int) response.StatusCode;
|
||||||
|
if (status >= 400) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.Content), response.Content);
|
||||||
|
if (status == 0) return new ApiException(status, String.Format("Error calling {0}: {1}", methodName, response.ErrorMessage), response.ErrorMessage);
|
||||||
|
return null;
|
||||||
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
|
/// Gets or sets the HTTP timeout (milliseconds) of ApiClient. Default to 100000 milliseconds.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
using System;
|
||||||
|
using RestSharp;
|
||||||
|
|
||||||
|
namespace IO.Swagger.Client
|
||||||
|
{
|
||||||
|
public delegate Exception ExceptionFactory(string methodName, IRestResponse response);
|
||||||
|
}
|
@ -45,5 +45,10 @@ namespace IO.Swagger.Client
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The base path</value>
|
/// <value>The base path</value>
|
||||||
String GetBasePath();
|
String GetBasePath();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Provides a factory method hook for the creation of exceptions.
|
||||||
|
/// </summary>
|
||||||
|
ExceptionFactory ExceptionFactory { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ limitations under the License.
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
<ProjectGuid>{C81D6286-7BA5-4920-8591-F59169CCE4A4}</ProjectGuid>
|
<ProjectGuid>{EE727567-9CAF-4258-AA0E-FDF89487D7D6}</ProjectGuid>
|
||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
<RootNamespace>Swagger Library</RootNamespace>
|
<RootNamespace>Swagger Library</RootNamespace>
|
||||||
|
@ -60,7 +60,7 @@ namespace IO.Swagger.Model
|
|||||||
/// <param name="DateTime">DateTime.</param>
|
/// <param name="DateTime">DateTime.</param>
|
||||||
/// <param name="Uuid">Uuid.</param>
|
/// <param name="Uuid">Uuid.</param>
|
||||||
/// <param name="Password">Password (required).</param>
|
/// <param name="Password">Password (required).</param>
|
||||||
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, double? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, Guid? Uuid = null, string Password = null)
|
public FormatTest(int? Integer = null, int? Int32 = null, long? Int64 = null, decimal? Number = null, float? _Float = null, double? _Double = null, string _String = null, byte[] _Byte = null, byte[] Binary = null, DateTime? Date = null, DateTime? DateTime = null, Guid? Uuid = null, string Password = null)
|
||||||
{
|
{
|
||||||
// to ensure "Number" is required (not null)
|
// to ensure "Number" is required (not null)
|
||||||
if (Number == null)
|
if (Number == null)
|
||||||
@ -128,7 +128,7 @@ namespace IO.Swagger.Model
|
|||||||
/// Gets or Sets Number
|
/// Gets or Sets Number
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[DataMember(Name="number", EmitDefaultValue=false)]
|
[DataMember(Name="number", EmitDefaultValue=false)]
|
||||||
public double? Number { get; set; }
|
public decimal? Number { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or Sets _Float
|
/// Gets or Sets _Float
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user