ids-apis 1.0.216

IDS APIs in Rust
Documentation
// @generated
// This file is @generated by prost-build.
/// 주문 로그
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OrderLog {
    /// 로그 고유 ID (DB에서 자동 생성)
    #[prost(int64, tag="1")]
    pub id: i64,
    /// 주문 ID (거래소에서 받은 ID)
    #[prost(uint64, tag="2")]
    pub order_id: u64,
    /// 원본 주문 ID (수정/취소의 경우)
    /// Option<u64>는 optional uint64로 매핑
    #[prost(uint64, optional, tag="3")]
    pub original_order_id: ::core::option::Option<u64>,
    /// 펀드 코드
    #[prost(string, tag="4")]
    pub fund_code: ::prost::alloc::string::String,
    /// 심볼
    #[prost(string, tag="5")]
    pub symbol: ::prost::alloc::string::String,
    /// 로그 타입
    #[prost(enumeration="OrderLogType", tag="6")]
    pub log_type: i32,
    /// 주문 방향 (매수/매도)
    #[prost(enumeration="super::common::OrderSide", tag="7")]
    pub side: i32,
    /// 주문 타입 (신규/정정/취소)
    #[prost(enumeration="OrderType", tag="8")]
    pub order_type: i32,
    /// 주문 가격 (Price)
    /// 정확도 유지를 위해 string 또는 고정 소수점(fixed64 등)을 사용할 수 있으나,
    /// 여기서는 간단하게 string으로 가정
    #[prost(string, tag="9")]
    pub price: ::prost::alloc::string::String,
    /// 주문 수량 (Quantity)
    /// 정확도 유지를 위해 string 또는 고정 소수점(fixed64 등)을 사용할 수 있으나,
    /// 여기서는 간단하게 string으로 가정
    #[prost(string, tag="10")]
    pub quantity: ::prost::alloc::string::String,
    /// 체결 가격 (Filled 로그의 경우) (FilledPrice)
    #[prost(string, optional, tag="11")]
    pub filled_price: ::core::option::Option<::prost::alloc::string::String>,
    /// 체결 수량 (Filled 로그의 경우) (FilledQuantity)
    #[prost(string, optional, tag="12")]
    pub filled_quantity: ::core::option::Option<::prost::alloc::string::String>,
    /// 체결 금액 (계산값) (FilledAmount)
    #[prost(string, optional, tag="13")]
    pub filled_amount: ::core::option::Option<::prost::alloc::string::String>,
    /// 거부/취소 코드
    #[prost(string, optional, tag="14")]
    pub rejection_code: ::core::option::Option<::prost::alloc::string::String>,
    /// 에러 메시지 (MeritzRejected의 경우)
    #[prost(string, optional, tag="15")]
    pub error_message: ::core::option::Option<::prost::alloc::string::String>,
    /// 거래소 시각 (KST, HHMMSSuuuuuu)
    #[prost(uint64, tag="16")]
    pub exchange_time: u64,
    /// 이벤트 수신 시각 (시스템 시각, 마이크로초)
    /// Rust Timestamp 타입을 u64로 가정
    #[prost(uint64, tag="17")]
    pub receive_time: u64,
    /// DB 삽입 시각
    /// Rust의 DateTime<Utc> 타입을 Google의 Timestamp 메시지로 매핑
    #[prost(message, optional, tag="18")]
    pub created_at: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
    /// 시장 구분
    #[prost(enumeration="super::common::MarketType", tag="19")]
    pub market_type: i32,
    /// 거래일 (YYYYMMDD)
    #[prost(uint32, tag="20")]
    pub date: u32,
    /// 사용자 영역 (JSON: QuoteContext 또는 HedgeContext)
    #[prost(string, optional, tag="21")]
    pub user_area: ::core::option::Option<::prost::alloc::string::String>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct OrderLogFillStatistics {
    /// 총 체결 건수
    #[prost(int64, tag="1")]
    pub total_fills: i64,
    /// 총 체결 수량
    #[prost(int64, tag="2")]
    pub total_quantity: i64,
    /// 총 체결 금액
    #[prost(int64, tag="3")]
    pub total_amount: i64,
    /// 매수 체결 건수
    #[prost(int64, tag="4")]
    pub buy_count: i64,
    /// 매도 체결 건수
    #[prost(int64, tag="5")]
    pub sell_count: i64,
}
// ========== Request/Response Messages ==========

/// ListOrderLogs 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrderLogsRequest {
    /// 페이지 크기 (optional)
    #[prost(uint32, optional, tag="1")]
    pub page_size: ::core::option::Option<u32>,
    /// 페이지 토큰 (optional, for pagination)
    #[prost(string, optional, tag="2")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    /// Available Sequence and Operator
    /// * fund_code
    ///    * `equal`, `contains`
    /// * symbol
    ///    * `equal`, `contains
    /// * log_type
    ///    * `equal`
    /// * side
    ///    * `equal`
    /// * order_type
    ///    * `equal`
    ///
    /// Examples
    /// * filter=fund_code="0159"
    /// * filter=symbol:"7526"
    /// * filter=log_type=FILLED
    /// * filter=side=BUY
    /// * filter=order_type=AMEND
    /// * filter=market_type=KOSPI
    #[prost(string, tag="3")]
    pub filter: ::prost::alloc::string::String,
    /// 오더링 조건. (optional, AIP-132)
    ///
    /// Supported Fields
    /// * "order_id", "exchange_time", "receive_time", "date"
    ///
    /// Examples
    /// * order_by=order_id desc
    #[prost(string, tag="4")]
    pub order_by: ::prost::alloc::string::String,
}
/// ListOrderLogs 응답
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListOrderLogsResponse {
    /// 펀드 목록
    #[prost(message, repeated, tag="1")]
    pub order_logs: ::prost::alloc::vec::Vec<OrderLog>,
    /// 다음 페이지 토큰
    #[prost(string, tag="2")]
    pub next_page_token: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderLogStatisticsRequest {
    /// Available Sequence and Operator
    /// * fund_code
    ///    * `equal`, `contains`
    /// * symbol
    ///    * `equal`, `contains`
    ///
    /// Examples
    /// * filter=fund_code="0159"
    /// * filter=symbol:"7526"
    #[prost(string, tag="1")]
    pub filter: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetOrderChainRequest {
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// YYYYMMDD, 미지정 시 오늘 날짜
    #[prost(uint32, optional, tag="2")]
    pub date: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetOrderChainResponse {
    #[prost(message, repeated, tag="1")]
    pub order_logs: ::prost::alloc::vec::Vec<OrderLog>,
}
/// GetHedgePairDetail 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetHedgePairDetailRequest {
    /// 주문 ID (hedge 또는 quote order)
    #[prost(uint64, tag="1")]
    pub order_id: u64,
    /// 날짜 (YYYYMMDD, optional - 미지정 시 당일)
    #[prost(uint32, optional, tag="2")]
    pub date: ::core::option::Option<u32>,
}
/// StreamHedgePairDetail 요청
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamHedgePairDetailRequest {
    /// 감시할 ETF 심볼
    #[prost(string, tag="1")]
    pub symbol: ::prost::alloc::string::String,
    /// Quote 방향 필터 (optional - 미지정 시 양방향 모두)
    #[prost(enumeration="super::common::OrderSide", optional, tag="3")]
    pub quote_side: ::core::option::Option<i32>,
}
/// 헷지 쌍 상세 정보
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HedgePairDetail {
    /// Quote(원주문) 주문 ID
    #[prost(uint64, tag="1")]
    pub quote_order_id: u64,
    /// ETF 심볼
    #[prost(string, tag="2")]
    pub quote_symbol: ::prost::alloc::string::String,
    /// ETF 방향 (매수/매도)
    #[prost(enumeration="super::common::OrderSide", tag="3")]
    pub quote_side: i32,
    /// ETF 체결 수량
    #[prost(int64, tag="4")]
    pub quote_filled_quantity: i64,
    /// ETF 평균 체결 가격
    #[prost(double, tag="5")]
    pub quote_avg_price: f64,
    /// Hedge 심볼 (선물)
    #[prost(string, tag="6")]
    pub hedge_symbol: ::prost::alloc::string::String,
    /// Hedge 체결 수량
    #[prost(int64, tag="7")]
    pub hedge_filled_quantity: i64,
    /// Hedge 평균 체결 가격
    #[prost(double, tag="8")]
    pub hedge_avg_price: f64,
    /// 스프레드 (선물가격 * 100 - ETF가격)
    #[prost(double, tag="9")]
    pub spread: f64,
    /// 펀드 코드
    #[prost(string, tag="10")]
    pub fund_code: ::prost::alloc::string::String,
    /// 날짜 (YYYYMMDD)
    #[prost(uint32, tag="11")]
    pub date: u32,
    /// 마지막 Hedge 거래소 시각 (마이크로초)
    #[prost(uint64, tag="12")]
    pub hedge_exchange_time: u64,
}
/// 주문 로그 타입
///
/// Rust의 SCREAMING_SNAKE_CASE를 반영하여 정의
/// 주석은 Rust 코드의 내용을 번역했습니다.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderLogType {
    /// 알 수 없는 값 (기본값)
    Unspecified = 0,
    /// 접수 확인
    Received = 1,
    /// 거래소 거부
    Rejected = 2,
    /// 메리츠 내부 거부
    MeritzRejected = 3,
    /// 체결
    Filled = 4,
    /// 자동 취소
    AutoCancelled = 5,
}
impl OrderLogType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            OrderLogType::Unspecified => "ORDER_LOG_TYPE_UNSPECIFIED",
            OrderLogType::Received => "RECEIVED",
            OrderLogType::Rejected => "REJECTED",
            OrderLogType::MeritzRejected => "MERITZ_REJECTED",
            OrderLogType::Filled => "FILLED",
            OrderLogType::AutoCancelled => "AUTO_CANCELLED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_LOG_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "RECEIVED" => Some(Self::Received),
            "REJECTED" => Some(Self::Rejected),
            "MERITZ_REJECTED" => Some(Self::MeritzRejected),
            "FILLED" => Some(Self::Filled),
            "AUTO_CANCELLED" => Some(Self::AutoCancelled),
            _ => None,
        }
    }
}
/// 주문 타입 (신규/정정/취소)
/// Rust 코드에는 정의되지 않았지만, OrderLog에 사용되므로 정의 가정
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum OrderType {
    Unspecified = 0,
    /// 신규
    New = 1,
    /// 정정
    Amend = 2,
    /// 취소
    Cancel = 3,
}
impl OrderType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            OrderType::Unspecified => "ORDER_TYPE_UNSPECIFIED",
            OrderType::New => "NEW",
            OrderType::Amend => "AMEND",
            OrderType::Cancel => "CANCEL",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ORDER_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "NEW" => Some(Self::New),
            "AMEND" => Some(Self::Amend),
            "CANCEL" => Some(Self::Cancel),
            _ => None,
        }
    }
}
include!("kdo.v1.order_log.tonic.rs");
include!("kdo.v1.order_log.serde.rs");
// @@protoc_insertion_point(module)