Skip to main content

ids_apis/
master_sync.v1.instrument.rs

1// @generated
2// This file is @generated by prost-build.
3/// 통합 상품 메시지
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct Instrument {
7    /// 리소스 이름 (instruments/{symbol})
8    #[prost(string, tag="1")]
9    pub name: ::prost::alloc::string::String,
10    /// 심볼 (고유 식별자)
11    #[prost(string, tag="2")]
12    pub symbol: ::prost::alloc::string::String,
13    /// 상품 코드
14    #[prost(string, tag="3")]
15    pub code: ::prost::alloc::string::String,
16    /// 상품명
17    #[prost(string, tag="4")]
18    pub display_name: ::prost::alloc::string::String,
19    /// 상품 타입
20    #[prost(enumeration="ProductType", tag="5")]
21    pub product_type: i32,
22    /// 전일 종가
23    #[prost(string, tag="6")]
24    pub prev_close: ::prost::alloc::string::String,
25    /// 현재가
26    #[prost(string, tag="7")]
27    pub last_price: ::prost::alloc::string::String,
28    /// 거래 가능 여부
29    #[prost(bool, tag="8")]
30    pub tradable: bool,
31    /// 상품별 상세 정보
32    #[prost(oneof="instrument::Details", tags="20, 21, 22")]
33    pub details: ::core::option::Option<instrument::Details>,
34}
35/// Nested message and enum types in `Instrument`.
36pub mod instrument {
37    /// 상품별 상세 정보
38    #[allow(clippy::derive_partial_eq_without_eq)]
39#[derive(Clone, PartialEq, ::prost::Oneof)]
40    pub enum Details {
41        #[prost(message, tag="20")]
42        Etf(super::EtfDetails),
43        #[prost(message, tag="21")]
44        Futures(super::FuturesDetails),
45        #[prost(message, tag="22")]
46        Stock(super::StockDetails),
47    }
48}
49/// ETF 상세 정보 (ETF 전용 필드)
50#[allow(clippy::derive_partial_eq_without_eq)]
51#[derive(Clone, PartialEq, ::prost::Message)]
52pub struct EtfDetails {
53    /// 전일 NAV
54    #[prost(string, tag="1")]
55    pub prev_nav: ::prost::alloc::string::String,
56    /// 실시간 iNAV
57    #[prost(string, tag="2")]
58    pub last_inav: ::prost::alloc::string::String,
59    /// 설정 단위
60    #[prost(int64, tag="3")]
61    pub creation_unit: i64,
62    /// Tick 크기 (원 단위)
63    #[prost(int64, tag="4")]
64    pub tick_size: i64,
65    /// 레버리지 배율
66    #[prost(float, tag="5")]
67    pub leverage: f32,
68    /// 공매도 가능 여부
69    #[prost(bool, tag="6")]
70    pub short_sellable: bool,
71    /// 상장 주식 수
72    #[prost(int64, tag="7")]
73    pub listed_quantity: i64,
74    /// 현금 설정 가능 여부
75    #[prost(bool, tag="8")]
76    pub cash_creditable: bool,
77    /// 현금 설정 금액
78    #[prost(int64, tag="9")]
79    pub cash_creation_amount: i64,
80}
81/// 선물 상세 정보 (Futures 전용 필드)
82#[allow(clippy::derive_partial_eq_without_eq)]
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct FuturesDetails {
85    /// 기초자산 심볼
86    #[prost(string, tag="1")]
87    pub underlying_symbol: ::prost::alloc::string::String,
88    /// 기초자산 이름
89    #[prost(string, tag="2")]
90    pub underlying_name: ::prost::alloc::string::String,
91    /// 만기일 (YYYYMMDD)
92    #[prost(string, tag="3")]
93    pub expiry_date: ::prost::alloc::string::String,
94    /// 승수 (계약 당 금액)
95    #[prost(double, tag="4")]
96    pub multiplier: f64,
97    /// Tick 크기 (포인트 단위)
98    #[prost(double, tag="5")]
99    pub tick_size: f64,
100    /// Tick 가치 (원 단위)
101    #[prost(int64, tag="6")]
102    pub tick_value: i64,
103    /// 최종 거래일 (YYYYMMDD)
104    #[prost(string, tag="7")]
105    pub last_trading_date: ::prost::alloc::string::String,
106}
107/// 주식 상세 정보 (Stock 전용 필드)
108#[allow(clippy::derive_partial_eq_without_eq)]
109#[derive(Clone, PartialEq, ::prost::Message)]
110pub struct StockDetails {
111    /// 시장 구분
112    #[prost(enumeration="super::stock::MarketType", tag="1")]
113    pub market_type: i32,
114    /// 상장 주식 수
115    #[prost(int64, tag="2")]
116    pub listed_shares: i64,
117    /// Tick 크기 (원 단위)
118    #[prost(int64, tag="3")]
119    pub tick_size: i64,
120    /// 공매도 가능 여부
121    #[prost(bool, tag="4")]
122    pub short_sellable: bool,
123    /// 신용 거래 가능 여부
124    #[prost(bool, tag="5")]
125    pub margin_tradable: bool,
126    /// 섹터 코드
127    #[prost(string, tag="6")]
128    pub sector_code: ::prost::alloc::string::String,
129    /// 섹터 이름
130    #[prost(string, tag="7")]
131    pub sector_name: ::prost::alloc::string::String,
132}
133// ========== Request/Response Messages ==========
134
135#[allow(clippy::derive_partial_eq_without_eq)]
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct GetInstrumentRequest {
138    /// instruments/{symbol}
139    #[prost(string, tag="1")]
140    pub instrument: ::prost::alloc::string::String,
141}
142/// BatchGet (AIP-231)
143#[allow(clippy::derive_partial_eq_without_eq)]
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct BatchGetInstrumentsRequest {
146    /// 조회할 symbol 목록 (최대 100개)
147    /// Format: \["instruments/005930", "instruments/101S6", ...\]
148    #[prost(string, repeated, tag="1")]
149    pub instruments: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
150}
151#[allow(clippy::derive_partial_eq_without_eq)]
152#[derive(Clone, PartialEq, ::prost::Message)]
153pub struct BatchGetInstrumentsResponse {
154    /// 조회된 상품 목록 (요청 순서 보장)
155    #[prost(message, repeated, tag="1")]
156    pub instruments: ::prost::alloc::vec::Vec<Instrument>,
157    /// 조회 실패한 symbol 목록
158    #[prost(string, repeated, tag="2")]
159    pub not_found: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
160}
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct ListInstrumentsRequest {
164    /// 페이지 크기 (optional)
165    #[prost(uint32, optional, tag="1")]
166    pub page_size: ::core::option::Option<u32>,
167    /// 페이지 토큰 (optional, for pagination)
168    #[prost(string, optional, tag="2")]
169    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
170    /// 필터링 조건 (optional, AIP-160)
171    ///
172    /// Available Fields:
173    /// * product_type - 상품 타입 (PRODUCT_TYPE_ETF, PRODUCT_TYPE_FUTURES, PRODUCT_TYPE_STOCK)
174    /// * symbol - 심볼 (contains 지원)
175    /// * code - 상품 코드 (contains 지원)
176    /// * display_name - 상품명 (contains 지원)
177    /// * tradable - 거래 가능 여부
178    ///
179    /// Examples:
180    /// * filter=product_type=PRODUCT_TYPE_ETF
181    /// * filter=symbol:"005930"
182    /// * filter=tradable=true
183    /// * filter=product_type=PRODUCT_TYPE_STOCK AND tradable=true
184    #[prost(string, tag="3")]
185    pub filter: ::prost::alloc::string::String,
186}
187#[allow(clippy::derive_partial_eq_without_eq)]
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct ListInstrumentsResponse {
190    /// 상품 목록
191    #[prost(message, repeated, tag="1")]
192    pub instruments: ::prost::alloc::vec::Vec<Instrument>,
193    /// 다음 페이지 토큰
194    #[prost(string, tag="2")]
195    pub next_page_token: ::prost::alloc::string::String,
196}
197/// 상품 타입
198#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
199#[repr(i32)]
200pub enum ProductType {
201    Unspecified = 0,
202    Etf = 1,
203    Futures = 2,
204    Stock = 3,
205}
206impl ProductType {
207    /// String value of the enum field names used in the ProtoBuf definition.
208    ///
209    /// The values are not transformed in any way and thus are considered stable
210    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
211    pub fn as_str_name(&self) -> &'static str {
212        match self {
213            ProductType::Unspecified => "PRODUCT_TYPE_UNSPECIFIED",
214            ProductType::Etf => "PRODUCT_TYPE_ETF",
215            ProductType::Futures => "PRODUCT_TYPE_FUTURES",
216            ProductType::Stock => "PRODUCT_TYPE_STOCK",
217        }
218    }
219    /// Creates an enum from field names used in the ProtoBuf definition.
220    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
221        match value {
222            "PRODUCT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
223            "PRODUCT_TYPE_ETF" => Some(Self::Etf),
224            "PRODUCT_TYPE_FUTURES" => Some(Self::Futures),
225            "PRODUCT_TYPE_STOCK" => Some(Self::Stock),
226            _ => None,
227        }
228    }
229}
230include!("master_sync.v1.instrument.tonic.rs");
231include!("master_sync.v1.instrument.serde.rs");
232// @@protoc_insertion_point(module)