aws_sdk_dynamodb/types/
_capacity.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the amount of provisioned throughput capacity consumed on a table or an index.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Capacity {
7    /// <p>The total number of read capacity units consumed on a table or an index.</p>
8    pub read_capacity_units: ::std::option::Option<f64>,
9    /// <p>The total number of write capacity units consumed on a table or an index.</p>
10    pub write_capacity_units: ::std::option::Option<f64>,
11    /// <p>The total number of capacity units consumed on a table or an index.</p>
12    pub capacity_units: ::std::option::Option<f64>,
13}
14impl Capacity {
15    /// <p>The total number of read capacity units consumed on a table or an index.</p>
16    pub fn read_capacity_units(&self) -> ::std::option::Option<f64> {
17        self.read_capacity_units
18    }
19    /// <p>The total number of write capacity units consumed on a table or an index.</p>
20    pub fn write_capacity_units(&self) -> ::std::option::Option<f64> {
21        self.write_capacity_units
22    }
23    /// <p>The total number of capacity units consumed on a table or an index.</p>
24    pub fn capacity_units(&self) -> ::std::option::Option<f64> {
25        self.capacity_units
26    }
27}
28impl Capacity {
29    /// Creates a new builder-style object to manufacture [`Capacity`](crate::types::Capacity).
30    pub fn builder() -> crate::types::builders::CapacityBuilder {
31        crate::types::builders::CapacityBuilder::default()
32    }
33}
34
35/// A builder for [`Capacity`](crate::types::Capacity).
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
37#[non_exhaustive]
38pub struct CapacityBuilder {
39    pub(crate) read_capacity_units: ::std::option::Option<f64>,
40    pub(crate) write_capacity_units: ::std::option::Option<f64>,
41    pub(crate) capacity_units: ::std::option::Option<f64>,
42}
43impl CapacityBuilder {
44    /// <p>The total number of read capacity units consumed on a table or an index.</p>
45    pub fn read_capacity_units(mut self, input: f64) -> Self {
46        self.read_capacity_units = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The total number of read capacity units consumed on a table or an index.</p>
50    pub fn set_read_capacity_units(mut self, input: ::std::option::Option<f64>) -> Self {
51        self.read_capacity_units = input;
52        self
53    }
54    /// <p>The total number of read capacity units consumed on a table or an index.</p>
55    pub fn get_read_capacity_units(&self) -> &::std::option::Option<f64> {
56        &self.read_capacity_units
57    }
58    /// <p>The total number of write capacity units consumed on a table or an index.</p>
59    pub fn write_capacity_units(mut self, input: f64) -> Self {
60        self.write_capacity_units = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>The total number of write capacity units consumed on a table or an index.</p>
64    pub fn set_write_capacity_units(mut self, input: ::std::option::Option<f64>) -> Self {
65        self.write_capacity_units = input;
66        self
67    }
68    /// <p>The total number of write capacity units consumed on a table or an index.</p>
69    pub fn get_write_capacity_units(&self) -> &::std::option::Option<f64> {
70        &self.write_capacity_units
71    }
72    /// <p>The total number of capacity units consumed on a table or an index.</p>
73    pub fn capacity_units(mut self, input: f64) -> Self {
74        self.capacity_units = ::std::option::Option::Some(input);
75        self
76    }
77    /// <p>The total number of capacity units consumed on a table or an index.</p>
78    pub fn set_capacity_units(mut self, input: ::std::option::Option<f64>) -> Self {
79        self.capacity_units = input;
80        self
81    }
82    /// <p>The total number of capacity units consumed on a table or an index.</p>
83    pub fn get_capacity_units(&self) -> &::std::option::Option<f64> {
84        &self.capacity_units
85    }
86    /// Consumes the builder and constructs a [`Capacity`](crate::types::Capacity).
87    pub fn build(self) -> crate::types::Capacity {
88        crate::types::Capacity {
89            read_capacity_units: self.read_capacity_units,
90            write_capacity_units: self.write_capacity_units,
91            capacity_units: self.capacity_units,
92        }
93    }
94}