aws_sdk_apprunner/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>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>
7    pub connection_name: ::std::option::Option<::std::string::String>,
8    /// <p>The source repository provider.</p>
9    pub provider_type: ::std::option::Option<crate::types::ProviderType>,
10    /// <p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>
11    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
12}
13impl CreateConnectionInput {
14    /// <p>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>
15    pub fn connection_name(&self) -> ::std::option::Option<&str> {
16        self.connection_name.as_deref()
17    }
18    /// <p>The source repository provider.</p>
19    pub fn provider_type(&self) -> ::std::option::Option<&crate::types::ProviderType> {
20        self.provider_type.as_ref()
21    }
22    /// <p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>
23    ///
24    /// 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()`.
25    pub fn tags(&self) -> &[crate::types::Tag] {
26        self.tags.as_deref().unwrap_or_default()
27    }
28}
29impl CreateConnectionInput {
30    /// Creates a new builder-style object to manufacture [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
31    pub fn builder() -> crate::operation::create_connection::builders::CreateConnectionInputBuilder {
32        crate::operation::create_connection::builders::CreateConnectionInputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateConnectionInputBuilder {
40    pub(crate) connection_name: ::std::option::Option<::std::string::String>,
41    pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
42    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
43}
44impl CreateConnectionInputBuilder {
45    /// <p>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>
46    /// This field is required.
47    pub fn connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.connection_name = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>
52    pub fn set_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.connection_name = input;
54        self
55    }
56    /// <p>A name for the new connection. It must be unique across all App Runner connections for the Amazon Web Services account in the Amazon Web Services Region.</p>
57    pub fn get_connection_name(&self) -> &::std::option::Option<::std::string::String> {
58        &self.connection_name
59    }
60    /// <p>The source repository provider.</p>
61    /// This field is required.
62    pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
63        self.provider_type = ::std::option::Option::Some(input);
64        self
65    }
66    /// <p>The source repository provider.</p>
67    pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
68        self.provider_type = input;
69        self
70    }
71    /// <p>The source repository provider.</p>
72    pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
73        &self.provider_type
74    }
75    /// Appends an item to `tags`.
76    ///
77    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
78    ///
79    /// <p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>
80    pub fn tags(mut self, input: crate::types::Tag) -> Self {
81        let mut v = self.tags.unwrap_or_default();
82        v.push(input);
83        self.tags = ::std::option::Option::Some(v);
84        self
85    }
86    /// <p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>
87    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
88        self.tags = input;
89        self
90    }
91    /// <p>A list of metadata items that you can associate with your connection resource. A tag is a key-value pair.</p>
92    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
93        &self.tags
94    }
95    /// Consumes the builder and constructs a [`CreateConnectionInput`](crate::operation::create_connection::CreateConnectionInput).
96    pub fn build(
97        self,
98    ) -> ::std::result::Result<crate::operation::create_connection::CreateConnectionInput, ::aws_smithy_types::error::operation::BuildError> {
99        ::std::result::Result::Ok(crate::operation::create_connection::CreateConnectionInput {
100            connection_name: self.connection_name,
101            provider_type: self.provider_type,
102            tags: self.tags,
103        })
104    }
105}