aws-sdk-redshiftserverless 1.106.0

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

/// <p>Represents an Amazon Redshift Serverless reservation, which gives you the option to commit to a specified number of Redshift Processing Units (RPUs) for a year at a discount from Serverless on-demand (OD) rates.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Reservation {
    /// <p>The identifier that uniquely identifies the serverless reservation.</p>
    pub reservation_id: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
    pub reservation_arn: ::std::option::Option<::std::string::String>,
    /// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
    pub start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
    pub end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
    pub capacity: i32,
    /// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
    pub offering: ::std::option::Option<crate::types::ReservationOffering>,
    /// <p>The status of the reservation. Possible values include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>payment-pending</code></p></li>
    /// <li>
    /// <p><code>active</code></p></li>
    /// <li>
    /// <p><code>payment-failed</code></p></li>
    /// <li>
    /// <p><code>retired</code></p></li>
    /// </ul>
    pub status: ::std::option::Option<::std::string::String>,
}
impl Reservation {
    /// <p>The identifier that uniquely identifies the serverless reservation.</p>
    pub fn reservation_id(&self) -> ::std::option::Option<&str> {
        self.reservation_id.as_deref()
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
    pub fn reservation_arn(&self) -> ::std::option::Option<&str> {
        self.reservation_arn.as_deref()
    }
    /// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
    pub fn start_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_date.as_ref()
    }
    /// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
    pub fn end_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_date.as_ref()
    }
    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
    pub fn capacity(&self) -> i32 {
        self.capacity
    }
    /// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
    pub fn offering(&self) -> ::std::option::Option<&crate::types::ReservationOffering> {
        self.offering.as_ref()
    }
    /// <p>The status of the reservation. Possible values include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>payment-pending</code></p></li>
    /// <li>
    /// <p><code>active</code></p></li>
    /// <li>
    /// <p><code>payment-failed</code></p></li>
    /// <li>
    /// <p><code>retired</code></p></li>
    /// </ul>
    pub fn status(&self) -> ::std::option::Option<&str> {
        self.status.as_deref()
    }
}
impl Reservation {
    /// Creates a new builder-style object to manufacture [`Reservation`](crate::types::Reservation).
    pub fn builder() -> crate::types::builders::ReservationBuilder {
        crate::types::builders::ReservationBuilder::default()
    }
}

/// A builder for [`Reservation`](crate::types::Reservation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ReservationBuilder {
    pub(crate) reservation_id: ::std::option::Option<::std::string::String>,
    pub(crate) reservation_arn: ::std::option::Option<::std::string::String>,
    pub(crate) start_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) capacity: ::std::option::Option<i32>,
    pub(crate) offering: ::std::option::Option<crate::types::ReservationOffering>,
    pub(crate) status: ::std::option::Option<::std::string::String>,
}
impl ReservationBuilder {
    /// <p>The identifier that uniquely identifies the serverless reservation.</p>
    pub fn reservation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reservation_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier that uniquely identifies the serverless reservation.</p>
    pub fn set_reservation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reservation_id = input;
        self
    }
    /// <p>The identifier that uniquely identifies the serverless reservation.</p>
    pub fn get_reservation_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.reservation_id
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
    pub fn reservation_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reservation_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
    pub fn set_reservation_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reservation_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) that uniquely identifies the serverless reservation.</p>
    pub fn get_reservation_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.reservation_arn
    }
    /// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
    pub fn start_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
    pub fn set_start_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_date = input;
        self
    }
    /// <p>The start date for the serverless reservation. This is the date you created the reservation.</p>
    pub fn get_start_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_date
    }
    /// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
    pub fn end_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
    pub fn set_end_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_date = input;
        self
    }
    /// <p>The end date for the serverless reservation. This date is one year after the start date that you specify.</p>
    pub fn get_end_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_date
    }
    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
    pub fn capacity(mut self, input: i32) -> Self {
        self.capacity = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
    pub fn set_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
        self.capacity = input;
        self
    }
    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
    pub fn get_capacity(&self) -> &::std::option::Option<i32> {
        &self.capacity
    }
    /// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
    pub fn offering(mut self, input: crate::types::ReservationOffering) -> Self {
        self.offering = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
    pub fn set_offering(mut self, input: ::std::option::Option<crate::types::ReservationOffering>) -> Self {
        self.offering = input;
        self
    }
    /// <p>The type of offering for the reservation. The offering class determines the payment schedule for the reservation.</p>
    pub fn get_offering(&self) -> &::std::option::Option<crate::types::ReservationOffering> {
        &self.offering
    }
    /// <p>The status of the reservation. Possible values include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>payment-pending</code></p></li>
    /// <li>
    /// <p><code>active</code></p></li>
    /// <li>
    /// <p><code>payment-failed</code></p></li>
    /// <li>
    /// <p><code>retired</code></p></li>
    /// </ul>
    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.status = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The status of the reservation. Possible values include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>payment-pending</code></p></li>
    /// <li>
    /// <p><code>active</code></p></li>
    /// <li>
    /// <p><code>payment-failed</code></p></li>
    /// <li>
    /// <p><code>retired</code></p></li>
    /// </ul>
    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the reservation. Possible values include the following:</p>
    /// <ul>
    /// <li>
    /// <p><code>payment-pending</code></p></li>
    /// <li>
    /// <p><code>active</code></p></li>
    /// <li>
    /// <p><code>payment-failed</code></p></li>
    /// <li>
    /// <p><code>retired</code></p></li>
    /// </ul>
    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
        &self.status
    }
    /// Consumes the builder and constructs a [`Reservation`](crate::types::Reservation).
    pub fn build(self) -> crate::types::Reservation {
        crate::types::Reservation {
            reservation_id: self.reservation_id,
            reservation_arn: self.reservation_arn,
            start_date: self.start_date,
            end_date: self.end_date,
            capacity: self.capacity.unwrap_or_default(),
            offering: self.offering,
            status: self.status,
        }
    }
}