aws_sdk_appmesh/types/
_route_ref.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object that represents a route returned by a list operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RouteRef {
7    /// <p>The name of the service mesh that the route resides in.</p>
8    pub mesh_name: ::std::string::String,
9    /// <p>The virtual router that the route is associated with.</p>
10    pub virtual_router_name: ::std::string::String,
11    /// <p>The name of the route.</p>
12    pub route_name: ::std::string::String,
13    /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
14    pub mesh_owner: ::std::string::String,
15    /// <p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
16    pub resource_owner: ::std::string::String,
17    /// <p>The full Amazon Resource Name (ARN) for the route.</p>
18    pub arn: ::std::string::String,
19    /// <p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they're updated.</p>
20    pub version: i64,
21    /// <p>The Unix epoch timestamp in seconds for when the resource was created.</p>
22    pub created_at: ::aws_smithy_types::DateTime,
23    /// <p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>
24    pub last_updated_at: ::aws_smithy_types::DateTime,
25}
26impl RouteRef {
27    /// <p>The name of the service mesh that the route resides in.</p>
28    pub fn mesh_name(&self) -> &str {
29        use std::ops::Deref;
30        self.mesh_name.deref()
31    }
32    /// <p>The virtual router that the route is associated with.</p>
33    pub fn virtual_router_name(&self) -> &str {
34        use std::ops::Deref;
35        self.virtual_router_name.deref()
36    }
37    /// <p>The name of the route.</p>
38    pub fn route_name(&self) -> &str {
39        use std::ops::Deref;
40        self.route_name.deref()
41    }
42    /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
43    pub fn mesh_owner(&self) -> &str {
44        use std::ops::Deref;
45        self.mesh_owner.deref()
46    }
47    /// <p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
48    pub fn resource_owner(&self) -> &str {
49        use std::ops::Deref;
50        self.resource_owner.deref()
51    }
52    /// <p>The full Amazon Resource Name (ARN) for the route.</p>
53    pub fn arn(&self) -> &str {
54        use std::ops::Deref;
55        self.arn.deref()
56    }
57    /// <p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they're updated.</p>
58    pub fn version(&self) -> i64 {
59        self.version
60    }
61    /// <p>The Unix epoch timestamp in seconds for when the resource was created.</p>
62    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
63        &self.created_at
64    }
65    /// <p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>
66    pub fn last_updated_at(&self) -> &::aws_smithy_types::DateTime {
67        &self.last_updated_at
68    }
69}
70impl RouteRef {
71    /// Creates a new builder-style object to manufacture [`RouteRef`](crate::types::RouteRef).
72    pub fn builder() -> crate::types::builders::RouteRefBuilder {
73        crate::types::builders::RouteRefBuilder::default()
74    }
75}
76
77/// A builder for [`RouteRef`](crate::types::RouteRef).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct RouteRefBuilder {
81    pub(crate) mesh_name: ::std::option::Option<::std::string::String>,
82    pub(crate) virtual_router_name: ::std::option::Option<::std::string::String>,
83    pub(crate) route_name: ::std::option::Option<::std::string::String>,
84    pub(crate) mesh_owner: ::std::option::Option<::std::string::String>,
85    pub(crate) resource_owner: ::std::option::Option<::std::string::String>,
86    pub(crate) arn: ::std::option::Option<::std::string::String>,
87    pub(crate) version: ::std::option::Option<i64>,
88    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
89    pub(crate) last_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
90}
91impl RouteRefBuilder {
92    /// <p>The name of the service mesh that the route resides in.</p>
93    /// This field is required.
94    pub fn mesh_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.mesh_name = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The name of the service mesh that the route resides in.</p>
99    pub fn set_mesh_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.mesh_name = input;
101        self
102    }
103    /// <p>The name of the service mesh that the route resides in.</p>
104    pub fn get_mesh_name(&self) -> &::std::option::Option<::std::string::String> {
105        &self.mesh_name
106    }
107    /// <p>The virtual router that the route is associated with.</p>
108    /// This field is required.
109    pub fn virtual_router_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.virtual_router_name = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The virtual router that the route is associated with.</p>
114    pub fn set_virtual_router_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.virtual_router_name = input;
116        self
117    }
118    /// <p>The virtual router that the route is associated with.</p>
119    pub fn get_virtual_router_name(&self) -> &::std::option::Option<::std::string::String> {
120        &self.virtual_router_name
121    }
122    /// <p>The name of the route.</p>
123    /// This field is required.
124    pub fn route_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.route_name = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The name of the route.</p>
129    pub fn set_route_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.route_name = input;
131        self
132    }
133    /// <p>The name of the route.</p>
134    pub fn get_route_name(&self) -> &::std::option::Option<::std::string::String> {
135        &self.route_name
136    }
137    /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
138    /// This field is required.
139    pub fn mesh_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.mesh_owner = ::std::option::Option::Some(input.into());
141        self
142    }
143    /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
144    pub fn set_mesh_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.mesh_owner = input;
146        self
147    }
148    /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then it's the ID of the account that shared the mesh with your account. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
149    pub fn get_mesh_owner(&self) -> &::std::option::Option<::std::string::String> {
150        &self.mesh_owner
151    }
152    /// <p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
153    /// This field is required.
154    pub fn resource_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.resource_owner = ::std::option::Option::Some(input.into());
156        self
157    }
158    /// <p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
159    pub fn set_resource_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.resource_owner = input;
161        self
162    }
163    /// <p>The Amazon Web Services IAM account ID of the resource owner. If the account ID is not your own, then it's the ID of the mesh owner or of another account that the mesh is shared with. For more information about mesh sharing, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/sharing.html">Working with shared meshes</a>.</p>
164    pub fn get_resource_owner(&self) -> &::std::option::Option<::std::string::String> {
165        &self.resource_owner
166    }
167    /// <p>The full Amazon Resource Name (ARN) for the route.</p>
168    /// This field is required.
169    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.arn = ::std::option::Option::Some(input.into());
171        self
172    }
173    /// <p>The full Amazon Resource Name (ARN) for the route.</p>
174    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.arn = input;
176        self
177    }
178    /// <p>The full Amazon Resource Name (ARN) for the route.</p>
179    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
180        &self.arn
181    }
182    /// <p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they're updated.</p>
183    /// This field is required.
184    pub fn version(mut self, input: i64) -> Self {
185        self.version = ::std::option::Option::Some(input);
186        self
187    }
188    /// <p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they're updated.</p>
189    pub fn set_version(mut self, input: ::std::option::Option<i64>) -> Self {
190        self.version = input;
191        self
192    }
193    /// <p>The version of the resource. Resources are created at version 1, and this version is incremented each time that they're updated.</p>
194    pub fn get_version(&self) -> &::std::option::Option<i64> {
195        &self.version
196    }
197    /// <p>The Unix epoch timestamp in seconds for when the resource was created.</p>
198    /// This field is required.
199    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
200        self.created_at = ::std::option::Option::Some(input);
201        self
202    }
203    /// <p>The Unix epoch timestamp in seconds for when the resource was created.</p>
204    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
205        self.created_at = input;
206        self
207    }
208    /// <p>The Unix epoch timestamp in seconds for when the resource was created.</p>
209    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
210        &self.created_at
211    }
212    /// <p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>
213    /// This field is required.
214    pub fn last_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
215        self.last_updated_at = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>
219    pub fn set_last_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
220        self.last_updated_at = input;
221        self
222    }
223    /// <p>The Unix epoch timestamp in seconds for when the resource was last updated.</p>
224    pub fn get_last_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
225        &self.last_updated_at
226    }
227    /// Consumes the builder and constructs a [`RouteRef`](crate::types::RouteRef).
228    /// This method will fail if any of the following fields are not set:
229    /// - [`mesh_name`](crate::types::builders::RouteRefBuilder::mesh_name)
230    /// - [`virtual_router_name`](crate::types::builders::RouteRefBuilder::virtual_router_name)
231    /// - [`route_name`](crate::types::builders::RouteRefBuilder::route_name)
232    /// - [`mesh_owner`](crate::types::builders::RouteRefBuilder::mesh_owner)
233    /// - [`resource_owner`](crate::types::builders::RouteRefBuilder::resource_owner)
234    /// - [`arn`](crate::types::builders::RouteRefBuilder::arn)
235    /// - [`version`](crate::types::builders::RouteRefBuilder::version)
236    /// - [`created_at`](crate::types::builders::RouteRefBuilder::created_at)
237    /// - [`last_updated_at`](crate::types::builders::RouteRefBuilder::last_updated_at)
238    pub fn build(self) -> ::std::result::Result<crate::types::RouteRef, ::aws_smithy_types::error::operation::BuildError> {
239        ::std::result::Result::Ok(crate::types::RouteRef {
240            mesh_name: self.mesh_name.ok_or_else(|| {
241                ::aws_smithy_types::error::operation::BuildError::missing_field(
242                    "mesh_name",
243                    "mesh_name was not specified but it is required when building RouteRef",
244                )
245            })?,
246            virtual_router_name: self.virtual_router_name.ok_or_else(|| {
247                ::aws_smithy_types::error::operation::BuildError::missing_field(
248                    "virtual_router_name",
249                    "virtual_router_name was not specified but it is required when building RouteRef",
250                )
251            })?,
252            route_name: self.route_name.ok_or_else(|| {
253                ::aws_smithy_types::error::operation::BuildError::missing_field(
254                    "route_name",
255                    "route_name was not specified but it is required when building RouteRef",
256                )
257            })?,
258            mesh_owner: self.mesh_owner.ok_or_else(|| {
259                ::aws_smithy_types::error::operation::BuildError::missing_field(
260                    "mesh_owner",
261                    "mesh_owner was not specified but it is required when building RouteRef",
262                )
263            })?,
264            resource_owner: self.resource_owner.ok_or_else(|| {
265                ::aws_smithy_types::error::operation::BuildError::missing_field(
266                    "resource_owner",
267                    "resource_owner was not specified but it is required when building RouteRef",
268                )
269            })?,
270            arn: self.arn.ok_or_else(|| {
271                ::aws_smithy_types::error::operation::BuildError::missing_field(
272                    "arn",
273                    "arn was not specified but it is required when building RouteRef",
274                )
275            })?,
276            version: self.version.ok_or_else(|| {
277                ::aws_smithy_types::error::operation::BuildError::missing_field(
278                    "version",
279                    "version was not specified but it is required when building RouteRef",
280                )
281            })?,
282            created_at: self.created_at.ok_or_else(|| {
283                ::aws_smithy_types::error::operation::BuildError::missing_field(
284                    "created_at",
285                    "created_at was not specified but it is required when building RouteRef",
286                )
287            })?,
288            last_updated_at: self.last_updated_at.ok_or_else(|| {
289                ::aws_smithy_types::error::operation::BuildError::missing_field(
290                    "last_updated_at",
291                    "last_updated_at was not specified but it is required when building RouteRef",
292                )
293            })?,
294        })
295    }
296}