GetRangeParams
The parameter struct and builder for ReferenceClient::corporate_actions::get_range.
The builder can be instantiated with the associated function builder(), and the struct is created from the builder with the build() method.
For every field, there is an identically named setter method on the builder.
Fields
| Parameter | Type | Description |
|---|---|---|
start | OffsetDateTime | The inclusive start of the request range based on index. |
end | Option<OffsetDateTime> | The exclusive end of the request range based on index. If None, then will return all data available after start. |
index | Index | The index column to use for filtering the start and end time range and for record ordering. Use any of EventDate, ExDate or TsRecord. Records with a NULL value in the specified index column will be excluded. |
symbols | Symbols | The symbols to filter for. Takes up to 2,000 symbols per request. If more than 1 symbol is specified, the data is merged and sorted by time. If 'ALL_SYMBOLS' or None then will select all symbols by default. |
stype_in | SType | The symbology type of input symbols. |
events | Vec<Event> | |
countries | Vec<Country> | The listing countries to filter for. Takes any number of country codes per request as two letter ISO 3166-1 alpha-2 strings. If not specified then will select all countries by default. See CNTRY enum. |
security_types | Vec<SecurityType> | The security types to filter for. If not specified then will select all security types by default. See SECTYPE enum. |
allocate_isins | bool | Whether the request should allocate any new ISINs for plans that are ISIN-limited. If false, the request will drop any rows that would create new allocations. Defaults to true. |
API method
pub struct GetRangeParams {
pub start: OffsetDateTime,
pub end: Option<OffsetDateTime>,
pub index: Index,
pub symbols: Symbols,
pub stype_in: SType,
pub events: Vec<Event>,
pub countries: Vec<Country>,
pub security_types: Vec<SecurityType>,
pub allocate_isins: bool,
} Example usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
use databento::{
ReferenceClient,
dbn::SType,
reference::{
Country,
security::{GetRangeParams, Index},
},
};
use time::macros::{date, datetime};
assert_eq!(
GetRangeParams::builder()
.symbols("AAPL")
.countries([Country::Us])
.start(date!(2005 - 01 - 01))
.build(),
GetRangeParams {
start: datetime!(2005-01-01 00:00 UTC),
end: None,
index: Index::default(),
symbols: "AAPL".into(),
stype_in: SType::RawSymbol,
countries: vec![Country::Us],
security_types: vec![],
allocate_isins: true
}
);