Skip to main content

aws_sdk_securityagent/operation/create_integration/
_create_integration_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 CreateIntegrationInput {
6    /// <p>The integration provider. Currently, only GITHUB is supported.</p>
7    pub provider: ::std::option::Option<crate::types::Provider>,
8    /// <p>The provider-specific input required to create the integration.</p>
9    pub input: ::std::option::Option<crate::types::ProviderInput>,
10    /// <p>The display name for the integration.</p>
11    pub integration_display_name: ::std::option::Option<::std::string::String>,
12    /// <p>The identifier of the AWS KMS key to use for encrypting data associated with the integration.</p>
13    pub kms_key_id: ::std::option::Option<::std::string::String>,
14    /// <p>The tags to associate with the integration.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.</p>
17    pub private_connection_name: ::std::option::Option<::std::string::String>,
18}
19impl CreateIntegrationInput {
20    /// <p>The integration provider. Currently, only GITHUB is supported.</p>
21    pub fn provider(&self) -> ::std::option::Option<&crate::types::Provider> {
22        self.provider.as_ref()
23    }
24    /// <p>The provider-specific input required to create the integration.</p>
25    pub fn input(&self) -> ::std::option::Option<&crate::types::ProviderInput> {
26        self.input.as_ref()
27    }
28    /// <p>The display name for the integration.</p>
29    pub fn integration_display_name(&self) -> ::std::option::Option<&str> {
30        self.integration_display_name.as_deref()
31    }
32    /// <p>The identifier of the AWS KMS key to use for encrypting data associated with the integration.</p>
33    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
34        self.kms_key_id.as_deref()
35    }
36    /// <p>The tags to associate with the integration.</p>
37    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38        self.tags.as_ref()
39    }
40    /// <p>The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.</p>
41    pub fn private_connection_name(&self) -> ::std::option::Option<&str> {
42        self.private_connection_name.as_deref()
43    }
44}
45impl CreateIntegrationInput {
46    /// Creates a new builder-style object to manufacture [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
47    pub fn builder() -> crate::operation::create_integration::builders::CreateIntegrationInputBuilder {
48        crate::operation::create_integration::builders::CreateIntegrationInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateIntegrationInputBuilder {
56    pub(crate) provider: ::std::option::Option<crate::types::Provider>,
57    pub(crate) input: ::std::option::Option<crate::types::ProviderInput>,
58    pub(crate) integration_display_name: ::std::option::Option<::std::string::String>,
59    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
60    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
61    pub(crate) private_connection_name: ::std::option::Option<::std::string::String>,
62}
63impl CreateIntegrationInputBuilder {
64    /// <p>The integration provider. Currently, only GITHUB is supported.</p>
65    /// This field is required.
66    pub fn provider(mut self, input: crate::types::Provider) -> Self {
67        self.provider = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The integration provider. Currently, only GITHUB is supported.</p>
71    pub fn set_provider(mut self, input: ::std::option::Option<crate::types::Provider>) -> Self {
72        self.provider = input;
73        self
74    }
75    /// <p>The integration provider. Currently, only GITHUB is supported.</p>
76    pub fn get_provider(&self) -> &::std::option::Option<crate::types::Provider> {
77        &self.provider
78    }
79    /// <p>The provider-specific input required to create the integration.</p>
80    /// This field is required.
81    pub fn input(mut self, input: crate::types::ProviderInput) -> Self {
82        self.input = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>The provider-specific input required to create the integration.</p>
86    pub fn set_input(mut self, input: ::std::option::Option<crate::types::ProviderInput>) -> Self {
87        self.input = input;
88        self
89    }
90    /// <p>The provider-specific input required to create the integration.</p>
91    pub fn get_input(&self) -> &::std::option::Option<crate::types::ProviderInput> {
92        &self.input
93    }
94    /// <p>The display name for the integration.</p>
95    /// This field is required.
96    pub fn integration_display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.integration_display_name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The display name for the integration.</p>
101    pub fn set_integration_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.integration_display_name = input;
103        self
104    }
105    /// <p>The display name for the integration.</p>
106    pub fn get_integration_display_name(&self) -> &::std::option::Option<::std::string::String> {
107        &self.integration_display_name
108    }
109    /// <p>The identifier of the AWS KMS key to use for encrypting data associated with the integration.</p>
110    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.kms_key_id = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The identifier of the AWS KMS key to use for encrypting data associated with the integration.</p>
115    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.kms_key_id = input;
117        self
118    }
119    /// <p>The identifier of the AWS KMS key to use for encrypting data associated with the integration.</p>
120    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
121        &self.kms_key_id
122    }
123    /// Adds a key-value pair to `tags`.
124    ///
125    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
126    ///
127    /// <p>The tags to associate with the integration.</p>
128    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut hash_map = self.tags.unwrap_or_default();
130        hash_map.insert(k.into(), v.into());
131        self.tags = ::std::option::Option::Some(hash_map);
132        self
133    }
134    /// <p>The tags to associate with the integration.</p>
135    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
136        self.tags = input;
137        self
138    }
139    /// <p>The tags to associate with the integration.</p>
140    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
141        &self.tags
142    }
143    /// <p>The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.</p>
144    pub fn private_connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.private_connection_name = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.</p>
149    pub fn set_private_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.private_connection_name = input;
151        self
152    }
153    /// <p>The name of an active private connection used to reach a self-hosted provider instance over private networking. Specify this when the instance is not publicly reachable.</p>
154    pub fn get_private_connection_name(&self) -> &::std::option::Option<::std::string::String> {
155        &self.private_connection_name
156    }
157    /// Consumes the builder and constructs a [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
158    pub fn build(
159        self,
160    ) -> ::std::result::Result<crate::operation::create_integration::CreateIntegrationInput, ::aws_smithy_types::error::operation::BuildError> {
161        ::std::result::Result::Ok(crate::operation::create_integration::CreateIntegrationInput {
162            provider: self.provider,
163            input: self.input,
164            integration_display_name: self.integration_display_name,
165            kms_key_id: self.kms_key_id,
166            tags: self.tags,
167            private_connection_name: self.private_connection_name,
168        })
169    }
170}