pub async fn account_order(
        &self,
        account_number: &str,
        order_id: OrderId,
    ) -> Result<Option<AccountOrder>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountOrdersResponse {
            orders: Vec<AccountOrder>,
        }

        let mut response = self
            .get_request_builder(
                format!("accounts/{}/orders/{}", account_number, order_id).as_str(),
            )?
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountOrdersResponse>()
            .await?;

        return Ok(response.orders.pop());
    }
/// Retrieve details for an order with a specific id
Retrieve details for an order with a specific id
Retrieve details for an order with a specific id
pub async fn account_order(
        &self,
        account_number: &str,
        order_id: OrderId,
    ) -> Result<Option<AccountOrder>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountOrdersResponse {
            orders: Vec<AccountOrder>,
        }
        let mut response = self
            .get_request_builder(
                format!("accounts/{}/orders/{}", account_number, order_id).as_str(),
            )?
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountOrdersResponse>()
            .await?;
        return Ok(response.orders.pop());
    }
pub async fn account_order ( & self , account_number : & str , order_id : OrderId , ) -> Result < Option < AccountOrder > , Box < dyn Error > > { # [ derive ( Serialize Deserialize ) ] struct AccountOrdersResponse { orders : Vec < AccountOrder > , } let mut response = self . get_request_builder ( format ! ( " " account_number order_id ) . as_str ( ) , ) ? . send ( ) . await ? . error_for_status ( ) . map_err ( | e | wrap_error ( e ) ) ? . json :: < AccountOrdersResponse > ( ) . await ? ; return Ok ( response . orders . pop ( ) ) ; }
Retrieve details for an order with a specific id
Retrieve details for an order with a specific id
&self
account_number
&str
order_id
OrderId
&self
account_number
&str
order_id
OrderId