Skip to main content

aws_sdk_redshiftserverless/operation/create_reservation/
_create_reservation_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateReservationInput {
6    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
7    pub capacity: ::std::option::Option<i32>,
8    /// <p>The ID of the offering associated with the reservation. The offering determines the payment schedule for the reservation.</p>
9    pub offering_id: ::std::option::Option<::std::string::String>,
10    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. This token must be a valid UUIDv4 value. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/"> Making retries safe with idempotent APIs </a>.</p>
11    pub client_token: ::std::option::Option<::std::string::String>,
12}
13impl CreateReservationInput {
14    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
15    pub fn capacity(&self) -> ::std::option::Option<i32> {
16        self.capacity
17    }
18    /// <p>The ID of the offering associated with the reservation. The offering determines the payment schedule for the reservation.</p>
19    pub fn offering_id(&self) -> ::std::option::Option<&str> {
20        self.offering_id.as_deref()
21    }
22    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. This token must be a valid UUIDv4 value. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/"> Making retries safe with idempotent APIs </a>.</p>
23    pub fn client_token(&self) -> ::std::option::Option<&str> {
24        self.client_token.as_deref()
25    }
26}
27impl CreateReservationInput {
28    /// Creates a new builder-style object to manufacture [`CreateReservationInput`](crate::operation::create_reservation::CreateReservationInput).
29    pub fn builder() -> crate::operation::create_reservation::builders::CreateReservationInputBuilder {
30        crate::operation::create_reservation::builders::CreateReservationInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateReservationInput`](crate::operation::create_reservation::CreateReservationInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateReservationInputBuilder {
38    pub(crate) capacity: ::std::option::Option<i32>,
39    pub(crate) offering_id: ::std::option::Option<::std::string::String>,
40    pub(crate) client_token: ::std::option::Option<::std::string::String>,
41}
42impl CreateReservationInputBuilder {
43    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
44    /// This field is required.
45    pub fn capacity(mut self, input: i32) -> Self {
46        self.capacity = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
50    pub fn set_capacity(mut self, input: ::std::option::Option<i32>) -> Self {
51        self.capacity = input;
52        self
53    }
54    /// <p>The number of Redshift Processing Units (RPUs) to reserve.</p>
55    pub fn get_capacity(&self) -> &::std::option::Option<i32> {
56        &self.capacity
57    }
58    /// <p>The ID of the offering associated with the reservation. The offering determines the payment schedule for the reservation.</p>
59    /// This field is required.
60    pub fn offering_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.offering_id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The ID of the offering associated with the reservation. The offering determines the payment schedule for the reservation.</p>
65    pub fn set_offering_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.offering_id = input;
67        self
68    }
69    /// <p>The ID of the offering associated with the reservation. The offering determines the payment schedule for the reservation.</p>
70    pub fn get_offering_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.offering_id
72    }
73    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. This token must be a valid UUIDv4 value. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/"> Making retries safe with idempotent APIs </a>.</p>
74    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.client_token = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. This token must be a valid UUIDv4 value. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/"> Making retries safe with idempotent APIs </a>.</p>
79    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.client_token = input;
81        self
82    }
83    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. This token must be a valid UUIDv4 value. For more information about idempotency, see <a href="https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/"> Making retries safe with idempotent APIs </a>.</p>
84    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
85        &self.client_token
86    }
87    /// Consumes the builder and constructs a [`CreateReservationInput`](crate::operation::create_reservation::CreateReservationInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::create_reservation::CreateReservationInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::create_reservation::CreateReservationInput {
92            capacity: self.capacity,
93            offering_id: self.offering_id,
94            client_token: self.client_token,
95        })
96    }
97}