aws_sdk_sns/operation/publish/
_publish_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Response for Publish action.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PublishOutput {
7    /// <p>Unique identifier assigned to the published message.</p>
8    /// <p>Length Constraint: Maximum 100 characters</p>
9    pub message_id: ::std::option::Option<::std::string::String>,
10    /// <p>This response element applies only to FIFO (first-in-first-out) topics.</p>
11    /// <p>The sequence number is a large, non-consecutive number that Amazon SNS assigns to each message. The length of <code>SequenceNumber</code> is 128 bits. <code>SequenceNumber</code> continues to increase for each <code>MessageGroupId</code>.</p>
12    pub sequence_number: ::std::option::Option<::std::string::String>,
13    _request_id: Option<String>,
14}
15impl PublishOutput {
16    /// <p>Unique identifier assigned to the published message.</p>
17    /// <p>Length Constraint: Maximum 100 characters</p>
18    pub fn message_id(&self) -> ::std::option::Option<&str> {
19        self.message_id.as_deref()
20    }
21    /// <p>This response element applies only to FIFO (first-in-first-out) topics.</p>
22    /// <p>The sequence number is a large, non-consecutive number that Amazon SNS assigns to each message. The length of <code>SequenceNumber</code> is 128 bits. <code>SequenceNumber</code> continues to increase for each <code>MessageGroupId</code>.</p>
23    pub fn sequence_number(&self) -> ::std::option::Option<&str> {
24        self.sequence_number.as_deref()
25    }
26}
27impl ::aws_types::request_id::RequestId for PublishOutput {
28    fn request_id(&self) -> Option<&str> {
29        self._request_id.as_deref()
30    }
31}
32impl PublishOutput {
33    /// Creates a new builder-style object to manufacture [`PublishOutput`](crate::operation::publish::PublishOutput).
34    pub fn builder() -> crate::operation::publish::builders::PublishOutputBuilder {
35        crate::operation::publish::builders::PublishOutputBuilder::default()
36    }
37}
38
39/// A builder for [`PublishOutput`](crate::operation::publish::PublishOutput).
40#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct PublishOutputBuilder {
43    pub(crate) message_id: ::std::option::Option<::std::string::String>,
44    pub(crate) sequence_number: ::std::option::Option<::std::string::String>,
45    _request_id: Option<String>,
46}
47impl PublishOutputBuilder {
48    /// <p>Unique identifier assigned to the published message.</p>
49    /// <p>Length Constraint: Maximum 100 characters</p>
50    pub fn message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51        self.message_id = ::std::option::Option::Some(input.into());
52        self
53    }
54    /// <p>Unique identifier assigned to the published message.</p>
55    /// <p>Length Constraint: Maximum 100 characters</p>
56    pub fn set_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.message_id = input;
58        self
59    }
60    /// <p>Unique identifier assigned to the published message.</p>
61    /// <p>Length Constraint: Maximum 100 characters</p>
62    pub fn get_message_id(&self) -> &::std::option::Option<::std::string::String> {
63        &self.message_id
64    }
65    /// <p>This response element applies only to FIFO (first-in-first-out) topics.</p>
66    /// <p>The sequence number is a large, non-consecutive number that Amazon SNS assigns to each message. The length of <code>SequenceNumber</code> is 128 bits. <code>SequenceNumber</code> continues to increase for each <code>MessageGroupId</code>.</p>
67    pub fn sequence_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.sequence_number = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>This response element applies only to FIFO (first-in-first-out) topics.</p>
72    /// <p>The sequence number is a large, non-consecutive number that Amazon SNS assigns to each message. The length of <code>SequenceNumber</code> is 128 bits. <code>SequenceNumber</code> continues to increase for each <code>MessageGroupId</code>.</p>
73    pub fn set_sequence_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.sequence_number = input;
75        self
76    }
77    /// <p>This response element applies only to FIFO (first-in-first-out) topics.</p>
78    /// <p>The sequence number is a large, non-consecutive number that Amazon SNS assigns to each message. The length of <code>SequenceNumber</code> is 128 bits. <code>SequenceNumber</code> continues to increase for each <code>MessageGroupId</code>.</p>
79    pub fn get_sequence_number(&self) -> &::std::option::Option<::std::string::String> {
80        &self.sequence_number
81    }
82    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
83        self._request_id = Some(request_id.into());
84        self
85    }
86
87    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
88        self._request_id = request_id;
89        self
90    }
91    /// Consumes the builder and constructs a [`PublishOutput`](crate::operation::publish::PublishOutput).
92    pub fn build(self) -> crate::operation::publish::PublishOutput {
93        crate::operation::publish::PublishOutput {
94            message_id: self.message_id,
95            sequence_number: self.sequence_number,
96            _request_id: self._request_id,
97        }
98    }
99}