Skip to main content

aws_sdk_memorydb/types/
_recurring_charge.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The recurring charge to run this reserved node.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct RecurringCharge {
7    /// <p>The amount of the recurring charge to run this reserved node.</p>
8    pub recurring_charge_amount: f64,
9    /// <p>The frequency of the recurring price charged to run this reserved node.</p>
10    pub recurring_charge_frequency: ::std::option::Option<::std::string::String>,
11}
12impl RecurringCharge {
13    /// <p>The amount of the recurring charge to run this reserved node.</p>
14    pub fn recurring_charge_amount(&self) -> f64 {
15        self.recurring_charge_amount
16    }
17    /// <p>The frequency of the recurring price charged to run this reserved node.</p>
18    pub fn recurring_charge_frequency(&self) -> ::std::option::Option<&str> {
19        self.recurring_charge_frequency.as_deref()
20    }
21}
22impl RecurringCharge {
23    /// Creates a new builder-style object to manufacture [`RecurringCharge`](crate::types::RecurringCharge).
24    pub fn builder() -> crate::types::builders::RecurringChargeBuilder {
25        crate::types::builders::RecurringChargeBuilder::default()
26    }
27}
28
29/// A builder for [`RecurringCharge`](crate::types::RecurringCharge).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct RecurringChargeBuilder {
33    pub(crate) recurring_charge_amount: ::std::option::Option<f64>,
34    pub(crate) recurring_charge_frequency: ::std::option::Option<::std::string::String>,
35}
36impl RecurringChargeBuilder {
37    /// <p>The amount of the recurring charge to run this reserved node.</p>
38    pub fn recurring_charge_amount(mut self, input: f64) -> Self {
39        self.recurring_charge_amount = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The amount of the recurring charge to run this reserved node.</p>
43    pub fn set_recurring_charge_amount(mut self, input: ::std::option::Option<f64>) -> Self {
44        self.recurring_charge_amount = input;
45        self
46    }
47    /// <p>The amount of the recurring charge to run this reserved node.</p>
48    pub fn get_recurring_charge_amount(&self) -> &::std::option::Option<f64> {
49        &self.recurring_charge_amount
50    }
51    /// <p>The frequency of the recurring price charged to run this reserved node.</p>
52    pub fn recurring_charge_frequency(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.recurring_charge_frequency = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The frequency of the recurring price charged to run this reserved node.</p>
57    pub fn set_recurring_charge_frequency(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.recurring_charge_frequency = input;
59        self
60    }
61    /// <p>The frequency of the recurring price charged to run this reserved node.</p>
62    pub fn get_recurring_charge_frequency(&self) -> &::std::option::Option<::std::string::String> {
63        &self.recurring_charge_frequency
64    }
65    /// Consumes the builder and constructs a [`RecurringCharge`](crate::types::RecurringCharge).
66    pub fn build(self) -> crate::types::RecurringCharge {
67        crate::types::RecurringCharge {
68            recurring_charge_amount: self.recurring_charge_amount.unwrap_or_default(),
69            recurring_charge_frequency: self.recurring_charge_frequency,
70        }
71    }
72}