/// <summary> /// Cancel order request Request cancel for an existing order. The order can be canceled using the `client_order_id` or `exchange_order_id`. /// </summary> /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="orderCancelSingleRequest">OrderCancelSingleRequest object.</param> /// <returns>Task of ApiResponse (OrderExecutionReport)</returns> public async System.Threading.Tasks.Task <CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> > V1OrdersCancelPostAsyncWithHttpInfo(OrderCancelSingleRequest orderCancelSingleRequest) { // verify the required parameter 'orderCancelSingleRequest' is set if (orderCancelSingleRequest == null) { throw new CoinAPI.OMS.API.SDK.Client.ApiException(400, "Missing required parameter 'orderCancelSingleRequest' when calling OrdersApi->V1OrdersCancelPost"); } CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json", "appliction/json" }; foreach (var _contentType in _contentTypes) { localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType); } foreach (var _accept in _accepts) { localVarRequestOptions.HeaderParameters.Add("Accept", _accept); } localVarRequestOptions.Data = orderCancelSingleRequest; // make the HTTP request var localVarResponse = await this.AsynchronousClient.PostAsync <OrderExecutionReport>("/v1/orders/cancel", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("V1OrdersCancelPost", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Cancel order request Request cancel for an existing order. The order can be canceled using the `client_order_id` or `exchange_order_id`. /// </summary> /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="orderCancelSingleRequest">OrderCancelSingleRequest object.</param> /// <returns>ApiResponse of OrderExecutionReport</returns> public CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> V1OrdersCancelPostWithHttpInfo(OrderCancelSingleRequest orderCancelSingleRequest) { // verify the required parameter 'orderCancelSingleRequest' is set if (orderCancelSingleRequest == null) { throw new CoinAPI.OMS.API.SDK.Client.ApiException(400, "Missing required parameter 'orderCancelSingleRequest' when calling OrdersApi->V1OrdersCancelPost"); } CoinAPI.OMS.API.SDK.Client.RequestOptions localVarRequestOptions = new CoinAPI.OMS.API.SDK.Client.RequestOptions(); String[] _contentTypes = new String[] { "application/json" }; // to determine the Accept header String[] _accepts = new String[] { "application/json", "appliction/json" }; var localVarContentType = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = CoinAPI.OMS.API.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.Data = orderCancelSingleRequest; // make the HTTP request var localVarResponse = this.Client.Post <OrderExecutionReport>("/v1/orders/cancel", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("V1OrdersCancelPost", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// Cancel order request Request cancel for an existing order. The order can be canceled using the `client_order_id` or `exchange_order_id`. /// </summary> /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="orderCancelSingleRequest">OrderCancelSingleRequest object.</param> /// <returns>Task of OrderExecutionReport</returns> public async System.Threading.Tasks.Task <OrderExecutionReport> V1OrdersCancelPostAsync(OrderCancelSingleRequest orderCancelSingleRequest) { CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> localVarResponse = await V1OrdersCancelPostAsyncWithHttpInfo(orderCancelSingleRequest); return(localVarResponse.Data); }
/// <summary> /// Cancel order request Request cancel for an existing order. The order can be canceled using the `client_order_id` or `exchange_order_id`. /// </summary> /// <exception cref="CoinAPI.OMS.API.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="orderCancelSingleRequest">OrderCancelSingleRequest object.</param> /// <returns>OrderExecutionReport</returns> public OrderExecutionReport V1OrdersCancelPost(OrderCancelSingleRequest orderCancelSingleRequest) { CoinAPI.OMS.API.SDK.Client.ApiResponse <OrderExecutionReport> localVarResponse = V1OrdersCancelPostWithHttpInfo(orderCancelSingleRequest); return(localVarResponse.Data); }