aws-sdk-opensearch 1.113.0

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

/// <p>The duration of a maintenance schedule. For more information, see <a href="https://docs.aws.amazon.com/opensearch-service/latest/developerguide/auto-tune.html">Auto-Tune for Amazon OpenSearch Service</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Duration {
    /// <p>Integer to specify the value of a maintenance schedule duration.</p>
    pub value: ::std::option::Option<i64>,
    /// <p>The unit of measurement for the duration of a maintenance schedule.</p>
    pub unit: ::std::option::Option<crate::types::TimeUnit>,
}
impl Duration {
    /// <p>Integer to specify the value of a maintenance schedule duration.</p>
    pub fn value(&self) -> ::std::option::Option<i64> {
        self.value
    }
    /// <p>The unit of measurement for the duration of a maintenance schedule.</p>
    pub fn unit(&self) -> ::std::option::Option<&crate::types::TimeUnit> {
        self.unit.as_ref()
    }
}
impl Duration {
    /// Creates a new builder-style object to manufacture [`Duration`](crate::types::Duration).
    pub fn builder() -> crate::types::builders::DurationBuilder {
        crate::types::builders::DurationBuilder::default()
    }
}

/// A builder for [`Duration`](crate::types::Duration).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DurationBuilder {
    pub(crate) value: ::std::option::Option<i64>,
    pub(crate) unit: ::std::option::Option<crate::types::TimeUnit>,
}
impl DurationBuilder {
    /// <p>Integer to specify the value of a maintenance schedule duration.</p>
    pub fn value(mut self, input: i64) -> Self {
        self.value = ::std::option::Option::Some(input);
        self
    }
    /// <p>Integer to specify the value of a maintenance schedule duration.</p>
    pub fn set_value(mut self, input: ::std::option::Option<i64>) -> Self {
        self.value = input;
        self
    }
    /// <p>Integer to specify the value of a maintenance schedule duration.</p>
    pub fn get_value(&self) -> &::std::option::Option<i64> {
        &self.value
    }
    /// <p>The unit of measurement for the duration of a maintenance schedule.</p>
    pub fn unit(mut self, input: crate::types::TimeUnit) -> Self {
        self.unit = ::std::option::Option::Some(input);
        self
    }
    /// <p>The unit of measurement for the duration of a maintenance schedule.</p>
    pub fn set_unit(mut self, input: ::std::option::Option<crate::types::TimeUnit>) -> Self {
        self.unit = input;
        self
    }
    /// <p>The unit of measurement for the duration of a maintenance schedule.</p>
    pub fn get_unit(&self) -> &::std::option::Option<crate::types::TimeUnit> {
        &self.unit
    }
    /// Consumes the builder and constructs a [`Duration`](crate::types::Duration).
    pub fn build(self) -> crate::types::Duration {
        crate::types::Duration {
            value: self.value,
            unit: self.unit,
        }
    }
}