aws_sdk_appmesh/operation/create_route/_create_route_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRouteInput {
6 /// <p>The name to use for the route.</p>
7 pub route_name: ::std::option::Option<::std::string::String>,
8 /// <p>The name of the service mesh to create the route in.</p>
9 pub mesh_name: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.</p>
11 pub virtual_router_name: ::std::option::Option<::std::string::String>,
12 /// <p>The route specification to apply.</p>
13 pub spec: ::std::option::Option<crate::types::RouteSpec>,
14 /// <p>Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
15 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>,
16 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
17 pub client_token: ::std::option::Option<::std::string::String>,
18 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. 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>
19 pub mesh_owner: ::std::option::Option<::std::string::String>,
20}
21impl CreateRouteInput {
22 /// <p>The name to use for the route.</p>
23 pub fn route_name(&self) -> ::std::option::Option<&str> {
24 self.route_name.as_deref()
25 }
26 /// <p>The name of the service mesh to create the route in.</p>
27 pub fn mesh_name(&self) -> ::std::option::Option<&str> {
28 self.mesh_name.as_deref()
29 }
30 /// <p>The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.</p>
31 pub fn virtual_router_name(&self) -> ::std::option::Option<&str> {
32 self.virtual_router_name.as_deref()
33 }
34 /// <p>The route specification to apply.</p>
35 pub fn spec(&self) -> ::std::option::Option<&crate::types::RouteSpec> {
36 self.spec.as_ref()
37 }
38 /// <p>Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
39 ///
40 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
41 pub fn tags(&self) -> &[crate::types::TagRef] {
42 self.tags.as_deref().unwrap_or_default()
43 }
44 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
45 pub fn client_token(&self) -> ::std::option::Option<&str> {
46 self.client_token.as_deref()
47 }
48 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. 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>
49 pub fn mesh_owner(&self) -> ::std::option::Option<&str> {
50 self.mesh_owner.as_deref()
51 }
52}
53impl CreateRouteInput {
54 /// Creates a new builder-style object to manufacture [`CreateRouteInput`](crate::operation::create_route::CreateRouteInput).
55 pub fn builder() -> crate::operation::create_route::builders::CreateRouteInputBuilder {
56 crate::operation::create_route::builders::CreateRouteInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreateRouteInput`](crate::operation::create_route::CreateRouteInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateRouteInputBuilder {
64 pub(crate) route_name: ::std::option::Option<::std::string::String>,
65 pub(crate) mesh_name: ::std::option::Option<::std::string::String>,
66 pub(crate) virtual_router_name: ::std::option::Option<::std::string::String>,
67 pub(crate) spec: ::std::option::Option<crate::types::RouteSpec>,
68 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>,
69 pub(crate) client_token: ::std::option::Option<::std::string::String>,
70 pub(crate) mesh_owner: ::std::option::Option<::std::string::String>,
71}
72impl CreateRouteInputBuilder {
73 /// <p>The name to use for the route.</p>
74 /// This field is required.
75 pub fn route_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.route_name = ::std::option::Option::Some(input.into());
77 self
78 }
79 /// <p>The name to use for the route.</p>
80 pub fn set_route_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.route_name = input;
82 self
83 }
84 /// <p>The name to use for the route.</p>
85 pub fn get_route_name(&self) -> &::std::option::Option<::std::string::String> {
86 &self.route_name
87 }
88 /// <p>The name of the service mesh to create the route in.</p>
89 /// This field is required.
90 pub fn mesh_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91 self.mesh_name = ::std::option::Option::Some(input.into());
92 self
93 }
94 /// <p>The name of the service mesh to create the route in.</p>
95 pub fn set_mesh_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96 self.mesh_name = input;
97 self
98 }
99 /// <p>The name of the service mesh to create the route in.</p>
100 pub fn get_mesh_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.mesh_name
102 }
103 /// <p>The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.</p>
104 /// This field is required.
105 pub fn virtual_router_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106 self.virtual_router_name = ::std::option::Option::Some(input.into());
107 self
108 }
109 /// <p>The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.</p>
110 pub fn set_virtual_router_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111 self.virtual_router_name = input;
112 self
113 }
114 /// <p>The name of the virtual router in which to create the route. If the virtual router is in a shared mesh, then you must be the owner of the virtual router resource.</p>
115 pub fn get_virtual_router_name(&self) -> &::std::option::Option<::std::string::String> {
116 &self.virtual_router_name
117 }
118 /// <p>The route specification to apply.</p>
119 /// This field is required.
120 pub fn spec(mut self, input: crate::types::RouteSpec) -> Self {
121 self.spec = ::std::option::Option::Some(input);
122 self
123 }
124 /// <p>The route specification to apply.</p>
125 pub fn set_spec(mut self, input: ::std::option::Option<crate::types::RouteSpec>) -> Self {
126 self.spec = input;
127 self
128 }
129 /// <p>The route specification to apply.</p>
130 pub fn get_spec(&self) -> &::std::option::Option<crate::types::RouteSpec> {
131 &self.spec
132 }
133 /// Appends an item to `tags`.
134 ///
135 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
136 ///
137 /// <p>Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
138 pub fn tags(mut self, input: crate::types::TagRef) -> Self {
139 let mut v = self.tags.unwrap_or_default();
140 v.push(input);
141 self.tags = ::std::option::Option::Some(v);
142 self
143 }
144 /// <p>Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
145 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>) -> Self {
146 self.tags = input;
147 self
148 }
149 /// <p>Optional metadata that you can apply to the route to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Tag keys can have a maximum character length of 128 characters, and tag values can have a maximum length of 256 characters.</p>
150 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagRef>> {
151 &self.tags
152 }
153 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
154 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.client_token = ::std::option::Option::Some(input.into());
156 self
157 }
158 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
159 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.client_token = input;
161 self
162 }
163 /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Up to 36 letters, numbers, hyphens, and underscores are allowed.</p>
164 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
165 &self.client_token
166 }
167 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. 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>
168 pub fn mesh_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.mesh_owner = ::std::option::Option::Some(input.into());
170 self
171 }
172 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. 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>
173 pub fn set_mesh_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.mesh_owner = input;
175 self
176 }
177 /// <p>The Amazon Web Services IAM account ID of the service mesh owner. If the account ID is not your own, then the account that you specify must share the mesh with your account before you can create the resource in the service mesh. 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>
178 pub fn get_mesh_owner(&self) -> &::std::option::Option<::std::string::String> {
179 &self.mesh_owner
180 }
181 /// Consumes the builder and constructs a [`CreateRouteInput`](crate::operation::create_route::CreateRouteInput).
182 pub fn build(self) -> ::std::result::Result<crate::operation::create_route::CreateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
183 ::std::result::Result::Ok(crate::operation::create_route::CreateRouteInput {
184 route_name: self.route_name,
185 mesh_name: self.mesh_name,
186 virtual_router_name: self.virtual_router_name,
187 spec: self.spec,
188 tags: self.tags,
189 client_token: self.client_token,
190 mesh_owner: self.mesh_owner,
191 })
192 }
193}