aws-sdk-location 0.26.0

AWS SDK for Amazon Location Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::batch_put_geofence::_batch_put_geofence_output::BatchPutGeofenceOutputBuilder;

pub use crate::operation::batch_put_geofence::_batch_put_geofence_input::BatchPutGeofenceInputBuilder;

/// Fluent builder constructing a request to `BatchPutGeofence`.
///
/// <p>A batch request for storing geofence geometries into a given geofence collection, or updates the geometry of an existing geofence if a geofence ID is included in the request.</p>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct BatchPutGeofenceFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::batch_put_geofence::builders::BatchPutGeofenceInputBuilder,
}
impl BatchPutGeofenceFluentBuilder {
    /// Creates a new `BatchPutGeofence`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::batch_put_geofence::BatchPutGeofence,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::batch_put_geofence::BatchPutGeofenceError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// 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::batch_put_geofence::BatchPutGeofenceOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::batch_put_geofence::BatchPutGeofenceError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>The geofence collection storing the geofences.</p>
    pub fn collection_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.collection_name(input.into());
        self
    }
    /// <p>The geofence collection storing the geofences.</p>
    pub fn set_collection_name(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_collection_name(input);
        self
    }
    /// Appends an item to `Entries`.
    ///
    /// To override the contents of this collection use [`set_entries`](Self::set_entries).
    ///
    /// <p>The batch of geofences to be stored in a geofence collection.</p>
    pub fn entries(mut self, input: crate::types::BatchPutGeofenceRequestEntry) -> Self {
        self.inner = self.inner.entries(input);
        self
    }
    /// <p>The batch of geofences to be stored in a geofence collection.</p>
    pub fn set_entries(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::BatchPutGeofenceRequestEntry>>,
    ) -> Self {
        self.inner = self.inner.set_entries(input);
        self
    }
}