pub async fn account_executions(
        &self,
        account_number: &str,
        start_time: Option<DateTime<Utc>>,
        end_time: Option<DateTime<Utc>>,
    ) -> Result<Vec<AccountExecution>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountExecutionsResponse {
            executions: Vec<AccountExecution>,
        }

        let mut query_params: Vec<(&str, String)> = Vec::new();
        if let Some(start_time) = start_time {
            query_params.push(("startTime", start_time.to_rfc3339()))
        }

        if let Some(end_time) = end_time {
            query_params.push(("endTime", end_time.to_rfc3339()))
        }

        let response = self
            .get_request_builder(format!("accounts/{}/executions", account_number).as_str())?
            .query(query_params.as_slice())
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountExecutionsResponse>()
            .await?;

        Ok(response.executions)
    }
/// Retrieves executions for a specific account.
///
/// Parameters:
///     - `start_time` optional start of time range. Defaults to start of today, 12:00am
///     - `end_time` optional end of time range. Defaults to end of today, 11:59pm
Retrieves executions for a specific account.
Parameters:
`start_time` optional start of time range. Defaults to start of today, 12:00am
`end_time` optional end of time range. Defaults to end of today, 11:59pm
Retrieves executions for a specific account . Parameters : ` start_time ` optional start of time range . Defaults to start of today 12 : 00am ` end_time ` optional end of time range . Defaults to end of today 11 : 59pm
pub async fn account_executions(
        &self,
        account_number: &str,
        start_time: Option<DateTime<Utc>>,
        end_time: Option<DateTime<Utc>>,
    ) -> Result<Vec<AccountExecution>, Box<dyn Error>> {
        #[derive(Serialize, Deserialize)]
        struct AccountExecutionsResponse {
            executions: Vec<AccountExecution>,
        }
        let mut query_params: Vec<(&str, String)> = Vec::new();
        if let Some(start_time) = start_time {
            query_params.push(("startTime", start_time.to_rfc3339()))
        }
        if let Some(end_time) = end_time {
            query_params.push(("endTime", end_time.to_rfc3339()))
        }
        let response = self
            .get_request_builder(format!("accounts/{}/executions", account_number).as_str())?
            .query(query_params.as_slice())
            .send()
            .await?
            .error_for_status()
            .map_err(|e| wrap_error(e))?
            .json::<AccountExecutionsResponse>()
            .await?;
        Ok(response.executions)
    }
pub async fn account_executions ( & self , account_number : & str , start_time : Option < DateTime < Utc > > , end_time : Option < DateTime < Utc > > , ) -> Result < Vec < AccountExecution > , Box < dyn Error > > { # [ derive ( Serialize Deserialize ) ] struct AccountExecutionsResponse { executions : Vec < AccountExecution > , } let mut query_params : Vec < ( & str , String ) > = Vec :: new ( ) ; if let Some ( start_time ) = start_time { query_params . push ( ( " " , start_time . to_rfc3339 ( ) ) ) } if let Some ( end_time ) = end_time { query_params . push ( ( " " , end_time . to_rfc3339 ( ) ) ) } let response = self . get_request_builder ( format ! ( " " account_number ) . as_str ( ) ) ? . query ( query_params . as_slice ( ) ) . send ( ) . await ? . error_for_status ( ) . map_err ( | e | wrap_error ( e ) ) ? . json :: < AccountExecutionsResponse > ( ) . await ? ; Ok ( response . executions ) }
Retrieves executions for a specific account.
Retrieves executions for a specific account .
&self
account_number
&str
start_time
Option<DateTime<Utc>>
end_time
Option<DateTime<Utc>>
&self
account_number
&str
start_time
Option<DateTime<Utc>>
end_time
Option<DateTime<Utc>>