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_evaluate_geofences::_batch_evaluate_geofences_output::BatchEvaluateGeofencesOutputBuilder;

pub use crate::operation::batch_evaluate_geofences::_batch_evaluate_geofences_input::BatchEvaluateGeofencesInputBuilder;

/// Fluent builder constructing a request to `BatchEvaluateGeofences`.
///
/// <p>Evaluates device positions against the geofence geometries from a given geofence collection.</p>
/// <p>This operation always returns an empty response because geofences are asynchronously evaluated. The evaluation determines if the device has entered or exited a geofenced area, and then publishes one of the following events to Amazon EventBridge:</p>
/// <ul>
/// <li> <p> <code>ENTER</code> if Amazon Location determines that the tracked device has entered a geofenced area.</p> </li>
/// <li> <p> <code>EXIT</code> if Amazon Location determines that the tracked device has exited a geofenced area.</p> </li>
/// </ul> <note>
/// <p>The last geofence that a device was observed within is tracked for 30 days after the most recent device position update.</p>
/// </note> <note>
/// <p>Geofence evaluation uses the given device position. It does not account for the optional <code>Accuracy</code> of a <code>DevicePositionUpdate</code>.</p>
/// </note> <note>
/// <p>The <code>DeviceID</code> is used as a string to represent the device. You do not need to have a <code>Tracker</code> associated with the <code>DeviceID</code>.</p>
/// </note>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct BatchEvaluateGeofencesFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::batch_evaluate_geofences::builders::BatchEvaluateGeofencesInputBuilder,
}
impl BatchEvaluateGeofencesFluentBuilder {
    /// Creates a new `BatchEvaluateGeofences`.
    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_evaluate_geofences::BatchEvaluateGeofences,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
        >,
    > {
        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_evaluate_geofences::BatchEvaluateGeofencesOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
        >,
    > {
        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 used in evaluating the position of devices against its 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 used in evaluating the position of devices against its 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 `DevicePositionUpdates`.
    ///
    /// To override the contents of this collection use [`set_device_position_updates`](Self::set_device_position_updates).
    ///
    /// <p>Contains device details for each device to be evaluated against the given geofence collection.</p>
    pub fn device_position_updates(mut self, input: crate::types::DevicePositionUpdate) -> Self {
        self.inner = self.inner.device_position_updates(input);
        self
    }
    /// <p>Contains device details for each device to be evaluated against the given geofence collection.</p>
    pub fn set_device_position_updates(
        mut self,
        input: std::option::Option<std::vec::Vec<crate::types::DevicePositionUpdate>>,
    ) -> Self {
        self.inner = self.inner.set_device_position_updates(input);
        self
    }
}