pub struct CancelByIdRequest {
pub order_id_type: Option<String>,
pub order_id: String,
pub client_order_id: Uuid,
}Expand description
POST /api/v1/orders/cancel and /orders/cancel/sync body: the order is named in the body, not
in the path (the /orders/{id}/cancel of CancelOrderRequest is the deprecated form).
§Examples
use brokapi_bcs_protocol::http::models::CancelByIdRequest;
use uuid::Uuid;
let original = Uuid::nil();
let req = CancelByIdRequest::by_client_order_id(original, Uuid::nil());
let json = serde_json::to_value(&req)?;
assert_eq!(json["orderIdType"], "1");
assert_eq!(json["orderId"], "00000000-0000-0000-0000-000000000000");Fields§
§order_id_type: Option<String>1 = order_id is the clientOrderId of the original order (default), 2 = exchange order id.
order_id: StringThe id of the order to cancel, of the kind named by order_id_type. For kind 1 a UUID text, for kind 2 the exchange id in the form YYMMDD-ClassCode-OrderNumber.
client_order_id: UuidId of this request, a new UUID.
Implementations§
Source§impl CancelByIdRequest
impl CancelByIdRequest
Sourcepub fn by_client_order_id(original: Uuid, request_id: Uuid) -> Self
pub fn by_client_order_id(original: Uuid, request_id: Uuid) -> Self
Builds a cancel for the order whose clientOrderId is original.
request_id is the id of the cancel request itself, a new UUID. The call sets the id kind to
1 (the clientOrderId of the original). To cancel by the exchange id build the struct
yourself with order_id_type = Some("2").
Trait Implementations§
Source§impl Clone for CancelByIdRequest
impl Clone for CancelByIdRequest
Source§fn clone(&self) -> CancelByIdRequest
fn clone(&self) -> CancelByIdRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CancelByIdRequest
impl Debug for CancelByIdRequest
Source§impl PartialEq for CancelByIdRequest
impl PartialEq for CancelByIdRequest
Source§fn eq(&self, other: &CancelByIdRequest) -> bool
fn eq(&self, other: &CancelByIdRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CancelByIdRequest
impl Serialize for CancelByIdRequest
impl StructuralPartialEq for CancelByIdRequest
Auto Trait Implementations§
impl Freeze for CancelByIdRequest
impl RefUnwindSafe for CancelByIdRequest
impl Send for CancelByIdRequest
impl Sync for CancelByIdRequest
impl Unpin for CancelByIdRequest
impl UnsafeUnpin for CancelByIdRequest
impl UnwindSafe for CancelByIdRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more