aws-sdk-mailmanager 1.87.0

AWS SDK for MailManager
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The request to initiate a search across emails in an archive.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartArchiveSearchInput {
    /// <p>The identifier of the archive to search emails in.</p>
    pub archive_id: ::std::option::Option<::std::string::String>,
    /// <p>Criteria to filter which emails are included in the search results.</p>
    pub filters: ::std::option::Option<crate::types::ArchiveFilters>,
    /// <p>The start timestamp of the range to search emails from.</p>
    pub from_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The end timestamp of the range to search emails from.</p>
    pub to_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The maximum number of search results to return.</p>
    pub max_results: ::std::option::Option<i32>,
}
impl StartArchiveSearchInput {
    /// <p>The identifier of the archive to search emails in.</p>
    pub fn archive_id(&self) -> ::std::option::Option<&str> {
        self.archive_id.as_deref()
    }
    /// <p>Criteria to filter which emails are included in the search results.</p>
    pub fn filters(&self) -> ::std::option::Option<&crate::types::ArchiveFilters> {
        self.filters.as_ref()
    }
    /// <p>The start timestamp of the range to search emails from.</p>
    pub fn from_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.from_timestamp.as_ref()
    }
    /// <p>The end timestamp of the range to search emails from.</p>
    pub fn to_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.to_timestamp.as_ref()
    }
    /// <p>The maximum number of search results to return.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
}
impl StartArchiveSearchInput {
    /// Creates a new builder-style object to manufacture [`StartArchiveSearchInput`](crate::operation::start_archive_search::StartArchiveSearchInput).
    pub fn builder() -> crate::operation::start_archive_search::builders::StartArchiveSearchInputBuilder {
        crate::operation::start_archive_search::builders::StartArchiveSearchInputBuilder::default()
    }
}

/// A builder for [`StartArchiveSearchInput`](crate::operation::start_archive_search::StartArchiveSearchInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartArchiveSearchInputBuilder {
    pub(crate) archive_id: ::std::option::Option<::std::string::String>,
    pub(crate) filters: ::std::option::Option<crate::types::ArchiveFilters>,
    pub(crate) from_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) to_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) max_results: ::std::option::Option<i32>,
}
impl StartArchiveSearchInputBuilder {
    /// <p>The identifier of the archive to search emails in.</p>
    /// This field is required.
    pub fn archive_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.archive_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the archive to search emails in.</p>
    pub fn set_archive_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.archive_id = input;
        self
    }
    /// <p>The identifier of the archive to search emails in.</p>
    pub fn get_archive_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.archive_id
    }
    /// <p>Criteria to filter which emails are included in the search results.</p>
    pub fn filters(mut self, input: crate::types::ArchiveFilters) -> Self {
        self.filters = ::std::option::Option::Some(input);
        self
    }
    /// <p>Criteria to filter which emails are included in the search results.</p>
    pub fn set_filters(mut self, input: ::std::option::Option<crate::types::ArchiveFilters>) -> Self {
        self.filters = input;
        self
    }
    /// <p>Criteria to filter which emails are included in the search results.</p>
    pub fn get_filters(&self) -> &::std::option::Option<crate::types::ArchiveFilters> {
        &self.filters
    }
    /// <p>The start timestamp of the range to search emails from.</p>
    /// This field is required.
    pub fn from_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.from_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start timestamp of the range to search emails from.</p>
    pub fn set_from_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.from_timestamp = input;
        self
    }
    /// <p>The start timestamp of the range to search emails from.</p>
    pub fn get_from_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.from_timestamp
    }
    /// <p>The end timestamp of the range to search emails from.</p>
    /// This field is required.
    pub fn to_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.to_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end timestamp of the range to search emails from.</p>
    pub fn set_to_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.to_timestamp = input;
        self
    }
    /// <p>The end timestamp of the range to search emails from.</p>
    pub fn get_to_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.to_timestamp
    }
    /// <p>The maximum number of search results to return.</p>
    /// This field is required.
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of search results to return.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>The maximum number of search results to return.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// Consumes the builder and constructs a [`StartArchiveSearchInput`](crate::operation::start_archive_search::StartArchiveSearchInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_archive_search::StartArchiveSearchInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_archive_search::StartArchiveSearchInput {
            archive_id: self.archive_id,
            filters: self.filters,
            from_timestamp: self.from_timestamp,
            to_timestamp: self.to_timestamp,
            max_results: self.max_results,
        })
    }
}