Add defaults for outgoing types
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
@@ -6,10 +6,7 @@ use crate::{
|
||||
},
|
||||
database,
|
||||
types::{
|
||||
alpaca::{
|
||||
self,
|
||||
shared::{Sort, Source},
|
||||
},
|
||||
alpaca::{self, shared::Source},
|
||||
news::Prediction,
|
||||
Backfill, Bar, Class, News,
|
||||
},
|
||||
@@ -176,19 +173,13 @@ fn us_equity_query_constructor(
|
||||
fetch_to: OffsetDateTime,
|
||||
next_page_token: Option<String>,
|
||||
) -> alpaca::api::outgoing::bar::Bar {
|
||||
alpaca::api::outgoing::bar::Bar::UsEquity {
|
||||
alpaca::api::outgoing::bar::Bar::UsEquity(alpaca::api::outgoing::bar::UsEquity {
|
||||
symbols: vec![symbol],
|
||||
timeframe: ONE_MINUTE,
|
||||
start: Some(fetch_from),
|
||||
end: Some(fetch_to),
|
||||
limit: Some(10000),
|
||||
adjustment: Some(alpaca::api::outgoing::bar::Adjustment::All),
|
||||
asof: None,
|
||||
feed: Some(*ALPACA_SOURCE),
|
||||
currency: None,
|
||||
page_token: next_page_token,
|
||||
sort: Some(Sort::Asc),
|
||||
}
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
fn crypto_query_constructor(
|
||||
@@ -197,15 +188,13 @@ fn crypto_query_constructor(
|
||||
fetch_to: OffsetDateTime,
|
||||
next_page_token: Option<String>,
|
||||
) -> alpaca::api::outgoing::bar::Bar {
|
||||
alpaca::api::outgoing::bar::Bar::Crypto {
|
||||
alpaca::api::outgoing::bar::Bar::Crypto(alpaca::api::outgoing::bar::Crypto {
|
||||
symbols: vec![symbol],
|
||||
timeframe: ONE_MINUTE,
|
||||
start: Some(fetch_from),
|
||||
end: Some(fetch_to),
|
||||
limit: Some(10000),
|
||||
page_token: next_page_token,
|
||||
sort: Some(Sort::Asc),
|
||||
}
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
@@ -335,11 +324,8 @@ impl Handler for NewsHandler {
|
||||
symbols: vec![symbol.clone()],
|
||||
start: Some(fetch_from),
|
||||
end: Some(fetch_to),
|
||||
limit: Some(50),
|
||||
include_content: Some(true),
|
||||
exclude_contentless: Some(false),
|
||||
page_token: next_page_token.clone(),
|
||||
sort: Some(Sort::Asc),
|
||||
..Default::default()
|
||||
},
|
||||
None,
|
||||
)
|
||||
|
Reference in New Issue
Block a user