aws_sdk_eventbridge/operation/create_archive/
_create_archive_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateArchiveOutput {
6 pub archive_arn: ::std::option::Option<::std::string::String>,
8 pub state: ::std::option::Option<crate::types::ArchiveState>,
10 pub state_reason: ::std::option::Option<::std::string::String>,
12 pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
14 _request_id: Option<String>,
15}
16impl CreateArchiveOutput {
17 pub fn archive_arn(&self) -> ::std::option::Option<&str> {
19 self.archive_arn.as_deref()
20 }
21 pub fn state(&self) -> ::std::option::Option<&crate::types::ArchiveState> {
23 self.state.as_ref()
24 }
25 pub fn state_reason(&self) -> ::std::option::Option<&str> {
27 self.state_reason.as_deref()
28 }
29 pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
31 self.creation_time.as_ref()
32 }
33}
34impl ::aws_types::request_id::RequestId for CreateArchiveOutput {
35 fn request_id(&self) -> Option<&str> {
36 self._request_id.as_deref()
37 }
38}
39impl CreateArchiveOutput {
40 pub fn builder() -> crate::operation::create_archive::builders::CreateArchiveOutputBuilder {
42 crate::operation::create_archive::builders::CreateArchiveOutputBuilder::default()
43 }
44}
45
46#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateArchiveOutputBuilder {
50 pub(crate) archive_arn: ::std::option::Option<::std::string::String>,
51 pub(crate) state: ::std::option::Option<crate::types::ArchiveState>,
52 pub(crate) state_reason: ::std::option::Option<::std::string::String>,
53 pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
54 _request_id: Option<String>,
55}
56impl CreateArchiveOutputBuilder {
57 pub fn archive_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59 self.archive_arn = ::std::option::Option::Some(input.into());
60 self
61 }
62 pub fn set_archive_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64 self.archive_arn = input;
65 self
66 }
67 pub fn get_archive_arn(&self) -> &::std::option::Option<::std::string::String> {
69 &self.archive_arn
70 }
71 pub fn state(mut self, input: crate::types::ArchiveState) -> Self {
73 self.state = ::std::option::Option::Some(input);
74 self
75 }
76 pub fn set_state(mut self, input: ::std::option::Option<crate::types::ArchiveState>) -> Self {
78 self.state = input;
79 self
80 }
81 pub fn get_state(&self) -> &::std::option::Option<crate::types::ArchiveState> {
83 &self.state
84 }
85 pub fn state_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.state_reason = ::std::option::Option::Some(input.into());
88 self
89 }
90 pub fn set_state_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.state_reason = input;
93 self
94 }
95 pub fn get_state_reason(&self) -> &::std::option::Option<::std::string::String> {
97 &self.state_reason
98 }
99 pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
101 self.creation_time = ::std::option::Option::Some(input);
102 self
103 }
104 pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
106 self.creation_time = input;
107 self
108 }
109 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
111 &self.creation_time
112 }
113 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
114 self._request_id = Some(request_id.into());
115 self
116 }
117
118 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
119 self._request_id = request_id;
120 self
121 }
122 pub fn build(self) -> crate::operation::create_archive::CreateArchiveOutput {
124 crate::operation::create_archive::CreateArchiveOutput {
125 archive_arn: self.archive_arn,
126 state: self.state,
127 state_reason: self.state_reason,
128 creation_time: self.creation_time,
129 _request_id: self._request_id,
130 }
131 }
132}