Skip to main content

aws_sdk_athena/types/
_classification.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A classification refers to a set of specific configurations.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Classification {
7    /// <p>The name of the configuration classification.</p>
8    pub name: ::std::option::Option<::std::string::String>,
9    /// <p>A set of properties specified within a configuration classification.</p>
10    pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
11}
12impl Classification {
13    /// <p>The name of the configuration classification.</p>
14    pub fn name(&self) -> ::std::option::Option<&str> {
15        self.name.as_deref()
16    }
17    /// <p>A set of properties specified within a configuration classification.</p>
18    pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
19        self.properties.as_ref()
20    }
21}
22impl Classification {
23    /// Creates a new builder-style object to manufacture [`Classification`](crate::types::Classification).
24    pub fn builder() -> crate::types::builders::ClassificationBuilder {
25        crate::types::builders::ClassificationBuilder::default()
26    }
27}
28
29/// A builder for [`Classification`](crate::types::Classification).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct ClassificationBuilder {
33    pub(crate) name: ::std::option::Option<::std::string::String>,
34    pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
35}
36impl ClassificationBuilder {
37    /// <p>The name of the configuration classification.</p>
38    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.name = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The name of the configuration classification.</p>
43    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.name = input;
45        self
46    }
47    /// <p>The name of the configuration classification.</p>
48    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
49        &self.name
50    }
51    /// Adds a key-value pair to `properties`.
52    ///
53    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
54    ///
55    /// <p>A set of properties specified within a configuration classification.</p>
56    pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
57        let mut hash_map = self.properties.unwrap_or_default();
58        hash_map.insert(k.into(), v.into());
59        self.properties = ::std::option::Option::Some(hash_map);
60        self
61    }
62    /// <p>A set of properties specified within a configuration classification.</p>
63    pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
64        self.properties = input;
65        self
66    }
67    /// <p>A set of properties specified within a configuration classification.</p>
68    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
69        &self.properties
70    }
71    /// Consumes the builder and constructs a [`Classification`](crate::types::Classification).
72    pub fn build(self) -> crate::types::Classification {
73        crate::types::Classification {
74            name: self.name,
75            properties: self.properties,
76        }
77    }
78}