aws-sdk-rds 1.129.0

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

/// <p>A range of integer values.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Range {
    /// <p>The minimum value in the range.</p>
    pub from: ::std::option::Option<i32>,
    /// <p>The maximum value in the range.</p>
    pub to: ::std::option::Option<i32>,
    /// <p>The step value for the range. For example, if you have a range of 5,000 to 10,000, with a step value of 1,000, the valid values start at 5,000 and step up by 1,000. Even though 7,500 is within the range, it isn't a valid value for the range. The valid values are 5,000, 6,000, 7,000, 8,000...</p>
    pub step: ::std::option::Option<i32>,
}
impl Range {
    /// <p>The minimum value in the range.</p>
    pub fn from(&self) -> ::std::option::Option<i32> {
        self.from
    }
    /// <p>The maximum value in the range.</p>
    pub fn to(&self) -> ::std::option::Option<i32> {
        self.to
    }
    /// <p>The step value for the range. For example, if you have a range of 5,000 to 10,000, with a step value of 1,000, the valid values start at 5,000 and step up by 1,000. Even though 7,500 is within the range, it isn't a valid value for the range. The valid values are 5,000, 6,000, 7,000, 8,000...</p>
    pub fn step(&self) -> ::std::option::Option<i32> {
        self.step
    }
}
impl Range {
    /// Creates a new builder-style object to manufacture [`Range`](crate::types::Range).
    pub fn builder() -> crate::types::builders::RangeBuilder {
        crate::types::builders::RangeBuilder::default()
    }
}

/// A builder for [`Range`](crate::types::Range).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RangeBuilder {
    pub(crate) from: ::std::option::Option<i32>,
    pub(crate) to: ::std::option::Option<i32>,
    pub(crate) step: ::std::option::Option<i32>,
}
impl RangeBuilder {
    /// <p>The minimum value in the range.</p>
    pub fn from(mut self, input: i32) -> Self {
        self.from = ::std::option::Option::Some(input);
        self
    }
    /// <p>The minimum value in the range.</p>
    pub fn set_from(mut self, input: ::std::option::Option<i32>) -> Self {
        self.from = input;
        self
    }
    /// <p>The minimum value in the range.</p>
    pub fn get_from(&self) -> &::std::option::Option<i32> {
        &self.from
    }
    /// <p>The maximum value in the range.</p>
    pub fn to(mut self, input: i32) -> Self {
        self.to = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum value in the range.</p>
    pub fn set_to(mut self, input: ::std::option::Option<i32>) -> Self {
        self.to = input;
        self
    }
    /// <p>The maximum value in the range.</p>
    pub fn get_to(&self) -> &::std::option::Option<i32> {
        &self.to
    }
    /// <p>The step value for the range. For example, if you have a range of 5,000 to 10,000, with a step value of 1,000, the valid values start at 5,000 and step up by 1,000. Even though 7,500 is within the range, it isn't a valid value for the range. The valid values are 5,000, 6,000, 7,000, 8,000...</p>
    pub fn step(mut self, input: i32) -> Self {
        self.step = ::std::option::Option::Some(input);
        self
    }
    /// <p>The step value for the range. For example, if you have a range of 5,000 to 10,000, with a step value of 1,000, the valid values start at 5,000 and step up by 1,000. Even though 7,500 is within the range, it isn't a valid value for the range. The valid values are 5,000, 6,000, 7,000, 8,000...</p>
    pub fn set_step(mut self, input: ::std::option::Option<i32>) -> Self {
        self.step = input;
        self
    }
    /// <p>The step value for the range. For example, if you have a range of 5,000 to 10,000, with a step value of 1,000, the valid values start at 5,000 and step up by 1,000. Even though 7,500 is within the range, it isn't a valid value for the range. The valid values are 5,000, 6,000, 7,000, 8,000...</p>
    pub fn get_step(&self) -> &::std::option::Option<i32> {
        &self.step
    }
    /// Consumes the builder and constructs a [`Range`](crate::types::Range).
    pub fn build(self) -> crate::types::Range {
        crate::types::Range {
            from: self.from,
            to: self.to,
            step: self.step,
        }
    }
}