aws_sdk_sesv2/operation/create_tenant/_create_tenant_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents a request to create a tenant.</p>
4/// <p><i>Tenants</i> are logical containers that group related SES resources together. Each tenant can have its own set of resources like email identities, configuration sets, and templates, along with reputation metrics and sending status. This helps isolate and manage email sending for different customers or business units within your Amazon SES API v2 account.</p>
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct CreateTenantInput {
8 /// <p>The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.</p>
9 pub tenant_name: ::std::option::Option<::std::string::String>,
10 /// <p>An array of objects that define the tags (keys and values) to associate with the tenant</p>
11 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12}
13impl CreateTenantInput {
14 /// <p>The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.</p>
15 pub fn tenant_name(&self) -> ::std::option::Option<&str> {
16 self.tenant_name.as_deref()
17 }
18 /// <p>An array of objects that define the tags (keys and values) to associate with the tenant</p>
19 ///
20 /// 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()`.
21 pub fn tags(&self) -> &[crate::types::Tag] {
22 self.tags.as_deref().unwrap_or_default()
23 }
24}
25impl CreateTenantInput {
26 /// Creates a new builder-style object to manufacture [`CreateTenantInput`](crate::operation::create_tenant::CreateTenantInput).
27 pub fn builder() -> crate::operation::create_tenant::builders::CreateTenantInputBuilder {
28 crate::operation::create_tenant::builders::CreateTenantInputBuilder::default()
29 }
30}
31
32/// A builder for [`CreateTenantInput`](crate::operation::create_tenant::CreateTenantInput).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct CreateTenantInputBuilder {
36 pub(crate) tenant_name: ::std::option::Option<::std::string::String>,
37 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
38}
39impl CreateTenantInputBuilder {
40 /// <p>The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.</p>
41 /// This field is required.
42 pub fn tenant_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
43 self.tenant_name = ::std::option::Option::Some(input.into());
44 self
45 }
46 /// <p>The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.</p>
47 pub fn set_tenant_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
48 self.tenant_name = input;
49 self
50 }
51 /// <p>The name of the tenant to create. The name can contain up to 64 alphanumeric characters, including letters, numbers, hyphens (-) and underscores (_) only.</p>
52 pub fn get_tenant_name(&self) -> &::std::option::Option<::std::string::String> {
53 &self.tenant_name
54 }
55 /// Appends an item to `tags`.
56 ///
57 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
58 ///
59 /// <p>An array of objects that define the tags (keys and values) to associate with the tenant</p>
60 pub fn tags(mut self, input: crate::types::Tag) -> Self {
61 let mut v = self.tags.unwrap_or_default();
62 v.push(input);
63 self.tags = ::std::option::Option::Some(v);
64 self
65 }
66 /// <p>An array of objects that define the tags (keys and values) to associate with the tenant</p>
67 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
68 self.tags = input;
69 self
70 }
71 /// <p>An array of objects that define the tags (keys and values) to associate with the tenant</p>
72 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
73 &self.tags
74 }
75 /// Consumes the builder and constructs a [`CreateTenantInput`](crate::operation::create_tenant::CreateTenantInput).
76 pub fn build(
77 self,
78 ) -> ::std::result::Result<crate::operation::create_tenant::CreateTenantInput, ::aws_smithy_types::error::operation::BuildError> {
79 ::std::result::Result::Ok(crate::operation::create_tenant::CreateTenantInput {
80 tenant_name: self.tenant_name,
81 tags: self.tags,
82 })
83 }
84}