aws-sdk-datazone 1.136.0

AWS SDK for Amazon DataZone
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The configuration of a connection.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Configuration {
    /// <p>The classification of the connection configuration.</p>
    pub classification: ::std::option::Option<::std::string::String>,
    /// <p>The properties of the connection configuration.</p>
    pub properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Configuration {
    /// <p>The classification of the connection configuration.</p>
    pub fn classification(&self) -> ::std::option::Option<&str> {
        self.classification.as_deref()
    }
    /// <p>The properties of the connection configuration.</p>
    pub fn properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.properties.as_ref()
    }
}
impl Configuration {
    /// Creates a new builder-style object to manufacture [`Configuration`](crate::types::Configuration).
    pub fn builder() -> crate::types::builders::ConfigurationBuilder {
        crate::types::builders::ConfigurationBuilder::default()
    }
}

/// A builder for [`Configuration`](crate::types::Configuration).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ConfigurationBuilder {
    pub(crate) classification: ::std::option::Option<::std::string::String>,
    pub(crate) properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl ConfigurationBuilder {
    /// <p>The classification of the connection configuration.</p>
    pub fn classification(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.classification = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The classification of the connection configuration.</p>
    pub fn set_classification(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.classification = input;
        self
    }
    /// <p>The classification of the connection configuration.</p>
    pub fn get_classification(&self) -> &::std::option::Option<::std::string::String> {
        &self.classification
    }
    /// Adds a key-value pair to `properties`.
    ///
    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
    ///
    /// <p>The properties of the connection configuration.</p>
    pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.properties.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.properties = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The properties of the connection configuration.</p>
    pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.properties = input;
        self
    }
    /// <p>The properties of the connection configuration.</p>
    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.properties
    }
    /// Consumes the builder and constructs a [`Configuration`](crate::types::Configuration).
    pub fn build(self) -> crate::types::Configuration {
        crate::types::Configuration {
            classification: self.classification,
            properties: self.properties,
        }
    }
}