예제 #1
0
        public ApiResponse <object> GetAuthentificationVerify()
        {
            var myClassname = MethodBase.GetCurrentMethod().Name;
            var config      = this.GetDefaultApiConfiguration();
            var api         = new AuthenticateApi(config);

            for (var i = 0; i <= MaxNoOfRetries; i++)
            {
                try
                {
                    var apiResponse = api.VerifyAuthenticationWithHttpInfo();
                    return(apiResponse);

                    ;
                }
                catch (ApiException apiException)
                {
                    this._log.Error($"{MethodBase.GetCurrentMethod().Name} {apiException.ErrorCode} {apiException.ErrorContent}");
                    return(new ApiResponse <object>(apiException.ErrorCode, null, null));

                    ;
                }
                catch (Exception) when(i < MaxNoOfRetries)
                {
                    this._log.Debug($"{myClassname} retry attempt {i}");
                }
            }

            return(new ApiResponse <object>((int)HttpStatusCode.InternalServerError, null, null));
        }
예제 #2
0
 public void Init()
 {
     instance = new AuthenticateApi();
 }