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