pub async fn account_activity(
        &self,
        account_number: &str,
        start_time: DateTime<Utc>,
        end_time: DateTime<Utc>,
    ) -> Result<Vec<AccountActivity>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountActivityResponse {
            activities: Vec<AccountActivity>,
        }

        let response = self
            .get_request_builder(format!("accounts/{}/activities", account_number).as_str())?
            .query(&[
                ("startTime", start_time.to_rfc3339()),
                ("endTime", end_time.to_rfc3339()),
            ])
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountActivityResponse>()
            .await?;

        Ok(response.activities)
    }
/// Retrieve account activities, including cash transactions, dividends, trades, etc.
Retrieve account activities, including cash transactions, dividends, trades, etc.
Retrieve account activities including cash transactions dividends trades etc .
pub async fn account_activity(
        &self,
        account_number: &str,
        start_time: DateTime<Utc>,
        end_time: DateTime<Utc>,
    ) -> Result<Vec<AccountActivity>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountActivityResponse {
            activities: Vec<AccountActivity>,
        }
        let response = self
            .get_request_builder(format!("accounts/{}/activities", account_number).as_str())?
            .query(&[
                ("startTime", start_time.to_rfc3339()),
                ("endTime", end_time.to_rfc3339()),
            ])
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountActivityResponse>()
            .await?;
        Ok(response.activities)
    }
pub async fn account_activity ( & self , account_number : & str , start_time : DateTime < Utc > , end_time : DateTime < Utc > , ) -> Result < Vec < AccountActivity > , Box < dyn Error > > { # [ derive ( Serialize Deserialize ) ] struct AccountActivityResponse { activities : Vec < AccountActivity > , } let response = self . get_request_builder ( format ! ( " " account_number ) . as_str ( ) ) ? . query ( & [ ( " " , start_time . to_rfc3339 ( ) ) , ( " " , end_time . to_rfc3339 ( ) ) , ] ) . send ( ) . await ? . error_for_status ( ) . map_err ( | e | wrap_error ( e ) ) ? . json :: < AccountActivityResponse > ( ) . await ? ; Ok ( response . activities ) }
Retrieve account activities, including cash transactions, dividends, trades, etc.
Retrieve account activities including cash transactions dividends trades etc .
&self
account_number
&str
start_time
DateTime<Utc>
end_time
DateTime<Utc>
&self
account_number
&str
start_time
DateTime<Utc>
end_time
DateTime<Utc>