aws-sdk-route53 1.51.0

AWS SDK for Amazon Route 53
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::change_cidr_collection::_change_cidr_collection_output::ChangeCidrCollectionOutputBuilder;

pub use crate::operation::change_cidr_collection::_change_cidr_collection_input::ChangeCidrCollectionInputBuilder;

impl crate::operation::change_cidr_collection::builders::ChangeCidrCollectionInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::change_cidr_collection::ChangeCidrCollectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::change_cidr_collection::ChangeCidrCollectionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.change_cidr_collection();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ChangeCidrCollection`.
///
/// <p>Creates, changes, or deletes CIDR blocks within a collection. Contains authoritative IP information mapping blocks to one or multiple locations.</p>
/// <p>A change request can update multiple locations in a collection at a time, which is helpful if you want to move one or more CIDR blocks from one location to another in one transaction, without downtime.</p>
/// <p><b>Limits</b></p>
/// <p>The max number of CIDR blocks included in the request is 1000. As a result, big updates require multiple API calls.</p>
/// <p><b> PUT and DELETE_IF_EXISTS</b></p>
/// <p>Use <code>ChangeCidrCollection</code> to perform the following actions:</p>
/// <ul>
/// <li>
/// <p><code>PUT</code>: Create a CIDR block within the specified collection.</p></li>
/// <li>
/// <p><code> DELETE_IF_EXISTS</code>: Delete an existing CIDR block from the collection.</p></li>
/// </ul>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ChangeCidrCollectionFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::change_cidr_collection::builders::ChangeCidrCollectionInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::change_cidr_collection::ChangeCidrCollectionOutput,
        crate::operation::change_cidr_collection::ChangeCidrCollectionError,
    > for ChangeCidrCollectionFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::change_cidr_collection::ChangeCidrCollectionOutput,
            crate::operation::change_cidr_collection::ChangeCidrCollectionError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ChangeCidrCollectionFluentBuilder {
    /// Creates a new `ChangeCidrCollectionFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the ChangeCidrCollection as a reference.
    pub fn as_input(&self) -> &crate::operation::change_cidr_collection::builders::ChangeCidrCollectionInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::change_cidr_collection::ChangeCidrCollectionOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::change_cidr_collection::ChangeCidrCollectionError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::change_cidr_collection::ChangeCidrCollection::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::change_cidr_collection::ChangeCidrCollection::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::change_cidr_collection::ChangeCidrCollectionOutput,
        crate::operation::change_cidr_collection::ChangeCidrCollectionError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>The UUID of the CIDR collection to update.</p>
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.id(input.into());
        self
    }
    /// <p>The UUID of the CIDR collection to update.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_id(input);
        self
    }
    /// <p>The UUID of the CIDR collection to update.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_id()
    }
    /// <p>A sequential counter that Amazon Route&nbsp;53 sets to 1 when you create a collection and increments it by 1 each time you update the collection.</p>
    /// <p>We recommend that you use <code>ListCidrCollection</code> to get the current value of <code>CollectionVersion</code> for the collection that you want to update, and then include that value with the change request. This prevents Route&nbsp;53 from overwriting an intervening update:</p>
    /// <ul>
    /// <li>
    /// <p>If the value in the request matches the value of <code>CollectionVersion</code> in the collection, Route&nbsp;53 updates the collection.</p></li>
    /// <li>
    /// <p>If the value of <code>CollectionVersion</code> in the collection is greater than the value in the request, the collection was changed after you got the version number. Route&nbsp;53 does not update the collection, and it returns a <code>CidrCollectionVersionMismatch</code> error.</p></li>
    /// </ul>
    pub fn collection_version(mut self, input: i64) -> Self {
        self.inner = self.inner.collection_version(input);
        self
    }
    /// <p>A sequential counter that Amazon Route&nbsp;53 sets to 1 when you create a collection and increments it by 1 each time you update the collection.</p>
    /// <p>We recommend that you use <code>ListCidrCollection</code> to get the current value of <code>CollectionVersion</code> for the collection that you want to update, and then include that value with the change request. This prevents Route&nbsp;53 from overwriting an intervening update:</p>
    /// <ul>
    /// <li>
    /// <p>If the value in the request matches the value of <code>CollectionVersion</code> in the collection, Route&nbsp;53 updates the collection.</p></li>
    /// <li>
    /// <p>If the value of <code>CollectionVersion</code> in the collection is greater than the value in the request, the collection was changed after you got the version number. Route&nbsp;53 does not update the collection, and it returns a <code>CidrCollectionVersionMismatch</code> error.</p></li>
    /// </ul>
    pub fn set_collection_version(mut self, input: ::std::option::Option<i64>) -> Self {
        self.inner = self.inner.set_collection_version(input);
        self
    }
    /// <p>A sequential counter that Amazon Route&nbsp;53 sets to 1 when you create a collection and increments it by 1 each time you update the collection.</p>
    /// <p>We recommend that you use <code>ListCidrCollection</code> to get the current value of <code>CollectionVersion</code> for the collection that you want to update, and then include that value with the change request. This prevents Route&nbsp;53 from overwriting an intervening update:</p>
    /// <ul>
    /// <li>
    /// <p>If the value in the request matches the value of <code>CollectionVersion</code> in the collection, Route&nbsp;53 updates the collection.</p></li>
    /// <li>
    /// <p>If the value of <code>CollectionVersion</code> in the collection is greater than the value in the request, the collection was changed after you got the version number. Route&nbsp;53 does not update the collection, and it returns a <code>CidrCollectionVersionMismatch</code> error.</p></li>
    /// </ul>
    pub fn get_collection_version(&self) -> &::std::option::Option<i64> {
        self.inner.get_collection_version()
    }
    ///
    /// Appends an item to `Changes`.
    ///
    /// To override the contents of this collection use [`set_changes`](Self::set_changes).
    ///
    /// <p>Information about changes to a CIDR collection.</p>
    pub fn changes(mut self, input: crate::types::CidrCollectionChange) -> Self {
        self.inner = self.inner.changes(input);
        self
    }
    /// <p>Information about changes to a CIDR collection.</p>
    pub fn set_changes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CidrCollectionChange>>) -> Self {
        self.inner = self.inner.set_changes(input);
        self
    }
    /// <p>Information about changes to a CIDR collection.</p>
    pub fn get_changes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CidrCollectionChange>> {
        self.inner.get_changes()
    }
}