@@ -55,7 +55,7 @@ public interface IFakeApi : IApiAccessor
55
55
/// <param name="dateTime">None (optional)</param>
56
56
/// <param name="password">None (optional)</param>
57
57
/// <returns></returns>
58
- 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 ) ;
58
+ 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 ) ;
59
59
60
60
/// <summary>
61
61
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -77,7 +77,7 @@ public interface IFakeApi : IApiAccessor
77
77
/// <param name="dateTime">None (optional)</param>
78
78
/// <param name="password">None (optional)</param>
79
79
/// <returns>ApiResponse of Object(void)</returns>
80
- 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 ) ;
80
+ 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 ) ;
81
81
#endregion Synchronous Operations
82
82
#region Asynchronous Operations
83
83
/// <summary>
@@ -100,7 +100,7 @@ public interface IFakeApi : IApiAccessor
100
100
/// <param name="dateTime">None (optional)</param>
101
101
/// <param name="password">None (optional)</param>
102
102
/// <returns>Task of void</returns>
103
- 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 ) ;
103
+ 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 ) ;
104
104
105
105
/// <summary>
106
106
/// Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
@@ -122,7 +122,7 @@ public interface IFakeApi : IApiAccessor
122
122
/// <param name="dateTime">None (optional)</param>
123
123
/// <param name="password">None (optional)</param>
124
124
/// <returns>Task of ApiResponse</returns>
125
- 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 ) ;
125
+ 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 ) ;
126
126
#endregion Asynchronous Operations
127
127
}
128
128
@@ -131,6 +131,8 @@ public interface IFakeApi : IApiAccessor
131
131
/// </summary>
132
132
public partial class FakeApi : IFakeApi
133
133
{
134
+ private IO . Swagger . Client . ExceptionFactory _exceptionFactory = ( name , response ) => null ;
135
+
134
136
/// <summary>
135
137
/// Initializes a new instance of the <see cref="FakeApi"/> class.
136
138
/// </summary>
@@ -139,6 +141,8 @@ public FakeApi(String basePath)
139
141
{
140
142
this . Configuration = new Configuration ( new ApiClient ( basePath ) ) ;
141
143
144
+ ExceptionFactory = IO . Swagger . Client . Configuration . DefaultExceptionFactory ;
145
+
142
146
// ensure API client has configuration ready
143
147
if ( Configuration . ApiClient . Configuration == null )
144
148
{
@@ -159,6 +163,8 @@ public FakeApi(Configuration configuration = null)
159
163
else
160
164
this . Configuration = configuration ;
161
165
166
+ ExceptionFactory = IO . Swagger . Client . Configuration . DefaultExceptionFactory ;
167
+
162
168
// ensure API client has configuration ready
163
169
if ( Configuration . ApiClient . Configuration == null )
164
170
{
@@ -191,6 +197,22 @@ public void SetBasePath(String basePath)
191
197
/// <value>An instance of the Configuration</value>
192
198
public Configuration Configuration { get ; set ; }
193
199
200
+ /// <summary>
201
+ /// Provides a factory method hook for the creation of exceptions.
202
+ /// </summary>
203
+ public IO . Swagger . Client . ExceptionFactory ExceptionFactory
204
+ {
205
+ get
206
+ {
207
+ if ( _exceptionFactory != null && _exceptionFactory . GetInvocationList ( ) . Length > 1 )
208
+ {
209
+ throw new InvalidOperationException ( "Multicast delegate for ExceptionFactory is unsupported." ) ;
210
+ }
211
+ return _exceptionFactory ;
212
+ }
213
+ set { _exceptionFactory = value ; }
214
+ }
215
+
194
216
/// <summary>
195
217
/// Gets the default header.
196
218
/// </summary>
@@ -230,7 +252,7 @@ public void AddDefaultHeader(string key, string value)
230
252
/// <param name="dateTime">None (optional)</param>
231
253
/// <param name="password">None (optional)</param>
232
254
/// <returns></returns>
233
- 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 )
255
+ 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 )
234
256
{
235
257
TestEndpointParametersWithHttpInfo ( number , _double , _string , _byte , integer , int32 , int64 , _float , binary , date , dateTime , password ) ;
236
258
}
@@ -252,7 +274,7 @@ public void TestEndpointParameters (double? number, double? _double, string _str
252
274
/// <param name="dateTime">None (optional)</param>
253
275
/// <param name="password">None (optional)</param>
254
276
/// <returns>ApiResponse of Object(void)</returns>
255
- 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 )
277
+ 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 )
256
278
{
257
279
// verify the required parameter 'number' is set
258
280
if ( number == null )
@@ -315,10 +337,11 @@ public ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, d
315
337
316
338
int localVarStatusCode = ( int ) localVarResponse . StatusCode ;
317
339
318
- if ( localVarStatusCode >= 400 )
319
- throw new ApiException ( localVarStatusCode , "Error calling TestEndpointParameters: " + localVarResponse . Content , localVarResponse . Content ) ;
320
- else if ( localVarStatusCode == 0 )
321
- throw new ApiException ( localVarStatusCode , "Error calling TestEndpointParameters: " + localVarResponse . ErrorMessage , localVarResponse . ErrorMessage ) ;
340
+ if ( ExceptionFactory != null )
341
+ {
342
+ Exception exception = ExceptionFactory ( "TestEndpointParameters" , localVarResponse ) ;
343
+ if ( exception != null ) throw exception ;
344
+ }
322
345
323
346
324
347
return new ApiResponse < Object > ( localVarStatusCode ,
@@ -343,7 +366,7 @@ public ApiResponse<Object> TestEndpointParametersWithHttpInfo (double? number, d
343
366
/// <param name="dateTime">None (optional)</param>
344
367
/// <param name="password">None (optional)</param>
345
368
/// <returns>Task of void</returns>
346
- 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 )
369
+ 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 )
347
370
{
348
371
await TestEndpointParametersAsyncWithHttpInfo ( number , _double , _string , _byte , integer , int32 , int64 , _float , binary , date , dateTime , password ) ;
349
372
@@ -366,7 +389,7 @@ public async System.Threading.Tasks.Task TestEndpointParametersAsync (double? nu
366
389
/// <param name="dateTime">None (optional)</param>
367
390
/// <param name="password">None (optional)</param>
368
391
/// <returns>Task of ApiResponse</returns>
369
- 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 )
392
+ 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 )
370
393
{
371
394
// verify the required parameter 'number' is set
372
395
if ( number == null )
@@ -429,10 +452,11 @@ public async System.Threading.Tasks.Task<ApiResponse<Object>> TestEndpointParame
429
452
430
453
int localVarStatusCode = ( int ) localVarResponse . StatusCode ;
431
454
432
- if ( localVarStatusCode >= 400 )
433
- throw new ApiException ( localVarStatusCode , "Error calling TestEndpointParameters: " + localVarResponse . Content , localVarResponse . Content ) ;
434
- else if ( localVarStatusCode == 0 )
435
- throw new ApiException ( localVarStatusCode , "Error calling TestEndpointParameters: " + localVarResponse . ErrorMessage , localVarResponse . ErrorMessage ) ;
455
+ if ( ExceptionFactory != null )
456
+ {
457
+ Exception exception = ExceptionFactory ( "TestEndpointParameters" , localVarResponse ) ;
458
+ if ( exception != null ) throw exception ;
459
+ }
436
460
437
461
438
462
return new ApiResponse < Object > ( localVarStatusCode ,
0 commit comments