Example #1
0
        /// <summary>
        /// Obtain auhtorization token for other requests
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="inlineObject"></param>
        /// <returns>ApiResponse of InlineResponse200</returns>
        public SimpleFx.Client.Generated.Client.ApiResponse <InlineResponse200> ApiV3AuthKeyPostWithHttpInfo(InlineObject inlineObject)
        {
            // verify the required parameter 'inlineObject' is set
            if (inlineObject == null)
            {
                throw new SimpleFx.Client.Generated.Client.ApiException(400, "Missing required parameter 'inlineObject' when calling AUTHENTICATIONApi->ApiV3AuthKeyPost");
            }

            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.Client.RequestOptions();

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

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

            var localVarContentType = SimpleFx.Client.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

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

            var localVarAccept = SimpleFx.Client.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts);

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

            localVarRequestOptions.Data = inlineObject;


            // make the HTTP request
            var localVarResponse = this.Client.Post <InlineResponse200>("/api/v3/auth/key", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Example #2
0
        /// <summary>
        /// List your trading and demo accounts This Request is limmited.  It can not be called more than once per 5 minutes.  Client shall store and track account status returned with trade execution report.
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of InlineResponse2002</returns>
        public SimpleFx.Client.Generated.Client.ApiResponse <InlineResponse2002> V3AccountsGetAccountsWithHttpInfo()
        {
            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.Client.RequestOptions();

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

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

            var localVarContentType = SimpleFx.Client.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

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

            var localVarAccept = SimpleFx.Client.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts);

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


            // authentication (bearerAuth) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + SimpleFx.Client.Generated.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <InlineResponse2002>("/api/v3/accounts", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Example #3
0
        /// <summary>
        /// Obtain auhtorization token for other requests
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="inlineObject"></param>
        /// <returns>Task of ApiResponse (InlineResponse200)</returns>
        public async System.Threading.Tasks.Task <SimpleFx.Client.Generated.Client.ApiResponse <InlineResponse200> > ApiV3AuthKeyPostAsyncWithHttpInfo(InlineObject inlineObject)
        {
            // verify the required parameter 'inlineObject' is set
            if (inlineObject == null)
            {
                throw new SimpleFx.Client.Generated.Client.ApiException(400, "Missing required parameter 'inlineObject' when calling AUTHENTICATIONApi->ApiV3AuthKeyPost");
            }


            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.Client.RequestOptions();

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

            // 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);
            }

            localVarRequestOptions.Data = inlineObject;


            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <InlineResponse200>("/api/v3/auth/key", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Example #4
0
        /// <summary>
        /// List your trading and demo accounts This Request is limmited.  It can not be called more than once per 5 minutes.  Client shall store and track account status returned with trade execution report.
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (InlineResponse2002)</returns>
        public async System.Threading.Tasks.Task <SimpleFx.Client.Generated.Client.ApiResponse <InlineResponse2002> > V3AccountsGetAccountsAsyncWithHttpInfo()
        {
            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.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);
            }


            // authentication (bearerAuth) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + SimpleFx.Client.Generated.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <InlineResponse2002>("/api/v3/accounts", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Example #5
0
        /// <summary>
        /// List tradable instruments List all tradable assets (instruments, equities, securities).
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of Dictionary&lt;string, InlineResponse2001&gt;</returns>
        public SimpleFx.Client.Generated.Client.ApiResponse <Dictionary <string, InlineResponse2001> > UtilsInstrumentsJsonGetWithHttpInfo()
        {
            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.Client.RequestOptions();

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

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

            var localVarContentType = SimpleFx.Client.Generated.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

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

            var localVarAccept = SimpleFx.Client.Generated.Client.ClientUtils.SelectHeaderAccept(_accepts);

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



            // make the HTTP request
            var localVarResponse = this.Client.Get <Dictionary <string, InlineResponse2001> >("/utils/instruments.json", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Example #6
0
        /// <summary>
        /// List tradable instruments List all tradable assets (instruments, equities, securities).
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (Dictionary&lt;string, InlineResponse2001&gt;)</returns>
        public async System.Threading.Tasks.Task <SimpleFx.Client.Generated.Client.ApiResponse <Dictionary <string, InlineResponse2001> > > UtilsInstrumentsJsonGetAsyncWithHttpInfo()
        {
            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.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);
            }



            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <Dictionary <string, InlineResponse2001> >("/utils/instruments.json", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }
Example #7
0
        /// <summary>
        /// Get status of an account This Request is limmited.  It can not be called more than once per 5 minutes.  Client shall store and track account status returned with trade execution report.
        /// </summary>
        /// <exception cref="SimpleFx.Client.Generated.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="reality"></param>
        /// <param name="account"></param>
        /// <returns>Task of ApiResponse (InlineResponse2003)</returns>
        public async System.Threading.Tasks.Task <SimpleFx.Client.Generated.Client.ApiResponse <InlineResponse2003> > V3AccountsGetAccountAsyncWithHttpInfo(Reality reality, int account)
        {
            // verify the required parameter 'reality' is set
            if (reality == null)
            {
                throw new SimpleFx.Client.Generated.Client.ApiException(400, "Missing required parameter 'reality' when calling AccountsApi->V3AccountsGetAccount");
            }

            // verify the required parameter 'account' is set
            if (account == null)
            {
                throw new SimpleFx.Client.Generated.Client.ApiException(400, "Missing required parameter 'account' when calling AccountsApi->V3AccountsGetAccount");
            }


            SimpleFx.Client.Generated.Client.RequestOptions localVarRequestOptions = new SimpleFx.Client.Generated.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 (reality != null)
            {
                localVarRequestOptions.PathParameters.Add("reality", SimpleFx.Client.Generated.Client.ClientUtils.ParameterToString(reality)); // path parameter
            }
            if (account != null)
            {
                localVarRequestOptions.PathParameters.Add("account", SimpleFx.Client.Generated.Client.ClientUtils.ParameterToString(account)); // path parameter
            }
            // authentication (bearerAuth) required
            // http basic authentication required
            if (!String.IsNullOrEmpty(this.Configuration.Username) || !String.IsNullOrEmpty(this.Configuration.Password))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Basic " + SimpleFx.Client.Generated.Client.ClientUtils.Base64Encode(this.Configuration.Username + ":" + this.Configuration.Password));
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <InlineResponse2003>("/api/v3/accounts/{reality}/{account}", localVarRequestOptions, this.Configuration);

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

            return(localVarResponse);
        }