aws-sdk-lightsail 1.106.0

AWS SDK for Amazon Lightsail
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a domain where you are storing recordsets.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Domain {
    /// <p>The name of the domain.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) of the domain recordset (<code>arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE</code>).</p>
    pub arn: ::std::option::Option<::std::string::String>,
    /// <p>The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.</p>
    pub support_code: ::std::option::Option<::std::string::String>,
    /// <p>The date when the domain recordset was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The AWS Region and Availability Zones where the domain recordset was created.</p>
    pub location: ::std::option::Option<crate::types::ResourceLocation>,
    /// <p>The resource type.</p>
    pub resource_type: ::std::option::Option<crate::types::ResourceType>,
    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>An array of key-value pairs containing information about the domain entries.</p>
    pub domain_entries: ::std::option::Option<::std::vec::Vec<crate::types::DomainEntry>>,
    /// <p>An object that describes the state of the Route&nbsp;53 domain delegation to a Lightsail DNS zone.</p>
    pub registered_domain_delegation_info: ::std::option::Option<crate::types::RegisteredDomainDelegationInfo>,
}
impl Domain {
    /// <p>The name of the domain.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) of the domain recordset (<code>arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE</code>).</p>
    pub fn arn(&self) -> ::std::option::Option<&str> {
        self.arn.as_deref()
    }
    /// <p>The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn support_code(&self) -> ::std::option::Option<&str> {
        self.support_code.as_deref()
    }
    /// <p>The date when the domain recordset was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The AWS Region and Availability Zones where the domain recordset was created.</p>
    pub fn location(&self) -> ::std::option::Option<&crate::types::ResourceLocation> {
        self.location.as_ref()
    }
    /// <p>The resource type.</p>
    pub fn resource_type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
        self.resource_type.as_ref()
    }
    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
    ///
    /// 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()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
    /// <p>An array of key-value pairs containing information about the domain entries.</p>
    ///
    /// 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_entries.is_none()`.
    pub fn domain_entries(&self) -> &[crate::types::DomainEntry] {
        self.domain_entries.as_deref().unwrap_or_default()
    }
    /// <p>An object that describes the state of the Route&nbsp;53 domain delegation to a Lightsail DNS zone.</p>
    pub fn registered_domain_delegation_info(&self) -> ::std::option::Option<&crate::types::RegisteredDomainDelegationInfo> {
        self.registered_domain_delegation_info.as_ref()
    }
}
impl Domain {
    /// Creates a new builder-style object to manufacture [`Domain`](crate::types::Domain).
    pub fn builder() -> crate::types::builders::DomainBuilder {
        crate::types::builders::DomainBuilder::default()
    }
}

/// A builder for [`Domain`](crate::types::Domain).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DomainBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) support_code: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) location: ::std::option::Option<crate::types::ResourceLocation>,
    pub(crate) resource_type: ::std::option::Option<crate::types::ResourceType>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) domain_entries: ::std::option::Option<::std::vec::Vec<crate::types::DomainEntry>>,
    pub(crate) registered_domain_delegation_info: ::std::option::Option<crate::types::RegisteredDomainDelegationInfo>,
}
impl DomainBuilder {
    /// <p>The name of the domain.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the domain.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the domain.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The Amazon Resource Name (ARN) of the domain recordset (<code>arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE</code>).</p>
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the domain recordset (<code>arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE</code>).</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the domain recordset (<code>arn:aws:lightsail:global:123456789101:Domain/824cede0-abc7-4f84-8dbc-12345EXAMPLE</code>).</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn support_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.support_code = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn set_support_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.support_code = input;
        self
    }
    /// <p>The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.</p>
    pub fn get_support_code(&self) -> &::std::option::Option<::std::string::String> {
        &self.support_code
    }
    /// <p>The date when the domain recordset was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date when the domain recordset was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The date when the domain recordset was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The AWS Region and Availability Zones where the domain recordset was created.</p>
    pub fn location(mut self, input: crate::types::ResourceLocation) -> Self {
        self.location = ::std::option::Option::Some(input);
        self
    }
    /// <p>The AWS Region and Availability Zones where the domain recordset was created.</p>
    pub fn set_location(mut self, input: ::std::option::Option<crate::types::ResourceLocation>) -> Self {
        self.location = input;
        self
    }
    /// <p>The AWS Region and Availability Zones where the domain recordset was created.</p>
    pub fn get_location(&self) -> &::std::option::Option<crate::types::ResourceLocation> {
        &self.location
    }
    /// <p>The resource type.</p>
    pub fn resource_type(mut self, input: crate::types::ResourceType) -> Self {
        self.resource_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The resource type.</p>
    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
        self.resource_type = input;
        self
    }
    /// <p>The resource type.</p>
    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::ResourceType> {
        &self.resource_type
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tag keys and optional values for the resource. For more information about tags in Lightsail, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-tags">Amazon Lightsail Developer Guide</a>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Appends an item to `domain_entries`.
    ///
    /// To override the contents of this collection use [`set_domain_entries`](Self::set_domain_entries).
    ///
    /// <p>An array of key-value pairs containing information about the domain entries.</p>
    pub fn domain_entries(mut self, input: crate::types::DomainEntry) -> Self {
        let mut v = self.domain_entries.unwrap_or_default();
        v.push(input);
        self.domain_entries = ::std::option::Option::Some(v);
        self
    }
    /// <p>An array of key-value pairs containing information about the domain entries.</p>
    pub fn set_domain_entries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DomainEntry>>) -> Self {
        self.domain_entries = input;
        self
    }
    /// <p>An array of key-value pairs containing information about the domain entries.</p>
    pub fn get_domain_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DomainEntry>> {
        &self.domain_entries
    }
    /// <p>An object that describes the state of the Route&nbsp;53 domain delegation to a Lightsail DNS zone.</p>
    pub fn registered_domain_delegation_info(mut self, input: crate::types::RegisteredDomainDelegationInfo) -> Self {
        self.registered_domain_delegation_info = ::std::option::Option::Some(input);
        self
    }
    /// <p>An object that describes the state of the Route&nbsp;53 domain delegation to a Lightsail DNS zone.</p>
    pub fn set_registered_domain_delegation_info(mut self, input: ::std::option::Option<crate::types::RegisteredDomainDelegationInfo>) -> Self {
        self.registered_domain_delegation_info = input;
        self
    }
    /// <p>An object that describes the state of the Route&nbsp;53 domain delegation to a Lightsail DNS zone.</p>
    pub fn get_registered_domain_delegation_info(&self) -> &::std::option::Option<crate::types::RegisteredDomainDelegationInfo> {
        &self.registered_domain_delegation_info
    }
    /// Consumes the builder and constructs a [`Domain`](crate::types::Domain).
    pub fn build(self) -> crate::types::Domain {
        crate::types::Domain {
            name: self.name,
            arn: self.arn,
            support_code: self.support_code,
            created_at: self.created_at,
            location: self.location,
            resource_type: self.resource_type,
            tags: self.tags,
            domain_entries: self.domain_entries,
            registered_domain_delegation_info: self.registered_domain_delegation_info,
        }
    }
}