aws_sdk_lightsail/types/
_setup_request.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Returns information that was submitted during the <code>SetupInstanceHttps</code> request. Email information is redacted for privacy.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SetupRequest {
7    /// <p>The name of the Lightsail instance.</p>
8    pub instance_name: ::std::option::Option<::std::string::String>,
9    /// <p>The name of the domain and subdomains that the SSL/TLS certificate secures.</p>
10    pub domain_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
11    /// <p>The Certificate Authority (CA) that issues the SSL/TLS certificate.</p>
12    pub certificate_provider: ::std::option::Option<crate::types::CertificateProvider>,
13}
14impl SetupRequest {
15    /// <p>The name of the Lightsail instance.</p>
16    pub fn instance_name(&self) -> ::std::option::Option<&str> {
17        self.instance_name.as_deref()
18    }
19    /// <p>The name of the domain and subdomains that the SSL/TLS certificate secures.</p>
20    ///
21    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.domain_names.is_none()`.
22    pub fn domain_names(&self) -> &[::std::string::String] {
23        self.domain_names.as_deref().unwrap_or_default()
24    }
25    /// <p>The Certificate Authority (CA) that issues the SSL/TLS certificate.</p>
26    pub fn certificate_provider(&self) -> ::std::option::Option<&crate::types::CertificateProvider> {
27        self.certificate_provider.as_ref()
28    }
29}
30impl SetupRequest {
31    /// Creates a new builder-style object to manufacture [`SetupRequest`](crate::types::SetupRequest).
32    pub fn builder() -> crate::types::builders::SetupRequestBuilder {
33        crate::types::builders::SetupRequestBuilder::default()
34    }
35}
36
37/// A builder for [`SetupRequest`](crate::types::SetupRequest).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct SetupRequestBuilder {
41    pub(crate) instance_name: ::std::option::Option<::std::string::String>,
42    pub(crate) domain_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
43    pub(crate) certificate_provider: ::std::option::Option<crate::types::CertificateProvider>,
44}
45impl SetupRequestBuilder {
46    /// <p>The name of the Lightsail instance.</p>
47    pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.instance_name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The name of the Lightsail instance.</p>
52    pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.instance_name = input;
54        self
55    }
56    /// <p>The name of the Lightsail instance.</p>
57    pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.instance_name
59    }
60    /// Appends an item to `domain_names`.
61    ///
62    /// To override the contents of this collection use [`set_domain_names`](Self::set_domain_names).
63    ///
64    /// <p>The name of the domain and subdomains that the SSL/TLS certificate secures.</p>
65    pub fn domain_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        let mut v = self.domain_names.unwrap_or_default();
67        v.push(input.into());
68        self.domain_names = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>The name of the domain and subdomains that the SSL/TLS certificate secures.</p>
72    pub fn set_domain_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
73        self.domain_names = input;
74        self
75    }
76    /// <p>The name of the domain and subdomains that the SSL/TLS certificate secures.</p>
77    pub fn get_domain_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
78        &self.domain_names
79    }
80    /// <p>The Certificate Authority (CA) that issues the SSL/TLS certificate.</p>
81    pub fn certificate_provider(mut self, input: crate::types::CertificateProvider) -> Self {
82        self.certificate_provider = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The Certificate Authority (CA) that issues the SSL/TLS certificate.</p>
86    pub fn set_certificate_provider(mut self, input: ::std::option::Option<crate::types::CertificateProvider>) -> Self {
87        self.certificate_provider = input;
88        self
89    }
90    /// <p>The Certificate Authority (CA) that issues the SSL/TLS certificate.</p>
91    pub fn get_certificate_provider(&self) -> &::std::option::Option<crate::types::CertificateProvider> {
92        &self.certificate_provider
93    }
94    /// Consumes the builder and constructs a [`SetupRequest`](crate::types::SetupRequest).
95    pub fn build(self) -> crate::types::SetupRequest {
96        crate::types::SetupRequest {
97            instance_name: self.instance_name,
98            domain_names: self.domain_names,
99            certificate_provider: self.certificate_provider,
100        }
101    }
102}