aws_sdk_lightsail/operation/create_certificate/
_create_certificate_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 CreateCertificateInput {
6    /// <p>The name for the certificate.</p>
7    pub certificate_name: ::std::option::Option<::std::string::String>,
8    /// <p>The domain name (<code>example.com</code>) for the certificate.</p>
9    pub domain_name: ::std::option::Option<::std::string::String>,
10    /// <p>An array of strings that specify the alternate domains (<code>example2.com</code>) and subdomains (<code>blog.example.com</code>) for the certificate.</p>
11    /// <p>You can specify a maximum of nine alternate domains (in addition to the primary domain name).</p>
12    /// <p>Wildcard domain entries (<code>*.example.com</code>) are not supported.</p>
13    pub subject_alternative_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    /// <p>The tag keys and optional values to add to the certificate during create.</p>
15    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
16    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
17}
18impl CreateCertificateInput {
19    /// <p>The name for the certificate.</p>
20    pub fn certificate_name(&self) -> ::std::option::Option<&str> {
21        self.certificate_name.as_deref()
22    }
23    /// <p>The domain name (<code>example.com</code>) for the certificate.</p>
24    pub fn domain_name(&self) -> ::std::option::Option<&str> {
25        self.domain_name.as_deref()
26    }
27    /// <p>An array of strings that specify the alternate domains (<code>example2.com</code>) and subdomains (<code>blog.example.com</code>) for the certificate.</p>
28    /// <p>You can specify a maximum of nine alternate domains (in addition to the primary domain name).</p>
29    /// <p>Wildcard domain entries (<code>*.example.com</code>) are not supported.</p>
30    ///
31    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subject_alternative_names.is_none()`.
32    pub fn subject_alternative_names(&self) -> &[::std::string::String] {
33        self.subject_alternative_names.as_deref().unwrap_or_default()
34    }
35    /// <p>The tag keys and optional values to add to the certificate during create.</p>
36    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
37    ///
38    /// 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()`.
39    pub fn tags(&self) -> &[crate::types::Tag] {
40        self.tags.as_deref().unwrap_or_default()
41    }
42}
43impl CreateCertificateInput {
44    /// Creates a new builder-style object to manufacture [`CreateCertificateInput`](crate::operation::create_certificate::CreateCertificateInput).
45    pub fn builder() -> crate::operation::create_certificate::builders::CreateCertificateInputBuilder {
46        crate::operation::create_certificate::builders::CreateCertificateInputBuilder::default()
47    }
48}
49
50/// A builder for [`CreateCertificateInput`](crate::operation::create_certificate::CreateCertificateInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CreateCertificateInputBuilder {
54    pub(crate) certificate_name: ::std::option::Option<::std::string::String>,
55    pub(crate) domain_name: ::std::option::Option<::std::string::String>,
56    pub(crate) subject_alternative_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
57    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
58}
59impl CreateCertificateInputBuilder {
60    /// <p>The name for the certificate.</p>
61    /// This field is required.
62    pub fn certificate_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.certificate_name = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The name for the certificate.</p>
67    pub fn set_certificate_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.certificate_name = input;
69        self
70    }
71    /// <p>The name for the certificate.</p>
72    pub fn get_certificate_name(&self) -> &::std::option::Option<::std::string::String> {
73        &self.certificate_name
74    }
75    /// <p>The domain name (<code>example.com</code>) for the certificate.</p>
76    /// This field is required.
77    pub fn domain_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.domain_name = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The domain name (<code>example.com</code>) for the certificate.</p>
82    pub fn set_domain_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.domain_name = input;
84        self
85    }
86    /// <p>The domain name (<code>example.com</code>) for the certificate.</p>
87    pub fn get_domain_name(&self) -> &::std::option::Option<::std::string::String> {
88        &self.domain_name
89    }
90    /// Appends an item to `subject_alternative_names`.
91    ///
92    /// To override the contents of this collection use [`set_subject_alternative_names`](Self::set_subject_alternative_names).
93    ///
94    /// <p>An array of strings that specify the alternate domains (<code>example2.com</code>) and subdomains (<code>blog.example.com</code>) for the certificate.</p>
95    /// <p>You can specify a maximum of nine alternate domains (in addition to the primary domain name).</p>
96    /// <p>Wildcard domain entries (<code>*.example.com</code>) are not supported.</p>
97    pub fn subject_alternative_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        let mut v = self.subject_alternative_names.unwrap_or_default();
99        v.push(input.into());
100        self.subject_alternative_names = ::std::option::Option::Some(v);
101        self
102    }
103    /// <p>An array of strings that specify the alternate domains (<code>example2.com</code>) and subdomains (<code>blog.example.com</code>) for the certificate.</p>
104    /// <p>You can specify a maximum of nine alternate domains (in addition to the primary domain name).</p>
105    /// <p>Wildcard domain entries (<code>*.example.com</code>) are not supported.</p>
106    pub fn set_subject_alternative_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
107        self.subject_alternative_names = input;
108        self
109    }
110    /// <p>An array of strings that specify the alternate domains (<code>example2.com</code>) and subdomains (<code>blog.example.com</code>) for the certificate.</p>
111    /// <p>You can specify a maximum of nine alternate domains (in addition to the primary domain name).</p>
112    /// <p>Wildcard domain entries (<code>*.example.com</code>) are not supported.</p>
113    pub fn get_subject_alternative_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
114        &self.subject_alternative_names
115    }
116    /// Appends an item to `tags`.
117    ///
118    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
119    ///
120    /// <p>The tag keys and optional values to add to the certificate during create.</p>
121    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
122    pub fn tags(mut self, input: crate::types::Tag) -> Self {
123        let mut v = self.tags.unwrap_or_default();
124        v.push(input);
125        self.tags = ::std::option::Option::Some(v);
126        self
127    }
128    /// <p>The tag keys and optional values to add to the certificate during create.</p>
129    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
130    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
131        self.tags = input;
132        self
133    }
134    /// <p>The tag keys and optional values to add to the certificate during create.</p>
135    /// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
136    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
137        &self.tags
138    }
139    /// Consumes the builder and constructs a [`CreateCertificateInput`](crate::operation::create_certificate::CreateCertificateInput).
140    pub fn build(
141        self,
142    ) -> ::std::result::Result<crate::operation::create_certificate::CreateCertificateInput, ::aws_smithy_types::error::operation::BuildError> {
143        ::std::result::Result::Ok(crate::operation::create_certificate::CreateCertificateInput {
144            certificate_name: self.certificate_name,
145            domain_name: self.domain_name,
146            subject_alternative_names: self.subject_alternative_names,
147            tags: self.tags,
148        })
149    }
150}