aws_sdk_appmesh/operation/create_virtual_gateway/_create_virtual_gateway_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 CreateVirtualGatewayInput {
6 /// <p>The name to use for the virtual gateway.</p>
7 pub virtual_gateway_name: ::std::option::Option<::std::string::String>,
8 /// <p>The name of the service mesh to create the virtual gateway in.</p>
9 pub mesh_name: ::std::option::Option<::std::string::String>,
10 /// <p>The virtual gateway specification to apply.</p>
11 pub spec: ::std::option::Option<crate::types::VirtualGatewaySpec>,
12 /// <p>Optional metadata that you can apply to the virtual gateway 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>
13 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>,
14 /// <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>
15 pub client_token: ::std::option::Option<::std::string::String>,
16 /// <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>
17 pub mesh_owner: ::std::option::Option<::std::string::String>,
18}
19impl CreateVirtualGatewayInput {
20 /// <p>The name to use for the virtual gateway.</p>
21 pub fn virtual_gateway_name(&self) -> ::std::option::Option<&str> {
22 self.virtual_gateway_name.as_deref()
23 }
24 /// <p>The name of the service mesh to create the virtual gateway in.</p>
25 pub fn mesh_name(&self) -> ::std::option::Option<&str> {
26 self.mesh_name.as_deref()
27 }
28 /// <p>The virtual gateway specification to apply.</p>
29 pub fn spec(&self) -> ::std::option::Option<&crate::types::VirtualGatewaySpec> {
30 self.spec.as_ref()
31 }
32 /// <p>Optional metadata that you can apply to the virtual gateway 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>
33 ///
34 /// 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()`.
35 pub fn tags(&self) -> &[crate::types::TagRef] {
36 self.tags.as_deref().unwrap_or_default()
37 }
38 /// <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>
39 pub fn client_token(&self) -> ::std::option::Option<&str> {
40 self.client_token.as_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 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>
43 pub fn mesh_owner(&self) -> ::std::option::Option<&str> {
44 self.mesh_owner.as_deref()
45 }
46}
47impl CreateVirtualGatewayInput {
48 /// Creates a new builder-style object to manufacture [`CreateVirtualGatewayInput`](crate::operation::create_virtual_gateway::CreateVirtualGatewayInput).
49 pub fn builder() -> crate::operation::create_virtual_gateway::builders::CreateVirtualGatewayInputBuilder {
50 crate::operation::create_virtual_gateway::builders::CreateVirtualGatewayInputBuilder::default()
51 }
52}
53
54/// A builder for [`CreateVirtualGatewayInput`](crate::operation::create_virtual_gateway::CreateVirtualGatewayInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateVirtualGatewayInputBuilder {
58 pub(crate) virtual_gateway_name: ::std::option::Option<::std::string::String>,
59 pub(crate) mesh_name: ::std::option::Option<::std::string::String>,
60 pub(crate) spec: ::std::option::Option<crate::types::VirtualGatewaySpec>,
61 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>,
62 pub(crate) client_token: ::std::option::Option<::std::string::String>,
63 pub(crate) mesh_owner: ::std::option::Option<::std::string::String>,
64}
65impl CreateVirtualGatewayInputBuilder {
66 /// <p>The name to use for the virtual gateway.</p>
67 /// This field is required.
68 pub fn virtual_gateway_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.virtual_gateway_name = ::std::option::Option::Some(input.into());
70 self
71 }
72 /// <p>The name to use for the virtual gateway.</p>
73 pub fn set_virtual_gateway_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.virtual_gateway_name = input;
75 self
76 }
77 /// <p>The name to use for the virtual gateway.</p>
78 pub fn get_virtual_gateway_name(&self) -> &::std::option::Option<::std::string::String> {
79 &self.virtual_gateway_name
80 }
81 /// <p>The name of the service mesh to create the virtual gateway in.</p>
82 /// This field is required.
83 pub fn mesh_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.mesh_name = ::std::option::Option::Some(input.into());
85 self
86 }
87 /// <p>The name of the service mesh to create the virtual gateway in.</p>
88 pub fn set_mesh_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.mesh_name = input;
90 self
91 }
92 /// <p>The name of the service mesh to create the virtual gateway in.</p>
93 pub fn get_mesh_name(&self) -> &::std::option::Option<::std::string::String> {
94 &self.mesh_name
95 }
96 /// <p>The virtual gateway specification to apply.</p>
97 /// This field is required.
98 pub fn spec(mut self, input: crate::types::VirtualGatewaySpec) -> Self {
99 self.spec = ::std::option::Option::Some(input);
100 self
101 }
102 /// <p>The virtual gateway specification to apply.</p>
103 pub fn set_spec(mut self, input: ::std::option::Option<crate::types::VirtualGatewaySpec>) -> Self {
104 self.spec = input;
105 self
106 }
107 /// <p>The virtual gateway specification to apply.</p>
108 pub fn get_spec(&self) -> &::std::option::Option<crate::types::VirtualGatewaySpec> {
109 &self.spec
110 }
111 /// Appends an item to `tags`.
112 ///
113 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
114 ///
115 /// <p>Optional metadata that you can apply to the virtual gateway 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>
116 pub fn tags(mut self, input: crate::types::TagRef) -> Self {
117 let mut v = self.tags.unwrap_or_default();
118 v.push(input);
119 self.tags = ::std::option::Option::Some(v);
120 self
121 }
122 /// <p>Optional metadata that you can apply to the virtual gateway 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>
123 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>) -> Self {
124 self.tags = input;
125 self
126 }
127 /// <p>Optional metadata that you can apply to the virtual gateway 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>
128 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagRef>> {
129 &self.tags
130 }
131 /// <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>
132 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.client_token = ::std::option::Option::Some(input.into());
134 self
135 }
136 /// <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>
137 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.client_token = input;
139 self
140 }
141 /// <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>
142 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
143 &self.client_token
144 }
145 /// <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>
146 pub fn mesh_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.mesh_owner = ::std::option::Option::Some(input.into());
148 self
149 }
150 /// <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>
151 pub fn set_mesh_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.mesh_owner = input;
153 self
154 }
155 /// <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>
156 pub fn get_mesh_owner(&self) -> &::std::option::Option<::std::string::String> {
157 &self.mesh_owner
158 }
159 /// Consumes the builder and constructs a [`CreateVirtualGatewayInput`](crate::operation::create_virtual_gateway::CreateVirtualGatewayInput).
160 pub fn build(
161 self,
162 ) -> ::std::result::Result<crate::operation::create_virtual_gateway::CreateVirtualGatewayInput, ::aws_smithy_types::error::operation::BuildError>
163 {
164 ::std::result::Result::Ok(crate::operation::create_virtual_gateway::CreateVirtualGatewayInput {
165 virtual_gateway_name: self.virtual_gateway_name,
166 mesh_name: self.mesh_name,
167 spec: self.spec,
168 tags: self.tags,
169 client_token: self.client_token,
170 mesh_owner: self.mesh_owner,
171 })
172 }
173}