Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="LoanStreet.LoanServicing.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="principal"></param>
        /// <returns>Task of JwtAuthenticationToken</returns>
        public async System.Threading.Tasks.Task <JwtAuthenticationToken> PrincipalAsync(JwtAuthenticationToken principal)
        {
            LoanStreet.LoanServicing.Client.ApiResponse <JwtAuthenticationToken> localVarResponse = await PrincipalAsyncWithHttpInfo(principal);

            return(localVarResponse.Data);
        }
Example #2
0
        /// <summary>
        ///
        /// </summary>
        /// <exception cref="LoanStreet.LoanServicing.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="principal"></param>
        /// <returns>Task of ApiResponse (JwtAuthenticationToken)</returns>
        public async System.Threading.Tasks.Task <LoanStreet.LoanServicing.Client.ApiResponse <JwtAuthenticationToken> > PrincipalAsyncWithHttpInfo(JwtAuthenticationToken principal)
        {
            // verify the required parameter 'principal' is set
            if (principal == null)
            {
                throw new LoanStreet.LoanServicing.Client.ApiException(400, "Missing required parameter 'principal' when calling AuthorizationApi->Principal");
            }


            LoanStreet.LoanServicing.Client.RequestOptions localVarRequestOptions = new LoanStreet.LoanServicing.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (principal != null)
            {
                foreach (var _kvp in LoanStreet.LoanServicing.Client.ClientUtils.ParameterToMultiMap("", "principal", principal))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <JwtAuthenticationToken>("/v1/public/principal", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("Principal", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #3
0
 /// <summary>
 ///
 /// </summary>
 /// <exception cref="LoanStreet.LoanServicing.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="principal"></param>
 /// <returns>JwtAuthenticationToken</returns>
 public JwtAuthenticationToken Principal(JwtAuthenticationToken principal)
 {
     LoanStreet.LoanServicing.Client.ApiResponse <JwtAuthenticationToken> localVarResponse = PrincipalWithHttpInfo(principal);
     return(localVarResponse.Data);
 }