aws_sdk_appmesh/operation/create_mesh/_create_mesh_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 CreateMeshInput {
6 /// <p>The name to use for the service mesh.</p>
7 pub mesh_name: ::std::option::Option<::std::string::String>,
8 /// <p>The service mesh specification to apply.</p>
9 pub spec: ::std::option::Option<crate::types::MeshSpec>,
10 /// <p>Optional metadata that you can apply to the service mesh 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>
11 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>,
12 /// <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>
13 pub client_token: ::std::option::Option<::std::string::String>,
14}
15impl CreateMeshInput {
16 /// <p>The name to use for the service mesh.</p>
17 pub fn mesh_name(&self) -> ::std::option::Option<&str> {
18 self.mesh_name.as_deref()
19 }
20 /// <p>The service mesh specification to apply.</p>
21 pub fn spec(&self) -> ::std::option::Option<&crate::types::MeshSpec> {
22 self.spec.as_ref()
23 }
24 /// <p>Optional metadata that you can apply to the service mesh 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>
25 ///
26 /// 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()`.
27 pub fn tags(&self) -> &[crate::types::TagRef] {
28 self.tags.as_deref().unwrap_or_default()
29 }
30 /// <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>
31 pub fn client_token(&self) -> ::std::option::Option<&str> {
32 self.client_token.as_deref()
33 }
34}
35impl CreateMeshInput {
36 /// Creates a new builder-style object to manufacture [`CreateMeshInput`](crate::operation::create_mesh::CreateMeshInput).
37 pub fn builder() -> crate::operation::create_mesh::builders::CreateMeshInputBuilder {
38 crate::operation::create_mesh::builders::CreateMeshInputBuilder::default()
39 }
40}
41
42/// A builder for [`CreateMeshInput`](crate::operation::create_mesh::CreateMeshInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateMeshInputBuilder {
46 pub(crate) mesh_name: ::std::option::Option<::std::string::String>,
47 pub(crate) spec: ::std::option::Option<crate::types::MeshSpec>,
48 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>,
49 pub(crate) client_token: ::std::option::Option<::std::string::String>,
50}
51impl CreateMeshInputBuilder {
52 /// <p>The name to use for the service mesh.</p>
53 /// This field is required.
54 pub fn mesh_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55 self.mesh_name = ::std::option::Option::Some(input.into());
56 self
57 }
58 /// <p>The name to use for the service mesh.</p>
59 pub fn set_mesh_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60 self.mesh_name = input;
61 self
62 }
63 /// <p>The name to use for the service mesh.</p>
64 pub fn get_mesh_name(&self) -> &::std::option::Option<::std::string::String> {
65 &self.mesh_name
66 }
67 /// <p>The service mesh specification to apply.</p>
68 pub fn spec(mut self, input: crate::types::MeshSpec) -> Self {
69 self.spec = ::std::option::Option::Some(input);
70 self
71 }
72 /// <p>The service mesh specification to apply.</p>
73 pub fn set_spec(mut self, input: ::std::option::Option<crate::types::MeshSpec>) -> Self {
74 self.spec = input;
75 self
76 }
77 /// <p>The service mesh specification to apply.</p>
78 pub fn get_spec(&self) -> &::std::option::Option<crate::types::MeshSpec> {
79 &self.spec
80 }
81 /// Appends an item to `tags`.
82 ///
83 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
84 ///
85 /// <p>Optional metadata that you can apply to the service mesh 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>
86 pub fn tags(mut self, input: crate::types::TagRef) -> Self {
87 let mut v = self.tags.unwrap_or_default();
88 v.push(input);
89 self.tags = ::std::option::Option::Some(v);
90 self
91 }
92 /// <p>Optional metadata that you can apply to the service mesh 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>
93 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagRef>>) -> Self {
94 self.tags = input;
95 self
96 }
97 /// <p>Optional metadata that you can apply to the service mesh 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>
98 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagRef>> {
99 &self.tags
100 }
101 /// <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>
102 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.client_token = ::std::option::Option::Some(input.into());
104 self
105 }
106 /// <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>
107 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.client_token = input;
109 self
110 }
111 /// <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>
112 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
113 &self.client_token
114 }
115 /// Consumes the builder and constructs a [`CreateMeshInput`](crate::operation::create_mesh::CreateMeshInput).
116 pub fn build(self) -> ::std::result::Result<crate::operation::create_mesh::CreateMeshInput, ::aws_smithy_types::error::operation::BuildError> {
117 ::std::result::Result::Ok(crate::operation::create_mesh::CreateMeshInput {
118 mesh_name: self.mesh_name,
119 spec: self.spec,
120 tags: self.tags,
121 client_token: self.client_token,
122 })
123 }
124}