aws_sdk_glue/operation/test_connection/
_test_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 TestConnectionInput {
6    /// <p>Optional. The name of the connection to test. If only name is provided, the operation will get the connection and use that for testing.</p>
7    pub connection_name: ::std::option::Option<::std::string::String>,
8    /// <p>The catalog ID where the connection resides.</p>
9    pub catalog_id: ::std::option::Option<::std::string::String>,
10    /// <p>A structure that is used to specify testing a connection to a service.</p>
11    pub test_connection_input: ::std::option::Option<crate::types::TestConnectionInput>,
12}
13impl TestConnectionInput {
14    /// <p>Optional. The name of the connection to test. If only name is provided, the operation will get the connection and use that for testing.</p>
15    pub fn connection_name(&self) -> ::std::option::Option<&str> {
16        self.connection_name.as_deref()
17    }
18    /// <p>The catalog ID where the connection resides.</p>
19    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
20        self.catalog_id.as_deref()
21    }
22    /// <p>A structure that is used to specify testing a connection to a service.</p>
23    pub fn test_connection_input(&self) -> ::std::option::Option<&crate::types::TestConnectionInput> {
24        self.test_connection_input.as_ref()
25    }
26}
27impl TestConnectionInput {
28    /// Creates a new builder-style object to manufacture [`TestConnectionInput`](crate::operation::test_connection::TestConnectionInput).
29    pub fn builder() -> crate::operation::test_connection::builders::TestConnectionInputBuilder {
30        crate::operation::test_connection::builders::TestConnectionInputBuilder::default()
31    }
32}
33
34/// A builder for [`TestConnectionInput`](crate::operation::test_connection::TestConnectionInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct TestConnectionInputBuilder {
38    pub(crate) connection_name: ::std::option::Option<::std::string::String>,
39    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
40    pub(crate) test_connection_input: ::std::option::Option<crate::types::TestConnectionInput>,
41}
42impl TestConnectionInputBuilder {
43    /// <p>Optional. The name of the connection to test. If only name is provided, the operation will get the connection and use that for testing.</p>
44    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.connection_name = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>Optional. The name of the connection to test. If only name is provided, the operation will get the connection and use that for testing.</p>
49    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.connection_name = input;
51        self
52    }
53    /// <p>Optional. The name of the connection to test. If only name is provided, the operation will get the connection and use that for testing.</p>
54    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
55        &self.connection_name
56    }
57    /// <p>The catalog ID where the connection resides.</p>
58    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.catalog_id = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The catalog ID where the connection resides.</p>
63    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64        self.catalog_id = input;
65        self
66    }
67    /// <p>The catalog ID where the connection resides.</p>
68    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
69        &self.catalog_id
70    }
71    /// <p>A structure that is used to specify testing a connection to a service.</p>
72    pub fn test_connection_input(mut self, input: crate::types::TestConnectionInput) -> Self {
73        self.test_connection_input = ::std::option::Option::Some(input);
74        self
75    }
76    /// <p>A structure that is used to specify testing a connection to a service.</p>
77    pub fn set_test_connection_input(mut self, input: ::std::option::Option<crate::types::TestConnectionInput>) -> Self {
78        self.test_connection_input = input;
79        self
80    }
81    /// <p>A structure that is used to specify testing a connection to a service.</p>
82    pub fn get_test_connection_input(&self) -> &::std::option::Option<crate::types::TestConnectionInput> {
83        &self.test_connection_input
84    }
85    /// Consumes the builder and constructs a [`TestConnectionInput`](crate::operation::test_connection::TestConnectionInput).
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::test_connection::TestConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::test_connection::TestConnectionInput {
90            connection_name: self.connection_name,
91            catalog_id: self.catalog_id,
92            test_connection_input: self.test_connection_input,
93        })
94    }
95}