/// <summary>
        /// Authenticate a user This endpoint authenticates a user.
        /// </summary>
        /// <exception cref="eZmaxApi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eSessionType"></param>
        /// <param name="authenticateAuthenticateV2Request"></param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of ApiResponse (AuthenticateAuthenticateV2Response)</returns>
        public async System.Threading.Tasks.Task <eZmaxApi.Client.ApiResponse <AuthenticateAuthenticateV2Response> > AuthenticateAuthenticateV2WithHttpInfoAsync(string eSessionType, AuthenticateAuthenticateV2Request authenticateAuthenticateV2Request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            // verify the required parameter 'eSessionType' is set
            if (eSessionType == null)
            {
                throw new eZmaxApi.Client.ApiException(400, "Missing required parameter 'eSessionType' when calling ModuleAuthenticateApi->AuthenticateAuthenticateV2");
            }

            // verify the required parameter 'authenticateAuthenticateV2Request' is set
            if (authenticateAuthenticateV2Request == null)
            {
                throw new eZmaxApi.Client.ApiException(400, "Missing required parameter 'authenticateAuthenticateV2Request' when calling ModuleAuthenticateApi->AuthenticateAuthenticateV2");
            }


            eZmaxApi.Client.RequestOptions localVarRequestOptions = new eZmaxApi.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json"
            };

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


            var localVarContentType = eZmaxApi.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = eZmaxApi.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.PathParameters.Add("eSessionType", eZmaxApi.Client.ClientUtils.ParameterToString(eSessionType)); // path parameter
            localVarRequestOptions.Data = authenticateAuthenticateV2Request;

            // authentication (Authorization) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization")))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization"));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <AuthenticateAuthenticateV2Response>("/2/module/authenticate/authenticate/{eSessionType}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false);

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

            return(localVarResponse);
        }
        /// <summary>
        /// Authenticate a user This endpoint authenticates a user.
        /// </summary>
        /// <exception cref="eZmaxApi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eSessionType"></param>
        /// <param name="authenticateAuthenticateV2Request"></param>
        /// <param name="cancellationToken">Cancellation Token to cancel the request.</param>
        /// <returns>Task of AuthenticateAuthenticateV2Response</returns>
        public async System.Threading.Tasks.Task <AuthenticateAuthenticateV2Response> AuthenticateAuthenticateV2Async(string eSessionType, AuthenticateAuthenticateV2Request authenticateAuthenticateV2Request, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
        {
            eZmaxApi.Client.ApiResponse <AuthenticateAuthenticateV2Response> localVarResponse = await AuthenticateAuthenticateV2WithHttpInfoAsync(eSessionType, authenticateAuthenticateV2Request, cancellationToken).ConfigureAwait(false);

            return(localVarResponse.Data);
        }
Exemple #3
0
        /// <summary>
        /// Authenticate a user This endpoint authenticates a user.
        /// </summary>
        /// <exception cref="eZmaxApi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eSessionType"></param>
        /// <param name="authenticateAuthenticateV2Request"></param>
        /// <param name="cancellationToken">Cancellation Token to cancel request (optional) </param>
        /// <returns>Task of ApiResponse (AuthenticateAuthenticateV2Response)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <AuthenticateAuthenticateV2Response> > AuthenticateAuthenticateV2WithHttpInfoAsync(string eSessionType, AuthenticateAuthenticateV2Request authenticateAuthenticateV2Request, CancellationToken cancellationToken = default(CancellationToken))
        {
            // verify the required parameter 'eSessionType' is set
            if (eSessionType == null)
            {
                throw new ApiException(400, "Missing required parameter 'eSessionType' when calling ModuleAuthenticateApi->AuthenticateAuthenticateV2");
            }
            // verify the required parameter 'authenticateAuthenticateV2Request' is set
            if (authenticateAuthenticateV2Request == null)
            {
                throw new ApiException(400, "Missing required parameter 'authenticateAuthenticateV2Request' when calling ModuleAuthenticateApi->AuthenticateAuthenticateV2");
            }

            var    localVarPath         = "/2/module/authenticate/authenticate/{eSessionType}";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (eSessionType != null)
            {
                localVarPathParams.Add("eSessionType", this.Configuration.ApiClient.ParameterToString(eSessionType));                       // path parameter
            }
            if (authenticateAuthenticateV2Request != null && authenticateAuthenticateV2Request.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(authenticateAuthenticateV2Request); // http body (model) parameter
            }
            else
            {
                localVarPostBody = authenticateAuthenticateV2Request; // byte array
            }

            // authentication (Authorization) required
            if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization")))
            {
                localVarHeaderParams["Authorization"] = this.Configuration.GetApiKeyWithPrefix("Authorization");
            }

            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)await this.Configuration.ApiClient.CallApiAsync(localVarPath,
                                                                                                            Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                            localVarPathParams, localVarHttpContentType, cancellationToken);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("AuthenticateAuthenticateV2", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <AuthenticateAuthenticateV2Response>(localVarStatusCode,
                                                                        localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                                                        (AuthenticateAuthenticateV2Response)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(AuthenticateAuthenticateV2Response))));
        }
 /// <summary>
 /// Authenticate a user This endpoint authenticates a user.
 /// </summary>
 /// <exception cref="eZmaxApi.Client.ApiException">Thrown when fails to make API call</exception>
 /// <param name="eSessionType"></param>
 /// <param name="authenticateAuthenticateV2Request"></param>
 /// <returns>AuthenticateAuthenticateV2Response</returns>
 public AuthenticateAuthenticateV2Response AuthenticateAuthenticateV2(string eSessionType, AuthenticateAuthenticateV2Request authenticateAuthenticateV2Request)
 {
     eZmaxApi.Client.ApiResponse <AuthenticateAuthenticateV2Response> localVarResponse = AuthenticateAuthenticateV2WithHttpInfo(eSessionType, authenticateAuthenticateV2Request);
     return(localVarResponse.Data);
 }
Exemple #5
0
        /// <summary>
        /// Authenticate a user This endpoint authenticates a user.
        /// </summary>
        /// <exception cref="eZmaxApi.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="eSessionType"></param>
        /// <param name="authenticateAuthenticateV2Request"></param>
        /// <param name="cancellationToken">Cancellation Token to cancel request (optional) </param>
        /// <returns>Task of AuthenticateAuthenticateV2Response</returns>
        public async System.Threading.Tasks.Task <AuthenticateAuthenticateV2Response> AuthenticateAuthenticateV2Async(string eSessionType, AuthenticateAuthenticateV2Request authenticateAuthenticateV2Request, CancellationToken cancellationToken = default(CancellationToken))
        {
            ApiResponse <AuthenticateAuthenticateV2Response> localVarResponse = await AuthenticateAuthenticateV2WithHttpInfoAsync(eSessionType, authenticateAuthenticateV2Request, cancellationToken);

            return(localVarResponse.Data);
        }