void Validate(ref BfCancelChildOrderRequest request) { if (string.IsNullOrEmpty(request.ChildOrderId) && string.IsNullOrEmpty(request.ChildOrderAcceptanceId)) { throw new ArgumentException(); } }
/// <summary> /// Cancel Order /// <see href="https://scrapbox.io/BitFlyerDotNet/CancelChildOrder">Online help</see> /// </summary> /// <param name="request"></param> /// <returns></returns> public Task <BitFlyerResponse <string> > CancelChildOrderAsync(BfProductCode productCode, string childOrderId, string childOrderAcceptanceId, CancellationToken ct) { var request = new BfCancelChildOrderRequest { ProductCode = productCode, ChildOrderId = childOrderId, ChildOrderAcceptanceId = childOrderAcceptanceId }; Validate(ref request); return(PostPrivateAsync <string>(nameof(CancelChildOrder), request, ct)); }
public BitFlyerResponse <string> CancelChildOrder(BfCancelChildOrderRequest request) { return(PrivatePost <string>(nameof(CancelChildOrder), JsonConvert.SerializeObject(request, _jsonSettings))); }
/// <summary> /// Cancel Order /// <see href="https://scrapbox.io/BitFlyerDotNet/CancelChildOrder">Online help</see> /// </summary> /// <param name="request"></param> /// <returns></returns> public BitFlyerResponse <string> CancelChildOrder(BfCancelChildOrderRequest request) => CancelChildOrderAsync(request, CancellationToken.None).Result;
/// <summary> /// Cancel Order /// <see href="https://scrapbox.io/BitFlyerDotNet/CancelChildOrder">Online help</see> /// </summary> /// <param name="request"></param> /// <returns></returns> public Task <BitFlyerResponse <string> > CancelChildOrderAsync(BfCancelChildOrderRequest request, CancellationToken ct) { Validate(ref request); return(PostPrivateAsync <string>(nameof(CancelChildOrder), request, ct)); }