aws_sdk_iotanalytics/types/
_partition.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Partition {
7 pub attribute_name: ::std::string::String,
9}
10impl Partition {
11 pub fn attribute_name(&self) -> &str {
13 use std::ops::Deref;
14 self.attribute_name.deref()
15 }
16}
17impl Partition {
18 pub fn builder() -> crate::types::builders::PartitionBuilder {
20 crate::types::builders::PartitionBuilder::default()
21 }
22}
23
24#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
26#[non_exhaustive]
27pub struct PartitionBuilder {
28 pub(crate) attribute_name: ::std::option::Option<::std::string::String>,
29}
30impl PartitionBuilder {
31 pub fn attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
34 self.attribute_name = ::std::option::Option::Some(input.into());
35 self
36 }
37 pub fn set_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
39 self.attribute_name = input;
40 self
41 }
42 pub fn get_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
44 &self.attribute_name
45 }
46 pub fn build(self) -> ::std::result::Result<crate::types::Partition, ::aws_smithy_types::error::operation::BuildError> {
50 ::std::result::Result::Ok(crate::types::Partition {
51 attribute_name: self.attribute_name.ok_or_else(|| {
52 ::aws_smithy_types::error::operation::BuildError::missing_field(
53 "attribute_name",
54 "attribute_name was not specified but it is required when building Partition",
55 )
56 })?,
57 })
58 }
59}