pub struct EditOrderRequest {
pub order_id_type: Option<String>,
pub order_id: String,
pub client_order_id: Uuid,
pub order_type: Option<OrderType>,
pub price: Option<Decimal>,
pub order_quantity: i64,
pub extras: OrderExtras,
}Expand description
POST /api/v1/orders/edit and /orders/edit/sync body. The edit is a cancel of the original and
a new order (docs), so client_order_id is the id of the new one.
§Examples
use brokapi_bcs_protocol::http::models::{EditOrderRequest, OrderExtras};
use uuid::Uuid;
let req = EditOrderRequest {
order_id_type: None,
order_id: Uuid::nil().to_string(),
client_order_id: Uuid::nil(),
order_type: None,
price: Some(dec!(301.0)),
order_quantity: 5,
extras: OrderExtras::default(),
};
let json = serde_json::to_value(&req)?;
assert_eq!(json["price"], 301.0);
assert!(json.get("orderIdType").is_none()); // the broker default (1) appliesFields§
§order_id_type: Option<String>1 (default) if order_id is the clientOrderId of the original order, 2 if it is the exchange order id.
order_id: StringThe id of the order to change, of the kind named by order_id_type.
client_order_id: UuidThe id of the new order that replaces the original. A new UUID.
order_type: Option<OrderType>Type of the new order. Left out when None.
price: Option<Decimal>Price of the new order per piece. Left out when None.
order_quantity: i64Quantity of the new order, in pieces.
extras: OrderExtrasOptional parameters of the new order, flattened into the body.
Trait Implementations§
Source§impl Clone for EditOrderRequest
impl Clone for EditOrderRequest
Source§fn clone(&self) -> EditOrderRequest
fn clone(&self) -> EditOrderRequest
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 EditOrderRequest
impl Debug for EditOrderRequest
Source§impl PartialEq for EditOrderRequest
impl PartialEq for EditOrderRequest
Source§fn eq(&self, other: &EditOrderRequest) -> bool
fn eq(&self, other: &EditOrderRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for EditOrderRequest
impl Serialize for EditOrderRequest
impl StructuralPartialEq for EditOrderRequest
Auto Trait Implementations§
impl Freeze for EditOrderRequest
impl RefUnwindSafe for EditOrderRequest
impl Send for EditOrderRequest
impl Sync for EditOrderRequest
impl Unpin for EditOrderRequest
impl UnsafeUnpin for EditOrderRequest
impl UnwindSafe for EditOrderRequest
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