@@ -164,6 +164,7 @@ public partial class AsymmetricKeyManagementApi : IAsymmetricKeyManagementApi
164164 {
165165 private static Logger logger ;
166166 private ExceptionFactory _exceptionFactory = ( name , response ) => null ;
167+ private int ? _statusCode ;
167168
168169 /// <summary>
169170 /// Initializes a new instance of the <see cref="AsymmetricKeyManagementApi"/> class.
@@ -274,6 +275,25 @@ public void AddDefaultHeader(string key, string value)
274275 Configuration . AddDefaultHeader ( key , value ) ;
275276 }
276277
278+ /// <summary>
279+ /// Retrieves the status code being set for the most recently executed API request.
280+ /// </summary>
281+ /// <returns>Status Code of previous request</returns>
282+ public int GetStatusCode ( )
283+ {
284+ return this . _statusCode == null ? 0 : ( int ) this . _statusCode ;
285+ }
286+
287+ /// <summary>
288+ /// Sets the value of status code for the most recently executed API request, in order to be retrieved later.
289+ /// </summary>
290+ /// <param name="statusCode">Status Code to be set</param>
291+ /// <returns></returns>
292+ public void SetStatusCode ( int ? statusCode )
293+ {
294+ this . _statusCode = statusCode ;
295+ }
296+
277297 /// <summary>
278298 /// Create one or more PKCS#12 keys 'Create one or more PKCS#12 keys'
279299 /// </summary>
@@ -283,8 +303,10 @@ public void AddDefaultHeader(string key, string value)
283303 public KmsV2KeysAsymPost201Response CreateP12Keys ( CreateP12KeysRequest createP12KeysRequest )
284304 {
285305 logger . Debug ( "CALLING API \" CreateP12Keys\" STARTED" ) ;
306+ this . SetStatusCode ( null ) ;
286307 ApiResponse < KmsV2KeysAsymPost201Response > localVarResponse = CreateP12KeysWithHttpInfo ( createP12KeysRequest ) ;
287308 logger . Debug ( "CALLING API \" CreateP12Keys\" ENDED" ) ;
309+ this . SetStatusCode ( localVarResponse . StatusCode ) ;
288310 return localVarResponse . Data ;
289311 }
290312
@@ -357,7 +379,7 @@ public ApiResponse< KmsV2KeysAsymPost201Response > CreateP12KeysWithHttpInfo (Cr
357379
358380 if ( ExceptionFactory != null )
359381 {
360- Exception exception = ExceptionFactory ( "CreateP12Keys" , localVarResponse ) ;
382+ ApiException exception = ( ApiException ) ExceptionFactory ( "CreateP12Keys" , localVarResponse ) ;
361383 if ( exception != null )
362384 {
363385 logger . Error ( $ "Exception : { exception . Message } ") ;
@@ -379,8 +401,10 @@ public ApiResponse< KmsV2KeysAsymPost201Response > CreateP12KeysWithHttpInfo (Cr
379401 public async System . Threading . Tasks . Task < KmsV2KeysAsymPost201Response > CreateP12KeysAsync ( CreateP12KeysRequest createP12KeysRequest )
380402 {
381403 logger . Debug ( "CALLING API \" CreateP12KeysAsync\" STARTED" ) ;
404+ this . SetStatusCode ( null ) ;
382405 ApiResponse < KmsV2KeysAsymPost201Response > localVarResponse = await CreateP12KeysAsyncWithHttpInfo ( createP12KeysRequest ) ;
383406 logger . Debug ( "CALLING API \" CreateP12KeysAsync\" ENDED" ) ;
407+ this . SetStatusCode ( localVarResponse . StatusCode ) ;
384408 return localVarResponse . Data ;
385409
386410 }
@@ -454,7 +478,7 @@ public async System.Threading.Tasks.Task<ApiResponse<KmsV2KeysAsymPost201Respons
454478
455479 if ( ExceptionFactory != null )
456480 {
457- Exception exception = ExceptionFactory ( "CreateP12Keys" , localVarResponse ) ;
481+ ApiException exception = ( ApiException ) ExceptionFactory ( "CreateP12Keys" , localVarResponse ) ;
458482 if ( exception != null )
459483 {
460484 logger . Error ( $ "Exception : { exception . Message } ") ;
@@ -475,8 +499,10 @@ public async System.Threading.Tasks.Task<ApiResponse<KmsV2KeysAsymPost201Respons
475499 public KmsV2KeysAsymDeletesPost200Response DeleteBulkP12Keys ( DeleteBulkP12KeysRequest deleteBulkP12KeysRequest )
476500 {
477501 logger . Debug ( "CALLING API \" DeleteBulkP12Keys\" STARTED" ) ;
502+ this . SetStatusCode ( null ) ;
478503 ApiResponse < KmsV2KeysAsymDeletesPost200Response > localVarResponse = DeleteBulkP12KeysWithHttpInfo ( deleteBulkP12KeysRequest ) ;
479504 logger . Debug ( "CALLING API \" DeleteBulkP12Keys\" ENDED" ) ;
505+ this . SetStatusCode ( localVarResponse . StatusCode ) ;
480506 return localVarResponse . Data ;
481507 }
482508
@@ -549,7 +575,7 @@ public ApiResponse< KmsV2KeysAsymDeletesPost200Response > DeleteBulkP12KeysWithH
549575
550576 if ( ExceptionFactory != null )
551577 {
552- Exception exception = ExceptionFactory ( "DeleteBulkP12Keys" , localVarResponse ) ;
578+ ApiException exception = ( ApiException ) ExceptionFactory ( "DeleteBulkP12Keys" , localVarResponse ) ;
553579 if ( exception != null )
554580 {
555581 logger . Error ( $ "Exception : { exception . Message } ") ;
@@ -571,8 +597,10 @@ public ApiResponse< KmsV2KeysAsymDeletesPost200Response > DeleteBulkP12KeysWithH
571597 public async System . Threading . Tasks . Task < KmsV2KeysAsymDeletesPost200Response > DeleteBulkP12KeysAsync ( DeleteBulkP12KeysRequest deleteBulkP12KeysRequest )
572598 {
573599 logger . Debug ( "CALLING API \" DeleteBulkP12KeysAsync\" STARTED" ) ;
600+ this . SetStatusCode ( null ) ;
574601 ApiResponse < KmsV2KeysAsymDeletesPost200Response > localVarResponse = await DeleteBulkP12KeysAsyncWithHttpInfo ( deleteBulkP12KeysRequest ) ;
575602 logger . Debug ( "CALLING API \" DeleteBulkP12KeysAsync\" ENDED" ) ;
603+ this . SetStatusCode ( localVarResponse . StatusCode ) ;
576604 return localVarResponse . Data ;
577605
578606 }
@@ -646,7 +674,7 @@ public async System.Threading.Tasks.Task<ApiResponse<KmsV2KeysAsymDeletesPost200
646674
647675 if ( ExceptionFactory != null )
648676 {
649- Exception exception = ExceptionFactory ( "DeleteBulkP12Keys" , localVarResponse ) ;
677+ ApiException exception = ( ApiException ) ExceptionFactory ( "DeleteBulkP12Keys" , localVarResponse ) ;
650678 if ( exception != null )
651679 {
652680 logger . Error ( $ "Exception : { exception . Message } ") ;
@@ -667,8 +695,10 @@ public async System.Threading.Tasks.Task<ApiResponse<KmsV2KeysAsymDeletesPost200
667695 public KmsV2KeysAsymGet200Response GetP12KeyDetails ( string keyId )
668696 {
669697 logger . Debug ( "CALLING API \" GetP12KeyDetails\" STARTED" ) ;
698+ this . SetStatusCode ( null ) ;
670699 ApiResponse < KmsV2KeysAsymGet200Response > localVarResponse = GetP12KeyDetailsWithHttpInfo ( keyId ) ;
671700 logger . Debug ( "CALLING API \" GetP12KeyDetails\" ENDED" ) ;
701+ this . SetStatusCode ( localVarResponse . StatusCode ) ;
672702 return localVarResponse . Data ;
673703 }
674704
@@ -737,7 +767,7 @@ public ApiResponse< KmsV2KeysAsymGet200Response > GetP12KeyDetailsWithHttpInfo (
737767
738768 if ( ExceptionFactory != null )
739769 {
740- Exception exception = ExceptionFactory ( "GetP12KeyDetails" , localVarResponse ) ;
770+ ApiException exception = ( ApiException ) ExceptionFactory ( "GetP12KeyDetails" , localVarResponse ) ;
741771 if ( exception != null )
742772 {
743773 logger . Error ( $ "Exception : { exception . Message } ") ;
@@ -759,8 +789,10 @@ public ApiResponse< KmsV2KeysAsymGet200Response > GetP12KeyDetailsWithHttpInfo (
759789 public async System . Threading . Tasks . Task < KmsV2KeysAsymGet200Response > GetP12KeyDetailsAsync ( string keyId )
760790 {
761791 logger . Debug ( "CALLING API \" GetP12KeyDetailsAsync\" STARTED" ) ;
792+ this . SetStatusCode ( null ) ;
762793 ApiResponse < KmsV2KeysAsymGet200Response > localVarResponse = await GetP12KeyDetailsAsyncWithHttpInfo ( keyId ) ;
763794 logger . Debug ( "CALLING API \" GetP12KeyDetailsAsync\" ENDED" ) ;
795+ this . SetStatusCode ( localVarResponse . StatusCode ) ;
764796 return localVarResponse . Data ;
765797
766798 }
@@ -830,7 +862,7 @@ public async System.Threading.Tasks.Task<ApiResponse<KmsV2KeysAsymGet200Response
830862
831863 if ( ExceptionFactory != null )
832864 {
833- Exception exception = ExceptionFactory ( "GetP12KeyDetails" , localVarResponse ) ;
865+ ApiException exception = ( ApiException ) ExceptionFactory ( "GetP12KeyDetails" , localVarResponse ) ;
834866 if ( exception != null )
835867 {
836868 logger . Error ( $ "Exception : { exception . Message } ") ;
0 commit comments