ledger_models/
fintekkers.models.security.rs

1#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2#[repr(i32)]
3pub enum IdentifierTypeProto {
4    UnknownIdentifierType = 0,
5    ExchTicker = 1,
6    Isin = 2,
7    Cusip = 3,
8    Osi = 4,
9    Figi = 5,
10    Cash = 50,
11}
12impl IdentifierTypeProto {
13    /// String value of the enum field names used in the ProtoBuf definition.
14    ///
15    /// The values are not transformed in any way and thus are considered stable
16    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
17    pub fn as_str_name(&self) -> &'static str {
18        match self {
19            IdentifierTypeProto::UnknownIdentifierType => "UNKNOWN_IDENTIFIER_TYPE",
20            IdentifierTypeProto::ExchTicker => "EXCH_TICKER",
21            IdentifierTypeProto::Isin => "ISIN",
22            IdentifierTypeProto::Cusip => "CUSIP",
23            IdentifierTypeProto::Osi => "OSI",
24            IdentifierTypeProto::Figi => "FIGI",
25            IdentifierTypeProto::Cash => "CASH",
26        }
27    }
28    /// Creates an enum from field names used in the ProtoBuf definition.
29    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
30        match value {
31            "UNKNOWN_IDENTIFIER_TYPE" => Some(Self::UnknownIdentifierType),
32            "EXCH_TICKER" => Some(Self::ExchTicker),
33            "ISIN" => Some(Self::Isin),
34            "CUSIP" => Some(Self::Cusip),
35            "OSI" => Some(Self::Osi),
36            "FIGI" => Some(Self::Figi),
37            "CASH" => Some(Self::Cash),
38            _ => None,
39        }
40    }
41}
42#[allow(clippy::derive_partial_eq_without_eq)]
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct IdentifierProto {
45    #[prost(string, tag = "1")]
46    pub object_class: ::prost::alloc::string::String,
47    #[prost(string, tag = "2")]
48    pub version: ::prost::alloc::string::String,
49    /// Primary Key
50    #[prost(string, tag = "5")]
51    pub identifier_value: ::prost::alloc::string::String,
52    #[prost(enumeration = "IdentifierTypeProto", tag = "6")]
53    pub identifier_type: i32,
54}
55#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
56#[repr(i32)]
57pub enum SecurityTypeProto {
58    /// Maps to Security
59    UnknownSecurityType = 0,
60    CashSecurity = 1,
61    EquitySecurity = 2,
62    BondSecurity = 3,
63    Tips = 4,
64    Frn = 5,
65}
66impl SecurityTypeProto {
67    /// String value of the enum field names used in the ProtoBuf definition.
68    ///
69    /// The values are not transformed in any way and thus are considered stable
70    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
71    pub fn as_str_name(&self) -> &'static str {
72        match self {
73            SecurityTypeProto::UnknownSecurityType => "UNKNOWN_SECURITY_TYPE",
74            SecurityTypeProto::CashSecurity => "CASH_SECURITY",
75            SecurityTypeProto::EquitySecurity => "EQUITY_SECURITY",
76            SecurityTypeProto::BondSecurity => "BOND_SECURITY",
77            SecurityTypeProto::Tips => "TIPS",
78            SecurityTypeProto::Frn => "FRN",
79        }
80    }
81    /// Creates an enum from field names used in the ProtoBuf definition.
82    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
83        match value {
84            "UNKNOWN_SECURITY_TYPE" => Some(Self::UnknownSecurityType),
85            "CASH_SECURITY" => Some(Self::CashSecurity),
86            "EQUITY_SECURITY" => Some(Self::EquitySecurity),
87            "BOND_SECURITY" => Some(Self::BondSecurity),
88            "TIPS" => Some(Self::Tips),
89            "FRN" => Some(Self::Frn),
90            _ => None,
91        }
92    }
93}
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
95#[repr(i32)]
96pub enum SecurityQuantityTypeProto {
97    /// Maps to Security
98    UnknownQuantityType = 0,
99    OriginalFaceValue = 1,
100    Notional = 2,
101    Units = 3,
102}
103impl SecurityQuantityTypeProto {
104    /// String value of the enum field names used in the ProtoBuf definition.
105    ///
106    /// The values are not transformed in any way and thus are considered stable
107    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
108    pub fn as_str_name(&self) -> &'static str {
109        match self {
110            SecurityQuantityTypeProto::UnknownQuantityType => "UNKNOWN_QUANTITY_TYPE",
111            SecurityQuantityTypeProto::OriginalFaceValue => "ORIGINAL_FACE_VALUE",
112            SecurityQuantityTypeProto::Notional => "NOTIONAL",
113            SecurityQuantityTypeProto::Units => "UNITS",
114        }
115    }
116    /// Creates an enum from field names used in the ProtoBuf definition.
117    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
118        match value {
119            "UNKNOWN_QUANTITY_TYPE" => Some(Self::UnknownQuantityType),
120            "ORIGINAL_FACE_VALUE" => Some(Self::OriginalFaceValue),
121            "NOTIONAL" => Some(Self::Notional),
122            "UNITS" => Some(Self::Units),
123            _ => None,
124        }
125    }
126}
127#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
128#[repr(i32)]
129pub enum CouponFrequencyProto {
130    /// Maps to Security
131    UnknownCouponFrequency = 0,
132    Annually = 1,
133    Semiannually = 2,
134    Quarterly = 3,
135    Monthly = 4,
136    NoCoupon = 5,
137}
138impl CouponFrequencyProto {
139    /// String value of the enum field names used in the ProtoBuf definition.
140    ///
141    /// The values are not transformed in any way and thus are considered stable
142    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
143    pub fn as_str_name(&self) -> &'static str {
144        match self {
145            CouponFrequencyProto::UnknownCouponFrequency => "UNKNOWN_COUPON_FREQUENCY",
146            CouponFrequencyProto::Annually => "ANNUALLY",
147            CouponFrequencyProto::Semiannually => "SEMIANNUALLY",
148            CouponFrequencyProto::Quarterly => "QUARTERLY",
149            CouponFrequencyProto::Monthly => "MONTHLY",
150            CouponFrequencyProto::NoCoupon => "NO_COUPON",
151        }
152    }
153    /// Creates an enum from field names used in the ProtoBuf definition.
154    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
155        match value {
156            "UNKNOWN_COUPON_FREQUENCY" => Some(Self::UnknownCouponFrequency),
157            "ANNUALLY" => Some(Self::Annually),
158            "SEMIANNUALLY" => Some(Self::Semiannually),
159            "QUARTERLY" => Some(Self::Quarterly),
160            "MONTHLY" => Some(Self::Monthly),
161            "NO_COUPON" => Some(Self::NoCoupon),
162            _ => None,
163        }
164    }
165}
166#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
167#[repr(i32)]
168pub enum CouponTypeProto {
169    /// Maps to Security
170    UnknownCouponType = 0,
171    Fixed = 1,
172    Float = 2,
173    Zero = 3,
174}
175impl CouponTypeProto {
176    /// String value of the enum field names used in the ProtoBuf definition.
177    ///
178    /// The values are not transformed in any way and thus are considered stable
179    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
180    pub fn as_str_name(&self) -> &'static str {
181        match self {
182            CouponTypeProto::UnknownCouponType => "UNKNOWN_COUPON_TYPE",
183            CouponTypeProto::Fixed => "FIXED",
184            CouponTypeProto::Float => "FLOAT",
185            CouponTypeProto::Zero => "ZERO",
186        }
187    }
188    /// Creates an enum from field names used in the ProtoBuf definition.
189    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
190        match value {
191            "UNKNOWN_COUPON_TYPE" => Some(Self::UnknownCouponType),
192            "FIXED" => Some(Self::Fixed),
193            "FLOAT" => Some(Self::Float),
194            "ZERO" => Some(Self::Zero),
195            _ => None,
196        }
197    }
198}
199#[allow(clippy::derive_partial_eq_without_eq)]
200#[derive(Clone, PartialEq, ::prost::Message)]
201pub struct SecurityProto {
202    #[prost(string, tag = "1")]
203    pub object_class: ::prost::alloc::string::String,
204    #[prost(string, tag = "2")]
205    pub version: ::prost::alloc::string::String,
206    /// Primary Key
207    #[prost(message, optional, tag = "5")]
208    pub uuid: ::core::option::Option<super::util::UuidProto>,
209    #[prost(message, optional, tag = "6")]
210    pub as_of: ::core::option::Option<super::util::LocalTimestampProto>,
211    #[prost(bool, tag = "7")]
212    pub is_link: bool,
213    #[prost(message, optional, tag = "8")]
214    pub valid_from: ::core::option::Option<super::util::LocalTimestampProto>,
215    #[prost(message, optional, tag = "9")]
216    pub valid_to: ::core::option::Option<super::util::LocalTimestampProto>,
217    #[prost(enumeration = "SecurityTypeProto", tag = "10")]
218    pub security_type: i32,
219    /// Biz fields
220    #[prost(string, tag = "11")]
221    pub asset_class: ::prost::alloc::string::String,
222    #[prost(string, tag = "12")]
223    pub issuer_name: ::prost::alloc::string::String,
224    #[prost(message, optional, boxed, tag = "13")]
225    pub settlement_currency: ::core::option::Option<
226        ::prost::alloc::boxed::Box<SecurityProto>,
227    >,
228    #[prost(enumeration = "SecurityQuantityTypeProto", tag = "14")]
229    pub quantity_type: i32,
230    #[prost(message, optional, tag = "40")]
231    pub identifier: ::core::option::Option<IdentifierProto>,
232    #[prost(string, tag = "41")]
233    pub description: ::prost::alloc::string::String,
234    /// Cash Security fields
235    #[prost(string, tag = "50")]
236    pub cash_id: ::prost::alloc::string::String,
237    /// Bond Security fields
238    #[prost(message, optional, tag = "60")]
239    pub coupon_rate: ::core::option::Option<super::util::DecimalValueProto>,
240    #[prost(enumeration = "CouponTypeProto", tag = "61")]
241    pub coupon_type: i32,
242    #[prost(enumeration = "CouponFrequencyProto", tag = "62")]
243    pub coupon_frequency: i32,
244    #[prost(message, optional, tag = "63")]
245    pub dated_date: ::core::option::Option<super::util::LocalDateProto>,
246    #[prost(message, optional, tag = "64")]
247    pub face_value: ::core::option::Option<super::util::DecimalValueProto>,
248    #[prost(message, optional, tag = "65")]
249    pub issue_date: ::core::option::Option<super::util::LocalDateProto>,
250    #[prost(message, optional, tag = "66")]
251    pub maturity_date: ::core::option::Option<super::util::LocalDateProto>,
252    /// Issuance can be repeated as there may be re-openings of bond auctions (e.g. in US treasuries)
253    #[prost(message, repeated, tag = "67")]
254    pub issuance_info: ::prost::alloc::vec::Vec<bond::IssuanceProto>,
255}
256#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
257#[repr(i32)]
258pub enum TenorTypeProto {
259    UnknownTenorType = 0,
260    Perpetual = 1,
261    Term = 2,
262}
263impl TenorTypeProto {
264    /// String value of the enum field names used in the ProtoBuf definition.
265    ///
266    /// The values are not transformed in any way and thus are considered stable
267    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
268    pub fn as_str_name(&self) -> &'static str {
269        match self {
270            TenorTypeProto::UnknownTenorType => "UNKNOWN_TENOR_TYPE",
271            TenorTypeProto::Perpetual => "PERPETUAL",
272            TenorTypeProto::Term => "TERM",
273        }
274    }
275    /// Creates an enum from field names used in the ProtoBuf definition.
276    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
277        match value {
278            "UNKNOWN_TENOR_TYPE" => Some(Self::UnknownTenorType),
279            "PERPETUAL" => Some(Self::Perpetual),
280            "TERM" => Some(Self::Term),
281            _ => None,
282        }
283    }
284}
285#[allow(clippy::derive_partial_eq_without_eq)]
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct TenorProto {
288    #[prost(string, tag = "1")]
289    pub object_class: ::prost::alloc::string::String,
290    #[prost(string, tag = "2")]
291    pub version: ::prost::alloc::string::String,
292    #[prost(string, tag = "5")]
293    pub term_value: ::prost::alloc::string::String,
294    #[prost(enumeration = "TenorTypeProto", tag = "6")]
295    pub tenor_type: i32,
296}