pub async fn create_sell_order(&self, ship_id: String, good: shared::Good, quantity: i32) -> Result<responses::PurchaseOrder, SpaceTradersClientError> {
        let sell_order_request = requests::SellOrderRequest {
            ship_id: ship_id.clone(),
            good,
            quantity,
        };

        let http_client = self.http_client.lock().await;
        let response = http_client.execute_request(
            "POST",
            "https://api.spacetraders.io/my/sell-orders",
            Some(&serde_json::to_string(&sell_order_request).unwrap()),
            Some(&self.token),
        )
            .await?;

        parse_response::<responses::PurchaseOrder>(&response.response_text)
    }
/// Create a sell order to transfer good from your ship to a location. Your ship will
/// automatically sell the good to whatever location it is docked at
///
/// # Arguments
///
/// * `ship` - A Ship struct that you'd like to transfer the goods from
/// * `good` - A Good enum containing the type of good you'd like to transfer
/// * `quantity` - An i32 containing the quantity of good you'd like transferred
Create a sell order to transfer good from your ship to a location. Your ship will
automatically sell the good to whatever location it is docked at
Create a sell order to transfer good from your ship to a location . Your ship will automatically sell the good to whatever location it is docked at
pub async fn create_sell_order(&self, ship_id: String, good: shared::Good, quantity: i32) -> Result<responses::PurchaseOrder, SpaceTradersClientError> {
        let sell_order_request = requests::SellOrderRequest {
            ship_id: ship_id.clone(),
            good,
            quantity,
        };
        let http_client = self.http_client.lock().await;
        let response = http_client.execute_request(
            "POST",
            "https://api.spacetraders.io/my/sell-orders",
            Some(&serde_json::to_string(&sell_order_request).unwrap()),
            Some(&self.token),
        )
            .await?;
        parse_response::<responses::PurchaseOrder>(&response.response_text)
    }
pub async fn create_sell_order ( & self , ship_id : String , good : shared :: Good , quantity : i32 ) -> Result < responses :: PurchaseOrder , SpaceTradersClientError > { let sell_order_request = requests :: SellOrderRequest { ship_id : ship_id . clone ( ) , good , quantity , } ; let http_client = self . http_client . lock ( ) . await ; let response = http_client . execute_request ( " " , " " , Some ( & serde_json :: to_string ( & sell_order_request ) . unwrap ( ) ) , Some ( & self . token ) , ) . await ? ; parse_response :: < responses :: PurchaseOrder > ( & response . response_text ) }
Create a sell order to transfer good from your ship to a location.
Create a sell order to transfer good from your ship to a location .
&self
ship_id
String
good
shared::Good
quantity
i32
&self
ship_id
String
good
shared::Good
quantity
i32