rusty_cdk_core/sns/
dto.rs

1use serde::Serialize;
2use serde_json::Value;
3use crate::{dto_methods, ref_struct};
4use crate::shared::Id;
5
6ref_struct!(TopicRef);
7
8#[derive(Debug, Serialize)]
9pub struct Topic {
10    #[serde(skip)]
11    pub(super) id: Id,
12    #[serde(skip)]
13    pub(super) resource_id: String,
14    #[serde(rename = "Type")]
15    pub(super) r#type: String,
16    #[serde(rename = "Properties")]
17    pub(super) properties: TopicProperties,
18}
19dto_methods!(Topic);
20
21#[derive(Debug, Serialize)]
22pub struct TopicProperties {
23    #[serde(rename = "TopicName", skip_serializing_if = "Option::is_none")]
24    pub(super) topic_name: Option<String>,
25    #[serde(rename = "FifoTopic", skip_serializing_if = "Option::is_none")]
26    pub(super) fifo_topic: Option<bool>,
27    #[serde(rename = "ContentBasedDeduplication", skip_serializing_if = "Option::is_none")]
28    pub(super) content_based_deduplication: Option<bool>,
29    #[serde(rename = "FifoThroughputScope", skip_serializing_if = "Option::is_none")]
30    pub(super) fifo_throughput_scope: Option<String>,
31}
32
33#[derive(Debug, Serialize)]
34pub struct Subscription {
35    #[serde(skip)]
36    pub(super) id: Id,
37    #[serde(skip)]
38    pub(super) resource_id: String,
39    #[serde(rename = "Type")]
40    pub(super) r#type: String,
41    #[serde(rename = "Properties")]
42    pub(super) properties: SnsSubscriptionProperties,
43}
44dto_methods!(Subscription);
45
46#[derive(Debug, Serialize)]
47pub struct SnsSubscriptionProperties {
48    #[serde(rename = "Protocol")]
49    pub(super) protocol: String,
50    #[serde(rename = "Endpoint")]
51    pub(super) endpoint: Value,
52    #[serde(rename = "TopicArn")]
53    pub(super) topic_arn: Value
54}