aws-sdk-location 1.65.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;

impl crate::operation::batch_evaluate_geofences::builders::BatchEvaluateGeofencesInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.batch_evaluate_geofences();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// 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,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesOutput,
        crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
    > for BatchEvaluateGeofencesFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesOutput,
            crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl BatchEvaluateGeofencesFluentBuilder {
    /// Creates a new `BatchEvaluateGeofencesFluentBuilder`.
    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 BatchEvaluateGeofences as a reference.
    pub fn as_input(&self) -> &crate::operation::batch_evaluate_geofences::builders::BatchEvaluateGeofencesInputBuilder {
        &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::batch_evaluate_geofences::BatchEvaluateGeofencesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
            ::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::batch_evaluate_geofences::BatchEvaluateGeofences::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::batch_evaluate_geofences::BatchEvaluateGeofences::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::batch_evaluate_geofences::BatchEvaluateGeofencesOutput,
        crate::operation::batch_evaluate_geofences::BatchEvaluateGeofencesError,
        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 geofence collection used in evaluating the position of devices against its geofences.</p>
    pub fn collection_name(mut self, input: impl ::std::convert::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
    }
    /// <p>The geofence collection used in evaluating the position of devices against its geofences.</p>
    pub fn get_collection_name(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_collection_name()
    }
    ///
    /// 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
    }
    /// <p>Contains device details for each device to be evaluated against the given geofence collection.</p>
    pub fn get_device_position_updates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DevicePositionUpdate>> {
        self.inner.get_device_position_updates()
    }
}