aws_sdk_evidently/types/
_ref_resource.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RefResource {
7 pub name: ::std::string::String,
9 pub r#type: ::std::string::String,
11 pub arn: ::std::option::Option<::std::string::String>,
13 pub status: ::std::option::Option<::std::string::String>,
15 pub start_time: ::std::option::Option<::std::string::String>,
17 pub end_time: ::std::option::Option<::std::string::String>,
19 pub last_updated_on: ::std::option::Option<::std::string::String>,
21}
22impl RefResource {
23 pub fn name(&self) -> &str {
25 use std::ops::Deref;
26 self.name.deref()
27 }
28 pub fn r#type(&self) -> &str {
30 use std::ops::Deref;
31 self.r#type.deref()
32 }
33 pub fn arn(&self) -> ::std::option::Option<&str> {
35 self.arn.as_deref()
36 }
37 pub fn status(&self) -> ::std::option::Option<&str> {
39 self.status.as_deref()
40 }
41 pub fn start_time(&self) -> ::std::option::Option<&str> {
43 self.start_time.as_deref()
44 }
45 pub fn end_time(&self) -> ::std::option::Option<&str> {
47 self.end_time.as_deref()
48 }
49 pub fn last_updated_on(&self) -> ::std::option::Option<&str> {
51 self.last_updated_on.as_deref()
52 }
53}
54impl RefResource {
55 pub fn builder() -> crate::types::builders::RefResourceBuilder {
57 crate::types::builders::RefResourceBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct RefResourceBuilder {
65 pub(crate) name: ::std::option::Option<::std::string::String>,
66 pub(crate) r#type: ::std::option::Option<::std::string::String>,
67 pub(crate) arn: ::std::option::Option<::std::string::String>,
68 pub(crate) status: ::std::option::Option<::std::string::String>,
69 pub(crate) start_time: ::std::option::Option<::std::string::String>,
70 pub(crate) end_time: ::std::option::Option<::std::string::String>,
71 pub(crate) last_updated_on: ::std::option::Option<::std::string::String>,
72}
73impl RefResourceBuilder {
74 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.name = ::std::option::Option::Some(input.into());
78 self
79 }
80 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.name = input;
83 self
84 }
85 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
87 &self.name
88 }
89 pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92 self.r#type = ::std::option::Option::Some(input.into());
93 self
94 }
95 pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97 self.r#type = input;
98 self
99 }
100 pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
102 &self.r#type
103 }
104 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.arn = ::std::option::Option::Some(input.into());
107 self
108 }
109 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.arn = input;
112 self
113 }
114 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
116 &self.arn
117 }
118 pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.status = ::std::option::Option::Some(input.into());
121 self
122 }
123 pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.status = input;
126 self
127 }
128 pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
130 &self.status
131 }
132 pub fn start_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.start_time = ::std::option::Option::Some(input.into());
135 self
136 }
137 pub fn set_start_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139 self.start_time = input;
140 self
141 }
142 pub fn get_start_time(&self) -> &::std::option::Option<::std::string::String> {
144 &self.start_time
145 }
146 pub fn end_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.end_time = ::std::option::Option::Some(input.into());
149 self
150 }
151 pub fn set_end_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.end_time = input;
154 self
155 }
156 pub fn get_end_time(&self) -> &::std::option::Option<::std::string::String> {
158 &self.end_time
159 }
160 pub fn last_updated_on(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162 self.last_updated_on = ::std::option::Option::Some(input.into());
163 self
164 }
165 pub fn set_last_updated_on(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.last_updated_on = input;
168 self
169 }
170 pub fn get_last_updated_on(&self) -> &::std::option::Option<::std::string::String> {
172 &self.last_updated_on
173 }
174 pub fn build(self) -> ::std::result::Result<crate::types::RefResource, ::aws_smithy_types::error::operation::BuildError> {
179 ::std::result::Result::Ok(crate::types::RefResource {
180 name: self.name.ok_or_else(|| {
181 ::aws_smithy_types::error::operation::BuildError::missing_field(
182 "name",
183 "name was not specified but it is required when building RefResource",
184 )
185 })?,
186 r#type: self.r#type.ok_or_else(|| {
187 ::aws_smithy_types::error::operation::BuildError::missing_field(
188 "r#type",
189 "r#type was not specified but it is required when building RefResource",
190 )
191 })?,
192 arn: self.arn,
193 status: self.status,
194 start_time: self.start_time,
195 end_time: self.end_time,
196 last_updated_on: self.last_updated_on,
197 })
198 }
199}