aws_sdk_codeconnections/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 of the external provider where your third-party code repository is configured.</p>
7    pub provider_type: ::std::option::Option<crate::types::ProviderType>,
8    /// <p>The name of the connection to be created.</p>
9    pub connection_name: ::std::option::Option<::std::string::String>,
10    /// <p>The key-value pair to use when tagging the resource.</p>
11    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12    /// <p>The Amazon Resource Name (ARN) of the host associated with the connection to be created.</p>
13    pub host_arn: ::std::option::Option<::std::string::String>,
14}
15impl CreateConnectionInput {
16    /// <p>The name of the external provider where your third-party code repository is configured.</p>
17    pub fn provider_type(&self) -> ::std::option::Option<&crate::types::ProviderType> {
18        self.provider_type.as_ref()
19    }
20    /// <p>The name of the connection to be created.</p>
21    pub fn connection_name(&self) -> ::std::option::Option<&str> {
22        self.connection_name.as_deref()
23    }
24    /// <p>The key-value pair to use when tagging the resource.</p>
25    ///
26    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
27    pub fn tags(&self) -> &[crate::types::Tag] {
28        self.tags.as_deref().unwrap_or_default()
29    }
30    /// <p>The Amazon Resource Name (ARN) of the host associated with the connection to be created.</p>
31    pub fn host_arn(&self) -> ::std::option::Option<&str> {
32        self.host_arn.as_deref()
33    }
34}
35impl CreateConnectionInput {
36    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
37    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
38        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
43#[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    /// <p>The name of the external provider where your third-party code repository is configured.</p>
53    pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
54        self.provider_type = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>The name of the external provider where your third-party code repository is configured.</p>
58    pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
59        self.provider_type = input;
60        self
61    }
62    /// <p>The name of the external provider where your third-party code repository is configured.</p>
63    pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
64        &self.provider_type
65    }
66    /// <p>The name of the connection to be created.</p>
67    /// This field is required.
68    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    /// <p>The name of the connection to be created.</p>
73    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.connection_name = input;
75        self
76    }
77    /// <p>The name of the connection to be created.</p>
78    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
79        &self.connection_name
80    }
81    /// Appends an item to `tags`.
82    ///
83    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
84    ///
85    /// <p>The key-value pair to use when tagging the resource.</p>
86    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    /// <p>The key-value pair to use when tagging the resource.</p>
93    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    /// <p>The key-value pair to use when tagging the resource.</p>
98    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
99        &self.tags
100    }
101    /// <p>The Amazon Resource Name (ARN) of the host associated with the connection to be created.</p>
102    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    /// <p>The Amazon Resource Name (ARN) of the host associated with the connection to be created.</p>
107    pub fn set_host_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.host_arn = input;
109        self
110    }
111    /// <p>The Amazon Resource Name (ARN) of the host associated with the connection to be created.</p>
112    pub fn get_host_arn(&self) -> &::std::option::Option<::std::string::String> {
113        &self.host_arn
114    }
115    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
116    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}