aws_sdk_codeconnections/operation/create_connection/
_create_connection_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateConnectionInput {
6 pub provider_type: ::std::option::Option<crate::types::ProviderType>,
8 pub connection_name: ::std::option::Option<::std::string::String>,
10 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12 pub host_arn: ::std::option::Option<::std::string::String>,
14}
15impl CreateConnectionInput {
16 pub fn provider_type(&self) -> ::std::option::Option<&crate::types::ProviderType> {
18 self.provider_type.as_ref()
19 }
20 pub fn connection_name(&self) -> ::std::option::Option<&str> {
22 self.connection_name.as_deref()
23 }
24 pub fn tags(&self) -> &[crate::types::Tag] {
28 self.tags.as_deref().unwrap_or_default()
29 }
30 pub fn host_arn(&self) -> ::std::option::Option<&str> {
32 self.host_arn.as_deref()
33 }
34}
35impl CreateConnectionInput {
36 pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
38 crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
39 }
40}
41
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateConnectionInputBuilder {
46 pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
47 pub(crate) connection_name: ::std::option::Option<::std::string::String>,
48 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
49 pub(crate) host_arn: ::std::option::Option<::std::string::String>,
50}
51impl CreateConnectionInputBuilder {
52 pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
54 self.provider_type = ::std::option::Option::Some(input);
55 self
56 }
57 pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
59 self.provider_type = input;
60 self
61 }
62 pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
64 &self.provider_type
65 }
66 pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69 self.connection_name = ::std::option::Option::Some(input.into());
70 self
71 }
72 pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74 self.connection_name = input;
75 self
76 }
77 pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
79 &self.connection_name
80 }
81 pub fn tags(mut self, input: crate::types::Tag) -> Self {
87 let mut v = self.tags.unwrap_or_default();
88 v.push(input);
89 self.tags = ::std::option::Option::Some(v);
90 self
91 }
92 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
94 self.tags = input;
95 self
96 }
97 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
99 &self.tags
100 }
101 pub fn host_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.host_arn = ::std::option::Option::Some(input.into());
104 self
105 }
106 pub fn set_host_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.host_arn = input;
109 self
110 }
111 pub fn get_host_arn(&self) -> &::std::option::Option<::std::string::String> {
113 &self.host_arn
114 }
115 pub fn build(
117 self,
118 ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
119 ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
120 provider_type: self.provider_type,
121 connection_name: self.connection_name,
122 tags: self.tags,
123 host_arn: self.host_arn,
124 })
125 }
126}