nomy_data_models/enums/
position_direction.rs

1#![allow(clippy::too_many_arguments, unused_imports, non_camel_case_types)]
2//! PositionDirection enum definition.
3//!
4//! This file is generated automatically from the Python enum.
5//! Do not edit this file manually.
6
7use serde::{Deserialize, Serialize};
8
9/// Enum for position direction.
10#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
11pub enum PositionDirection {
12    #[serde(rename = "buy")]
13    BUY,
14    #[serde(rename = "sell")]
15    SELL,
16}
17
18impl PositionDirection {
19    /// Convert to string representation.
20    pub fn as_str(&self) -> &'static str {
21        match self {
22            PositionDirection::BUY => "buy",
23            PositionDirection::SELL => "sell",
24        }
25    }
26}