Skip to main content

aws_sdk_cloudwatchevents/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 name for the connection to create.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description for the connection to create.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The type of authorization to use for the connection.</p>
11    pub authorization_type: ::std::option::Option<crate::types::ConnectionAuthorizationType>,
12    /// <p>A <code>CreateConnectionAuthRequestParameters</code> object that contains the authorization parameters to use to authorize with the endpoint.</p>
13    pub auth_parameters: ::std::option::Option<crate::types::CreateConnectionAuthRequestParameters>,
14}
15impl CreateConnectionInput {
16    /// <p>The name for the connection to create.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>A description for the connection to create.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>The type of authorization to use for the connection.</p>
25    pub fn authorization_type(&self) -> ::std::option::Option<&crate::types::ConnectionAuthorizationType> {
26        self.authorization_type.as_ref()
27    }
28    /// <p>A <code>CreateConnectionAuthRequestParameters</code> object that contains the authorization parameters to use to authorize with the endpoint.</p>
29    pub fn auth_parameters(&self) -> ::std::option::Option<&crate::types::CreateConnectionAuthRequestParameters> {
30        self.auth_parameters.as_ref()
31    }
32}
33impl CreateConnectionInput {
34    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
35    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
36        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateConnectionInputBuilder {
44    pub(crate) name: ::std::option::Option<::std::string::String>,
45    pub(crate) description: ::std::option::Option<::std::string::String>,
46    pub(crate) authorization_type: ::std::option::Option<crate::types::ConnectionAuthorizationType>,
47    pub(crate) auth_parameters: ::std::option::Option<crate::types::CreateConnectionAuthRequestParameters>,
48}
49impl CreateConnectionInputBuilder {
50    /// <p>The name for the connection to create.</p>
51    /// This field is required.
52    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name for the connection to create.</p>
57    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.name = input;
59        self
60    }
61    /// <p>The name for the connection to create.</p>
62    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.name
64    }
65    /// <p>A description for the connection to create.</p>
66    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.description = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>A description for the connection to create.</p>
71    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.description = input;
73        self
74    }
75    /// <p>A description for the connection to create.</p>
76    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
77        &self.description
78    }
79    /// <p>The type of authorization to use for the connection.</p>
80    /// This field is required.
81    pub fn authorization_type(mut self, input: crate::types::ConnectionAuthorizationType) -> Self {
82        self.authorization_type = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The type of authorization to use for the connection.</p>
86    pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::ConnectionAuthorizationType>) -> Self {
87        self.authorization_type = input;
88        self
89    }
90    /// <p>The type of authorization to use for the connection.</p>
91    pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::ConnectionAuthorizationType> {
92        &self.authorization_type
93    }
94    /// <p>A <code>CreateConnectionAuthRequestParameters</code> object that contains the authorization parameters to use to authorize with the endpoint.</p>
95    /// This field is required.
96    pub fn auth_parameters(mut self, input: crate::types::CreateConnectionAuthRequestParameters) -> Self {
97        self.auth_parameters = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>A <code>CreateConnectionAuthRequestParameters</code> object that contains the authorization parameters to use to authorize with the endpoint.</p>
101    pub fn set_auth_parameters(mut self, input: ::std::option::Option<crate::types::CreateConnectionAuthRequestParameters>) -> Self {
102        self.auth_parameters = input;
103        self
104    }
105    /// <p>A <code>CreateConnectionAuthRequestParameters</code> object that contains the authorization parameters to use to authorize with the endpoint.</p>
106    pub fn get_auth_parameters(&self) -> &::std::option::Option<crate::types::CreateConnectionAuthRequestParameters> {
107        &self.auth_parameters
108    }
109    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
114            name: self.name,
115            description: self.description,
116            authorization_type: self.authorization_type,
117            auth_parameters: self.auth_parameters,
118        })
119    }
120}