#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct BatchPutGeofenceOutput {
pub successes: ::std::vec::Vec<crate::types::BatchPutGeofenceSuccess>,
pub errors: ::std::vec::Vec<crate::types::BatchPutGeofenceError>,
_request_id: Option<String>,
}
impl BatchPutGeofenceOutput {
pub fn successes(&self) -> &[crate::types::BatchPutGeofenceSuccess] {
use std::ops::Deref;
self.successes.deref()
}
pub fn errors(&self) -> &[crate::types::BatchPutGeofenceError] {
use std::ops::Deref;
self.errors.deref()
}
}
impl ::aws_http::request_id::RequestId for BatchPutGeofenceOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl BatchPutGeofenceOutput {
pub fn builder() -> crate::operation::batch_put_geofence::builders::BatchPutGeofenceOutputBuilder {
crate::operation::batch_put_geofence::builders::BatchPutGeofenceOutputBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct BatchPutGeofenceOutputBuilder {
pub(crate) successes: ::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceSuccess>>,
pub(crate) errors: ::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceError>>,
_request_id: Option<String>,
}
impl BatchPutGeofenceOutputBuilder {
pub fn successes(mut self, input: crate::types::BatchPutGeofenceSuccess) -> Self {
let mut v = self.successes.unwrap_or_default();
v.push(input);
self.successes = ::std::option::Option::Some(v);
self
}
pub fn set_successes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceSuccess>>) -> Self {
self.successes = input;
self
}
pub fn get_successes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceSuccess>> {
&self.successes
}
pub fn errors(mut self, input: crate::types::BatchPutGeofenceError) -> Self {
let mut v = self.errors.unwrap_or_default();
v.push(input);
self.errors = ::std::option::Option::Some(v);
self
}
pub fn set_errors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceError>>) -> Self {
self.errors = input;
self
}
pub fn get_errors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BatchPutGeofenceError>> {
&self.errors
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::batch_put_geofence::BatchPutGeofenceOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::batch_put_geofence::BatchPutGeofenceOutput {
successes: self.successes.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"successes",
"successes was not specified but it is required when building BatchPutGeofenceOutput",
)
})?,
errors: self.errors.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"errors",
"errors was not specified but it is required when building BatchPutGeofenceOutput",
)
})?,
_request_id: self._request_id,
})
}
}