aws_sdk_macie2/operation/create_member/_create_member_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 CreateMemberInput {
6 /// <p>The details of the account to associate with the administrator account.</p>
7 pub account: ::std::option::Option<crate::types::AccountDetail>,
8 /// <p>A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.</p>
9 /// <p>An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
10 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
11}
12impl CreateMemberInput {
13 /// <p>The details of the account to associate with the administrator account.</p>
14 pub fn account(&self) -> ::std::option::Option<&crate::types::AccountDetail> {
15 self.account.as_ref()
16 }
17 /// <p>A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.</p>
18 /// <p>An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
19 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
20 self.tags.as_ref()
21 }
22}
23impl CreateMemberInput {
24 /// Creates a new builder-style object to manufacture [`CreateMemberInput`](crate::operation::create_member::CreateMemberInput).
25 pub fn builder() -> crate::operation::create_member::builders::CreateMemberInputBuilder {
26 crate::operation::create_member::builders::CreateMemberInputBuilder::default()
27 }
28}
29
30/// A builder for [`CreateMemberInput`](crate::operation::create_member::CreateMemberInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateMemberInputBuilder {
34 pub(crate) account: ::std::option::Option<crate::types::AccountDetail>,
35 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
36}
37impl CreateMemberInputBuilder {
38 /// <p>The details of the account to associate with the administrator account.</p>
39 /// This field is required.
40 pub fn account(mut self, input: crate::types::AccountDetail) -> Self {
41 self.account = ::std::option::Option::Some(input);
42 self
43 }
44 /// <p>The details of the account to associate with the administrator account.</p>
45 pub fn set_account(mut self, input: ::std::option::Option<crate::types::AccountDetail>) -> Self {
46 self.account = input;
47 self
48 }
49 /// <p>The details of the account to associate with the administrator account.</p>
50 pub fn get_account(&self) -> &::std::option::Option<crate::types::AccountDetail> {
51 &self.account
52 }
53 /// Adds a key-value pair to `tags`.
54 ///
55 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
56 ///
57 /// <p>A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.</p>
58 /// <p>An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
59 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
60 let mut hash_map = self.tags.unwrap_or_default();
61 hash_map.insert(k.into(), v.into());
62 self.tags = ::std::option::Option::Some(hash_map);
63 self
64 }
65 /// <p>A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.</p>
66 /// <p>An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
67 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
68 self.tags = input;
69 self
70 }
71 /// <p>A map of key-value pairs that specifies the tags to associate with the account in Amazon Macie.</p>
72 /// <p>An account can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.</p>
73 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
74 &self.tags
75 }
76 /// Consumes the builder and constructs a [`CreateMemberInput`](crate::operation::create_member::CreateMemberInput).
77 pub fn build(
78 self,
79 ) -> ::std::result::Result<crate::operation::create_member::CreateMemberInput, ::aws_smithy_types::error::operation::BuildError> {
80 ::std::result::Result::Ok(crate::operation::create_member::CreateMemberInput {
81 account: self.account,
82 tags: self.tags,
83 })
84 }
85}