aws-sdk-location 1.62.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>
    pub collection_name: ::std::option::Option<::std::string::String>,
    /// <p>The batch of geofences to be stored in a geofence collection.</p>
    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>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entries.is_none()`.
    pub fn entries(&self) -> &[crate::types::BatchPutGeofenceRequestEntry] {
        self.entries.as_deref().unwrap_or_default()
    }
}
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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>
    /// This field is required.
    pub fn collection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.collection_name = ::std::option::Option::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
    }
    /// <p>The geofence collection storing the geofences.</p>
    pub fn get_collection_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.collection_name
    }
    /// 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 = ::std::option::Option::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
    }
    /// <p>The batch of geofences to be stored in a geofence collection.</p>
    pub fn get_entries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceRequestEntry>> {
        &self.entries
    }
    /// Consumes the builder and constructs a [`BatchPutGeofenceInput`](crate::operation::batch_put_geofence::BatchPutGeofenceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::batch_put_geofence::BatchPutGeofenceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::batch_put_geofence::BatchPutGeofenceInput {
            collection_name: self.collection_name,
            entries: self.entries,
        })
    }
}