aws_sdk_codeartifact/operation/create_domain/_create_domain_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 CreateDomainInput {
6 /// <p>The name of the domain to create. All domain names in an Amazon Web Services Region that are in the same Amazon Web Services account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.</p>
7 pub domain: ::std::option::Option<::std::string::String>,
8 /// <p>The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an <code>encryptionKey</code>, your IAM role must have <code>kms:DescribeKey</code> and <code>kms:CreateGrant</code> permissions on the encryption key that is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestSyntax">DescribeKey</a> in the <i>Key Management Service API Reference</i> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">Key Management Service API Permissions Reference</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
9 /// <p>CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
10 /// </important>
11 pub encryption_key: ::std::option::Option<::std::string::String>,
12 /// <p>One or more tag key-value pairs for the domain.</p>
13 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateDomainInput {
16 /// <p>The name of the domain to create. All domain names in an Amazon Web Services Region that are in the same Amazon Web Services account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.</p>
17 pub fn domain(&self) -> ::std::option::Option<&str> {
18 self.domain.as_deref()
19 }
20 /// <p>The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an <code>encryptionKey</code>, your IAM role must have <code>kms:DescribeKey</code> and <code>kms:CreateGrant</code> permissions on the encryption key that is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestSyntax">DescribeKey</a> in the <i>Key Management Service API Reference</i> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">Key Management Service API Permissions Reference</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
21 /// <p>CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
22 /// </important>
23 pub fn encryption_key(&self) -> ::std::option::Option<&str> {
24 self.encryption_key.as_deref()
25 }
26 /// <p>One or more tag key-value pairs for the domain.</p>
27 ///
28 /// 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()`.
29 pub fn tags(&self) -> &[crate::types::Tag] {
30 self.tags.as_deref().unwrap_or_default()
31 }
32}
33impl CreateDomainInput {
34 /// Creates a new builder-style object to manufacture [`CreateDomainInput`](crate::operation::create_domain::CreateDomainInput).
35 pub fn builder() -> crate::operation::create_domain::builders::CreateDomainInputBuilder {
36 crate::operation::create_domain::builders::CreateDomainInputBuilder::default()
37 }
38}
39
40/// A builder for [`CreateDomainInput`](crate::operation::create_domain::CreateDomainInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateDomainInputBuilder {
44 pub(crate) domain: ::std::option::Option<::std::string::String>,
45 pub(crate) encryption_key: ::std::option::Option<::std::string::String>,
46 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
47}
48impl CreateDomainInputBuilder {
49 /// <p>The name of the domain to create. All domain names in an Amazon Web Services Region that are in the same Amazon Web Services account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.</p>
50 /// This field is required.
51 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.domain = ::std::option::Option::Some(input.into());
53 self
54 }
55 /// <p>The name of the domain to create. All domain names in an Amazon Web Services Region that are in the same Amazon Web Services account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.</p>
56 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57 self.domain = input;
58 self
59 }
60 /// <p>The name of the domain to create. All domain names in an Amazon Web Services Region that are in the same Amazon Web Services account must be unique. The domain name is used as the prefix in DNS hostnames. Do not use sensitive information in a domain name because it is publicly discoverable.</p>
61 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
62 &self.domain
63 }
64 /// <p>The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an <code>encryptionKey</code>, your IAM role must have <code>kms:DescribeKey</code> and <code>kms:CreateGrant</code> permissions on the encryption key that is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestSyntax">DescribeKey</a> in the <i>Key Management Service API Reference</i> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">Key Management Service API Permissions Reference</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
65 /// <p>CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
66 /// </important>
67 pub fn encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68 self.encryption_key = ::std::option::Option::Some(input.into());
69 self
70 }
71 /// <p>The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an <code>encryptionKey</code>, your IAM role must have <code>kms:DescribeKey</code> and <code>kms:CreateGrant</code> permissions on the encryption key that is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestSyntax">DescribeKey</a> in the <i>Key Management Service API Reference</i> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">Key Management Service API Permissions Reference</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
72 /// <p>CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
73 /// </important>
74 pub fn set_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75 self.encryption_key = input;
76 self
77 }
78 /// <p>The encryption key for the domain. This is used to encrypt content stored in a domain. An encryption key can be a key ID, a key Amazon Resource Name (ARN), a key alias, or a key alias ARN. To specify an <code>encryptionKey</code>, your IAM role must have <code>kms:DescribeKey</code> and <code>kms:CreateGrant</code> permissions on the encryption key that is used. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestSyntax">DescribeKey</a> in the <i>Key Management Service API Reference</i> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html">Key Management Service API Permissions Reference</a> in the <i>Key Management Service Developer Guide</i>.</p><important>
79 /// <p>CodeArtifact supports only symmetric CMKs. Do not associate an asymmetric CMK with your domain. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using symmetric and asymmetric keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
80 /// </important>
81 pub fn get_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
82 &self.encryption_key
83 }
84 /// Appends an item to `tags`.
85 ///
86 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
87 ///
88 /// <p>One or more tag key-value pairs for the domain.</p>
89 pub fn tags(mut self, input: crate::types::Tag) -> Self {
90 let mut v = self.tags.unwrap_or_default();
91 v.push(input);
92 self.tags = ::std::option::Option::Some(v);
93 self
94 }
95 /// <p>One or more tag key-value pairs for the domain.</p>
96 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
97 self.tags = input;
98 self
99 }
100 /// <p>One or more tag key-value pairs for the domain.</p>
101 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
102 &self.tags
103 }
104 /// Consumes the builder and constructs a [`CreateDomainInput`](crate::operation::create_domain::CreateDomainInput).
105 pub fn build(
106 self,
107 ) -> ::std::result::Result<crate::operation::create_domain::CreateDomainInput, ::aws_smithy_types::error::operation::BuildError> {
108 ::std::result::Result::Ok(crate::operation::create_domain::CreateDomainInput {
109 domain: self.domain,
110 encryption_key: self.encryption_key,
111 tags: self.tags,
112 })
113 }
114}