/// <summary>
        /// Submit cancellation for multiple orders at once with given ids
        /// <para>Body data</para>
        /// <para>string errorCode</para>
        /// <para>string errorMessage</para>
        /// </summary>
        /// <param name="request"></param>
        /// <returns>CancelOrdersByIdsResponse</returns>
        public void CancelOrdersByIdsAsync(CancelOrdersByIdsRequest request,
                                           System.Action <CancelOrdersByIdsResponse.Body, string, string> action = null)
        {
            string url = _urlBuilder.Build(POST_METHOD, $"/v1/order/orders/batchcancel");

            HttpRequest.PostAsync <CancelOrdersByIdsResponse>(url, request.ToJson()).ContinueWith((task) => {
                if (action != null)
                {
                    var res = task.Result;
                    action(res.data, res.errorCode, res.errorMessage);
                }
            });
        }
Exemple #2
0
        /// <summary>
        /// Submit cancellation for multiple orders at once with given ids
        /// </summary>
        /// <param name="request"></param>
        /// <returns>CancelOrdersByIdsResponse</returns>
        public async Task <CancelOrdersByIdsResponse> CancelOrdersByIdsAsync(CancelOrdersByIdsRequest request)
        {
            string url = _urlBuilder.Build(POST_METHOD, $"/v1/order/orders/batchcancel");

            return(await HttpRequest.PostAsync <CancelOrdersByIdsResponse>(url, request.ToJson()));
        }