aws_sdk_glue/operation/update_connection/
_update_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 UpdateConnectionInput {
6    /// <p>The ID of the Data Catalog in which the connection resides. 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>The name of the connection definition to update.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>A <code>ConnectionInput</code> object that redefines the connection in question.</p>
11    pub connection_input: ::std::option::Option<crate::types::ConnectionInput>,
12}
13impl UpdateConnectionInput {
14    /// <p>The ID of the Data Catalog in which the connection resides. 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>The name of the connection definition to update.</p>
19    pub fn name(&self) -> ::std::option::Option<&str> {
20        self.name.as_deref()
21    }
22    /// <p>A <code>ConnectionInput</code> object that redefines the connection in question.</p>
23    pub fn connection_input(&self) -> ::std::option::Option<&crate::types::ConnectionInput> {
24        self.connection_input.as_ref()
25    }
26}
27impl UpdateConnectionInput {
28    /// Creates a new builder-style object to manufacture [`UpdateConnectionInput`](crate::operation::update_connection::UpdateConnectionInput).
29    pub fn builder() -> crate::operation::update_connection::builders::UpdateConnectionInputBuilder {
30        crate::operation::update_connection::builders::UpdateConnectionInputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdateConnectionInput`](crate::operation::update_connection::UpdateConnectionInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdateConnectionInputBuilder {
38    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
39    pub(crate) name: ::std::option::Option<::std::string::String>,
40    pub(crate) connection_input: ::std::option::Option<crate::types::ConnectionInput>,
41}
42impl UpdateConnectionInputBuilder {
43    /// <p>The ID of the Data Catalog in which the connection resides. 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 the connection resides. 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 the connection resides. 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>The name of the connection definition to update.</p>
58    /// This field is required.
59    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the connection definition to update.</p>
64    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.name = input;
66        self
67    }
68    /// <p>The name of the connection definition to update.</p>
69    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.name
71    }
72    /// <p>A <code>ConnectionInput</code> object that redefines the connection in question.</p>
73    /// This field is required.
74    pub fn connection_input(mut self, input: crate::types::ConnectionInput) -> Self {
75        self.connection_input = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>A <code>ConnectionInput</code> object that redefines the connection in question.</p>
79    pub fn set_connection_input(mut self, input: ::std::option::Option<crate::types::ConnectionInput>) -> Self {
80        self.connection_input = input;
81        self
82    }
83    /// <p>A <code>ConnectionInput</code> object that redefines the connection in question.</p>
84    pub fn get_connection_input(&self) -> &::std::option::Option<crate::types::ConnectionInput> {
85        &self.connection_input
86    }
87    /// Consumes the builder and constructs a [`UpdateConnectionInput`](crate::operation::update_connection::UpdateConnectionInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::update_connection::UpdateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::update_connection::UpdateConnectionInput {
92            catalog_id: self.catalog_id,
93            name: self.name,
94            connection_input: self.connection_input,
95        })
96    }
97}