aws-sdk-customerprofiles 1.119.0

AWS SDK for Amazon Connect Customer Profiles
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Batch defines the boundaries for ingestion for each step in <code>APPFLOW_INTEGRATION</code> workflow. <code>APPFLOW_INTEGRATION</code> workflow splits ingestion based on these boundaries.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Batch {
    /// <p>Start time of batch to split ingestion.</p>
    pub start_time: ::aws_smithy_types::DateTime,
    /// <p>End time of batch to split ingestion.</p>
    pub end_time: ::aws_smithy_types::DateTime,
}
impl Batch {
    /// <p>Start time of batch to split ingestion.</p>
    pub fn start_time(&self) -> &::aws_smithy_types::DateTime {
        &self.start_time
    }
    /// <p>End time of batch to split ingestion.</p>
    pub fn end_time(&self) -> &::aws_smithy_types::DateTime {
        &self.end_time
    }
}
impl Batch {
    /// Creates a new builder-style object to manufacture [`Batch`](crate::types::Batch).
    pub fn builder() -> crate::types::builders::BatchBuilder {
        crate::types::builders::BatchBuilder::default()
    }
}

/// A builder for [`Batch`](crate::types::Batch).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BatchBuilder {
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
}
impl BatchBuilder {
    /// <p>Start time of batch to split ingestion.</p>
    /// This field is required.
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>Start time of batch to split ingestion.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>Start time of batch to split ingestion.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>End time of batch to split ingestion.</p>
    /// This field is required.
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>End time of batch to split ingestion.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>End time of batch to split ingestion.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    /// Consumes the builder and constructs a [`Batch`](crate::types::Batch).
    /// This method will fail if any of the following fields are not set:
    /// - [`start_time`](crate::types::builders::BatchBuilder::start_time)
    /// - [`end_time`](crate::types::builders::BatchBuilder::end_time)
    pub fn build(self) -> ::std::result::Result<crate::types::Batch, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Batch {
            start_time: self.start_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "start_time",
                    "start_time was not specified but it is required when building Batch",
                )
            })?,
            end_time: self.end_time.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "end_time",
                    "end_time was not specified but it is required when building Batch",
                )
            })?,
        })
    }
}