pub struct FilterRequestBuilder { /* private fields */ }Expand description
Builder for constructing FilterRequest instances.
Provides a fluent API for setting filter parameters and building validated requests.
All methods return self to enable method chaining.
§Examples
use openfigi_rs::model::request::FilterRequestBuilder;
use openfigi_rs::model::enums::{Currency, ExchCode};
let request = FilterRequestBuilder::new()
.query("technology")
.currency(Currency::USD)
.exch_code(ExchCode::US)
.build()
.unwrap();Implementations§
Source§impl FilterRequestBuilder
impl FilterRequestBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new FilterRequestBuilder with all fields unset.
§Examples
use openfigi_rs::model::request::FilterRequestBuilder;
let builder = FilterRequestBuilder::new();Sourcepub fn query(self, query: impl Into<String>) -> Self
pub fn query(self, query: impl Into<String>) -> Self
Sets search keywords for the filter request.
§Examples
use openfigi_rs::model::request::FilterRequestBuilder;
let builder = FilterRequestBuilder::new().query("AAPL");Sourcepub fn start(self, start: impl Into<String>) -> Self
pub fn start(self, start: impl Into<String>) -> Self
Sets the pagination start token.
Used for retrieving subsequent pages of results when the response
contains a next field.
§Examples
use openfigi_rs::model::request::FilterRequestBuilder;
let builder = FilterRequestBuilder::new()
.query("tech")
.start("next_page_token");Sourcepub fn filters_mut(&mut self) -> &mut RequestFilters
pub fn filters_mut(&mut self) -> &mut RequestFilters
Mutable access to the request filters.
Sourcepub fn exch_code(self, exch_code: ExchCode) -> Self
pub fn exch_code(self, exch_code: ExchCode) -> Self
Sets the exch_code for the desired instrument.
Sourcepub fn currency(self, currency: Currency) -> Self
pub fn currency(self, currency: Currency) -> Self
Sets the currency for the desired instrument.
Sourcepub fn market_sec_des(self, market_sec_des: MarketSecDesc) -> Self
pub fn market_sec_des(self, market_sec_des: MarketSecDesc) -> Self
Sets the market_sec_des for the desired instrument.
Sourcepub fn security_type(self, security_type: SecurityType) -> Self
pub fn security_type(self, security_type: SecurityType) -> Self
Sets the security_type for the desired instrument.
Sourcepub fn security_type2(self, security_type2: SecurityType2) -> Self
pub fn security_type2(self, security_type2: SecurityType2) -> Self
Sets the security_type2 for the desired instrument.
Sourcepub fn include_unlisted_equities(self, val: bool) -> Self
pub fn include_unlisted_equities(self, val: bool) -> Self
Sets whether to include unlisted equities in the filter.
Sourcepub fn option_type(self, option_type: OptionType) -> Self
pub fn option_type(self, option_type: OptionType) -> Self
Sets the option_type for the desired instrument.
Sourcepub fn strike(self, strike: [Option<f64>; 2]) -> Self
pub fn strike(self, strike: [Option<f64>; 2]) -> Self
Sets the strike price range for the desired instrument.
Sourcepub fn contract_size(self, contract_size: [Option<f64>; 2]) -> Self
pub fn contract_size(self, contract_size: [Option<f64>; 2]) -> Self
Sets the contract_size range for the desired instrument.
Sourcepub fn coupon(self, coupon: [Option<f64>; 2]) -> Self
pub fn coupon(self, coupon: [Option<f64>; 2]) -> Self
Sets the coupon range for the desired instrument.
Sourcepub fn expiration(self, expiration: [Option<NaiveDate>; 2]) -> Self
pub fn expiration(self, expiration: [Option<NaiveDate>; 2]) -> Self
Sets the expiration date range for the desired instrument.
Sourcepub fn maturity(self, maturity: [Option<NaiveDate>; 2]) -> Self
pub fn maturity(self, maturity: [Option<NaiveDate>; 2]) -> Self
Sets the maturity date range for the desired instrument.
Sourcepub fn state_code(self, state_code: StateCode) -> Self
pub fn state_code(self, state_code: StateCode) -> Self
Sets the state_code for the desired instrument.
Sourcepub fn build(self) -> Result<FilterRequest>
pub fn build(self) -> Result<FilterRequest>
Builds and validates the FilterRequest.
Constructs the final request object and performs validation to ensure all requirements are met.
§Errors
Returns OpenFIGIError if validation fails, such as:
- No query or filter parameters specified
- Mutually exclusive parameters set
- Invalid parameter ranges
§Examples
use openfigi_rs::model::request::FilterRequestBuilder;
let request = FilterRequestBuilder::new()
.query("IBM")
.build()
.unwrap();