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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchPutGeofenceInput {
    /// <p>The geofence collection storing the geofences.</p>
    #[doc(hidden)]
    pub collection_name: std::option::Option<std::string::String>,
    /// <p>The batch of geofences to be stored in a geofence collection.</p>
    #[doc(hidden)]
    pub entries: std::option::Option<std::vec::Vec<crate::types::BatchPutGeofenceRequestEntry>>,
}
impl BatchPutGeofenceInput {
    /// <p>The geofence collection storing the geofences.</p>
    pub fn collection_name(&self) -> std::option::Option<&str> {
        self.collection_name.as_deref()
    }
    /// <p>The batch of geofences to be stored in a geofence collection.</p>
    pub fn entries(&self) -> std::option::Option<&[crate::types::BatchPutGeofenceRequestEntry]> {
        self.entries.as_deref()
    }
}
impl BatchPutGeofenceInput {
    /// Creates a new builder-style object to manufacture [`BatchPutGeofenceInput`](crate::operation::batch_put_geofence::BatchPutGeofenceInput).
    pub fn builder() -> crate::operation::batch_put_geofence::builders::BatchPutGeofenceInputBuilder
    {
        crate::operation::batch_put_geofence::builders::BatchPutGeofenceInputBuilder::default()
    }
}

/// A builder for [`BatchPutGeofenceInput`](crate::operation::batch_put_geofence::BatchPutGeofenceInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct BatchPutGeofenceInputBuilder {
    pub(crate) collection_name: std::option::Option<std::string::String>,
    pub(crate) entries:
        std::option::Option<std::vec::Vec<crate::types::BatchPutGeofenceRequestEntry>>,
}
impl BatchPutGeofenceInputBuilder {
    /// <p>The geofence collection storing the geofences.</p>
    pub fn collection_name(mut self, input: impl Into<std::string::String>) -> Self {
        self.collection_name = Some(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.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 {
        let mut v = self.entries.unwrap_or_default();
        v.push(input);
        self.entries = Some(v);
        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.entries = input;
        self
    }
    /// Consumes the builder and constructs a [`BatchPutGeofenceInput`](crate::operation::batch_put_geofence::BatchPutGeofenceInput).
    pub fn build(
        self,
    ) -> Result<
        crate::operation::batch_put_geofence::BatchPutGeofenceInput,
        aws_smithy_http::operation::error::BuildError,
    > {
        Ok(
            crate::operation::batch_put_geofence::BatchPutGeofenceInput {
                collection_name: self.collection_name,
                entries: self.entries,
            },
        )
    }
}