aws-sdk-route53 1.77.0

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

/// <p>The information for each resource record set that you want to change.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Change {
    /// <p>The action to perform:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATE</code>: Creates a resource record set that has the specified values.</p></li>
    /// <li>
    /// <p><code>DELETE</code>: Deletes a existing resource record set.</p><important>
    /// <p>To delete the resource record set that is associated with a traffic policy instance, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicyInstance.html">DeleteTrafficPolicyInstance</a>. Amazon Route 53 will delete the resource record set automatically. If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though it's no longer in use.</p>
    /// </important></li>
    /// <li>
    /// <p><code>UPSERT</code>: If a resource record set doesn't already exist, Route 53 creates it. If a resource record set does exist, Route 53 updates it with the values in the request.</p></li>
    /// </ul>
    pub action: crate::types::ChangeAction,
    /// <p>Information about the resource record set to create, delete, or update.</p>
    pub resource_record_set: ::std::option::Option<crate::types::ResourceRecordSet>,
}
impl Change {
    /// <p>The action to perform:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATE</code>: Creates a resource record set that has the specified values.</p></li>
    /// <li>
    /// <p><code>DELETE</code>: Deletes a existing resource record set.</p><important>
    /// <p>To delete the resource record set that is associated with a traffic policy instance, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicyInstance.html">DeleteTrafficPolicyInstance</a>. Amazon Route 53 will delete the resource record set automatically. If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though it's no longer in use.</p>
    /// </important></li>
    /// <li>
    /// <p><code>UPSERT</code>: If a resource record set doesn't already exist, Route 53 creates it. If a resource record set does exist, Route 53 updates it with the values in the request.</p></li>
    /// </ul>
    pub fn action(&self) -> &crate::types::ChangeAction {
        &self.action
    }
    /// <p>Information about the resource record set to create, delete, or update.</p>
    pub fn resource_record_set(&self) -> ::std::option::Option<&crate::types::ResourceRecordSet> {
        self.resource_record_set.as_ref()
    }
}
impl Change {
    /// Creates a new builder-style object to manufacture [`Change`](crate::types::Change).
    pub fn builder() -> crate::types::builders::ChangeBuilder {
        crate::types::builders::ChangeBuilder::default()
    }
}

/// A builder for [`Change`](crate::types::Change).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ChangeBuilder {
    pub(crate) action: ::std::option::Option<crate::types::ChangeAction>,
    pub(crate) resource_record_set: ::std::option::Option<crate::types::ResourceRecordSet>,
}
impl ChangeBuilder {
    /// <p>The action to perform:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATE</code>: Creates a resource record set that has the specified values.</p></li>
    /// <li>
    /// <p><code>DELETE</code>: Deletes a existing resource record set.</p><important>
    /// <p>To delete the resource record set that is associated with a traffic policy instance, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicyInstance.html">DeleteTrafficPolicyInstance</a>. Amazon Route 53 will delete the resource record set automatically. If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though it's no longer in use.</p>
    /// </important></li>
    /// <li>
    /// <p><code>UPSERT</code>: If a resource record set doesn't already exist, Route 53 creates it. If a resource record set does exist, Route 53 updates it with the values in the request.</p></li>
    /// </ul>
    /// This field is required.
    pub fn action(mut self, input: crate::types::ChangeAction) -> Self {
        self.action = ::std::option::Option::Some(input);
        self
    }
    /// <p>The action to perform:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATE</code>: Creates a resource record set that has the specified values.</p></li>
    /// <li>
    /// <p><code>DELETE</code>: Deletes a existing resource record set.</p><important>
    /// <p>To delete the resource record set that is associated with a traffic policy instance, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicyInstance.html">DeleteTrafficPolicyInstance</a>. Amazon Route 53 will delete the resource record set automatically. If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though it's no longer in use.</p>
    /// </important></li>
    /// <li>
    /// <p><code>UPSERT</code>: If a resource record set doesn't already exist, Route 53 creates it. If a resource record set does exist, Route 53 updates it with the values in the request.</p></li>
    /// </ul>
    pub fn set_action(mut self, input: ::std::option::Option<crate::types::ChangeAction>) -> Self {
        self.action = input;
        self
    }
    /// <p>The action to perform:</p>
    /// <ul>
    /// <li>
    /// <p><code>CREATE</code>: Creates a resource record set that has the specified values.</p></li>
    /// <li>
    /// <p><code>DELETE</code>: Deletes a existing resource record set.</p><important>
    /// <p>To delete the resource record set that is associated with a traffic policy instance, use <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_DeleteTrafficPolicyInstance.html">DeleteTrafficPolicyInstance</a>. Amazon Route 53 will delete the resource record set automatically. If you delete the resource record set by using <code>ChangeResourceRecordSets</code>, Route 53 doesn't automatically delete the traffic policy instance, and you'll continue to be charged for it even though it's no longer in use.</p>
    /// </important></li>
    /// <li>
    /// <p><code>UPSERT</code>: If a resource record set doesn't already exist, Route 53 creates it. If a resource record set does exist, Route 53 updates it with the values in the request.</p></li>
    /// </ul>
    pub fn get_action(&self) -> &::std::option::Option<crate::types::ChangeAction> {
        &self.action
    }
    /// <p>Information about the resource record set to create, delete, or update.</p>
    /// This field is required.
    pub fn resource_record_set(mut self, input: crate::types::ResourceRecordSet) -> Self {
        self.resource_record_set = ::std::option::Option::Some(input);
        self
    }
    /// <p>Information about the resource record set to create, delete, or update.</p>
    pub fn set_resource_record_set(mut self, input: ::std::option::Option<crate::types::ResourceRecordSet>) -> Self {
        self.resource_record_set = input;
        self
    }
    /// <p>Information about the resource record set to create, delete, or update.</p>
    pub fn get_resource_record_set(&self) -> &::std::option::Option<crate::types::ResourceRecordSet> {
        &self.resource_record_set
    }
    /// Consumes the builder and constructs a [`Change`](crate::types::Change).
    /// This method will fail if any of the following fields are not set:
    /// - [`action`](crate::types::builders::ChangeBuilder::action)
    pub fn build(self) -> ::std::result::Result<crate::types::Change, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Change {
            action: self.action.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "action",
                    "action was not specified but it is required when building Change",
                )
            })?,
            resource_record_set: self.resource_record_set,
        })
    }
}