Skip to main content

ids_apis/
kdo.v1.notification.rs

1// @generated
2// This file is @generated by prost-build.
3/// Request message for ListNotifications
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct ListNotificationsRequest {
7    /// The resource name of User.
8    /// Format: users/{user_id}
9    #[prost(string, tag="1")]
10    pub user: ::prost::alloc::string::String,
11    /// The maximum number of items to return.
12    /// If unspecified, at most 50 rows will be returned.
13    /// The maximum value is 1024; values above 1024 will be coerced to 1024.
14    #[prost(int32, tag="2")]
15    pub page_size: i32,
16    /// Token of the page to retrieve.
17    #[prost(string, tag="3")]
18    pub page_token: ::prost::alloc::string::String,
19    /// Filter expression.
20    /// Available filters:
21    /// * state: CREATED, ACKNOWLEDGED, EXPIRED
22    /// * type: INFO, ERROR
23    ///
24    /// Examples:
25    /// * state=CREATED
26    /// * type=INFO
27    #[prost(string, tag="4")]
28    pub filter: ::prost::alloc::string::String,
29}
30/// Response message for ListNotifications
31#[allow(clippy::derive_partial_eq_without_eq)]
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct ListNotificationsResponse {
34    #[prost(message, repeated, tag="1")]
35    pub notifications: ::prost::alloc::vec::Vec<Notification>,
36    #[prost(string, tag="2")]
37    pub next_page_token: ::prost::alloc::string::String,
38}
39/// Request message for SubscribeNotifications
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct SubscribeNotificationsRequest {
43    /// The resource name of User.
44    /// Format: users/{user_id}
45    #[prost(string, tag="1")]
46    pub user: ::prost::alloc::string::String,
47    /// The resource name of Portfolio (optional, filter by portfolio).
48    /// Format: portfolios/{id}
49    #[prost(string, optional, tag="2")]
50    pub portfolio: ::core::option::Option<::prost::alloc::string::String>,
51}
52/// Request message for AcknowledgeNotification
53#[allow(clippy::derive_partial_eq_without_eq)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct AcknowledgeNotificationRequest {
56    /// The resource name of the notification.
57    /// Format: notifications/{notification_id}
58    #[prost(string, tag="1")]
59    pub name: ::prost::alloc::string::String,
60}
61/// Action to perform when notification is clicked
62#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct NotificationAction {
65    /// Type of action
66    #[prost(oneof="notification_action::Action", tags="1, 2")]
67    pub action: ::core::option::Option<notification_action::Action>,
68}
69/// Nested message and enum types in `NotificationAction`.
70pub mod notification_action {
71    /// Type of action
72    #[allow(clippy::derive_partial_eq_without_eq)]
73#[derive(Clone, PartialEq, ::prost::Oneof)]
74    pub enum Action {
75        /// No operation
76        #[prost(message, tag="1")]
77        NoOp(super::NoOp),
78        /// Navigate to a page
79        #[prost(message, tag="2")]
80        Navigate(super::NavigateAction),
81    }
82}
83/// No operation action
84#[allow(clippy::derive_partial_eq_without_eq)]
85#[derive(Clone, Copy, PartialEq, ::prost::Message)]
86pub struct NoOp {
87}
88/// Navigation action
89#[allow(clippy::derive_partial_eq_without_eq)]
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct NavigateAction {
92    /// Navigation target
93    #[prost(oneof="navigate_action::Target", tags="1")]
94    pub target: ::core::option::Option<navigate_action::Target>,
95}
96/// Nested message and enum types in `NavigateAction`.
97pub mod navigate_action {
98    /// Navigation target
99    #[allow(clippy::derive_partial_eq_without_eq)]
100#[derive(Clone, PartialEq, ::prost::Oneof)]
101    pub enum Target {
102        /// Navigate to LP page
103        ///
104        /// Future targets can be added here:
105        /// OrderDetailTarget order_detail = 2;
106        /// SettingsTarget settings = 3;
107        #[prost(message, tag="1")]
108        LpPage(super::LpPageTarget),
109    }
110}
111/// LP page navigation target
112#[allow(clippy::derive_partial_eq_without_eq)]
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct LpPageTarget {
115    /// ETF code (e.g., "A252670")
116    #[prost(string, tag="1")]
117    pub etf_code: ::prost::alloc::string::String,
118    /// Fund code (e.g., "0331")
119    #[prost(string, tag="2")]
120    pub fund_code: ::prost::alloc::string::String,
121}
122/// Notification resource
123#[allow(clippy::derive_partial_eq_without_eq)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct Notification {
126    /// The resource name of the Notification.
127    /// Format: notifications/{notification_id}
128    #[prost(string, tag="1")]
129    pub name: ::prost::alloc::string::String,
130    /// The resource name of User.
131    /// Format: users/{user_id}
132    #[prost(string, tag="2")]
133    pub user: ::prost::alloc::string::String,
134    /// The resource name of Portfolio (optional).
135    /// Format: portfolios/{id}
136    #[prost(string, optional, tag="3")]
137    pub portfolio: ::core::option::Option<::prost::alloc::string::String>,
138    /// The id of Notification.
139    #[prost(uint64, tag="4")]
140    pub id: u64,
141    /// Notification type
142    #[prost(enumeration="NotificationType", tag="5")]
143    pub r#type: i32,
144    /// Action to perform when clicked
145    #[prost(message, optional, tag="6")]
146    pub action: ::core::option::Option<NotificationAction>,
147    /// Current state
148    #[prost(enumeration="NotificationState", tag="7")]
149    pub state: i32,
150    /// Notification title
151    #[prost(string, tag="8")]
152    pub title: ::prost::alloc::string::String,
153    /// Notification body
154    #[prost(string, tag="9")]
155    pub body: ::prost::alloc::string::String,
156    /// Additional metadata
157    #[prost(map="string, string", tag="10")]
158    pub metadata: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
159    /// Pre-computed navigation URL (convenience field)
160    /// e.g., "/lp/A252670"
161    #[prost(string, optional, tag="11")]
162    pub navigation_url: ::core::option::Option<::prost::alloc::string::String>,
163    /// Created timestamp
164    #[prost(message, optional, tag="12")]
165    pub create_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
166    /// Expiration timestamp (if applicable)
167    #[prost(message, optional, tag="13")]
168    pub expire_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
169    /// Acknowledged timestamp
170    #[prost(message, optional, tag="14")]
171    pub acknowledge_time: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
172}
173/// Type of the notification
174#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
175#[repr(i32)]
176pub enum NotificationType {
177    TypeUnspecified = 0,
178    /// Informational notification
179    Info = 1,
180    /// Error notification
181    Error = 2,
182}
183impl NotificationType {
184    /// String value of the enum field names used in the ProtoBuf definition.
185    ///
186    /// The values are not transformed in any way and thus are considered stable
187    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
188    pub fn as_str_name(&self) -> &'static str {
189        match self {
190            NotificationType::TypeUnspecified => "TYPE_UNSPECIFIED",
191            NotificationType::Info => "INFO",
192            NotificationType::Error => "ERROR",
193        }
194    }
195    /// Creates an enum from field names used in the ProtoBuf definition.
196    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
197        match value {
198            "TYPE_UNSPECIFIED" => Some(Self::TypeUnspecified),
199            "INFO" => Some(Self::Info),
200            "ERROR" => Some(Self::Error),
201            _ => None,
202        }
203    }
204}
205/// State of the notification
206#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
207#[repr(i32)]
208pub enum NotificationState {
209    StateUnspecified = 0,
210    /// Notification has been created
211    Created = 1,
212    /// Notification has been acknowledged by user
213    Acknowledged = 2,
214    /// Notification has expired
215    Expired = 3,
216}
217impl NotificationState {
218    /// String value of the enum field names used in the ProtoBuf definition.
219    ///
220    /// The values are not transformed in any way and thus are considered stable
221    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
222    pub fn as_str_name(&self) -> &'static str {
223        match self {
224            NotificationState::StateUnspecified => "STATE_UNSPECIFIED",
225            NotificationState::Created => "CREATED",
226            NotificationState::Acknowledged => "ACKNOWLEDGED",
227            NotificationState::Expired => "EXPIRED",
228        }
229    }
230    /// Creates an enum from field names used in the ProtoBuf definition.
231    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
232        match value {
233            "STATE_UNSPECIFIED" => Some(Self::StateUnspecified),
234            "CREATED" => Some(Self::Created),
235            "ACKNOWLEDGED" => Some(Self::Acknowledged),
236            "EXPIRED" => Some(Self::Expired),
237            _ => None,
238        }
239    }
240}
241include!("kdo.v1.notification.tonic.rs");
242include!("kdo.v1.notification.serde.rs");
243// @@protoc_insertion_point(module)