aws_sdk_glue/operation/create_connection/
_create_connection_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateConnectionInput {
6    /// <p>The ID of the Data Catalog in which to create the connection. If none is provided, the Amazon Web Services account ID is used by default.</p>
7    pub catalog_id: ::std::option::Option<::std::string::String>,
8    /// <p>A <code>ConnectionInput</code> object defining the connection to create.</p>
9    pub connection_input: ::std::option::Option<crate::types::ConnectionInput>,
10    /// <p>The tags you assign to the connection.</p>
11    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12}
13impl CreateConnectionInput {
14    /// <p>The ID of the Data Catalog in which to create the connection. If none is provided, the Amazon Web Services account ID is used by default.</p>
15    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
16        self.catalog_id.as_deref()
17    }
18    /// <p>A <code>ConnectionInput</code> object defining the connection to create.</p>
19    pub fn connection_input(&self) -> ::std::option::Option<&crate::types::ConnectionInput> {
20        self.connection_input.as_ref()
21    }
22    /// <p>The tags you assign to the connection.</p>
23    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
24        self.tags.as_ref()
25    }
26}
27impl CreateConnectionInput {
28    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
29    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
30        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
31    }
32}
33
34/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct CreateConnectionInputBuilder {
38    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
39    pub(crate) connection_input: ::std::option::Option<crate::types::ConnectionInput>,
40    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
41}
42impl CreateConnectionInputBuilder {
43    /// <p>The ID of the Data Catalog in which to create the connection. If none is provided, the Amazon Web Services account ID is used by default.</p>
44    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.catalog_id = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The ID of the Data Catalog in which to create the connection. If none is provided, the Amazon Web Services account ID is used by default.</p>
49    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.catalog_id = input;
51        self
52    }
53    /// <p>The ID of the Data Catalog in which to create the connection. If none is provided, the Amazon Web Services account ID is used by default.</p>
54    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
55        &self.catalog_id
56    }
57    /// <p>A <code>ConnectionInput</code> object defining the connection to create.</p>
58    /// This field is required.
59    pub fn connection_input(mut self, input: crate::types::ConnectionInput) -> Self {
60        self.connection_input = ::std::option::Option::Some(input);
61        self
62    }
63    /// <p>A <code>ConnectionInput</code> object defining the connection to create.</p>
64    pub fn set_connection_input(mut self, input: ::std::option::Option<crate::types::ConnectionInput>) -> Self {
65        self.connection_input = input;
66        self
67    }
68    /// <p>A <code>ConnectionInput</code> object defining the connection to create.</p>
69    pub fn get_connection_input(&self) -> &::std::option::Option<crate::types::ConnectionInput> {
70        &self.connection_input
71    }
72    /// Adds a key-value pair to `tags`.
73    ///
74    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
75    ///
76    /// <p>The tags you assign to the connection.</p>
77    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
78        let mut hash_map = self.tags.unwrap_or_default();
79        hash_map.insert(k.into(), v.into());
80        self.tags = ::std::option::Option::Some(hash_map);
81        self
82    }
83    /// <p>The tags you assign to the connection.</p>
84    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
85        self.tags = input;
86        self
87    }
88    /// <p>The tags you assign to the connection.</p>
89    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
90        &self.tags
91    }
92    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
93    pub fn build(
94        self,
95    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
97            catalog_id: self.catalog_id,
98            connection_input: self.connection_input,
99            tags: self.tags,
100        })
101    }
102}