Skip to main content

aws_sdk_securityagent/operation/get_integration/
_get_integration_output.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 GetIntegrationOutput {
6    /// Unique identifier of the integration
7    pub integration_id: ::std::string::String,
8    /// Installation identifier from the provider
9    pub installation_id: ::std::string::String,
10    /// Provider type
11    pub provider: crate::types::Provider,
12    /// Type of provider integration
13    pub provider_type: crate::types::ProviderType,
14    /// Display name for the integration
15    pub display_name: ::std::option::Option<::std::string::String>,
16    /// KMS key ID for encrypting integration details
17    pub kms_key_id: ::std::option::Option<::std::string::String>,
18    _request_id: Option<String>,
19}
20impl GetIntegrationOutput {
21    /// Unique identifier of the integration
22    pub fn integration_id(&self) -> &str {
23        use std::ops::Deref;
24        self.integration_id.deref()
25    }
26    /// Installation identifier from the provider
27    pub fn installation_id(&self) -> &str {
28        use std::ops::Deref;
29        self.installation_id.deref()
30    }
31    /// Provider type
32    pub fn provider(&self) -> &crate::types::Provider {
33        &self.provider
34    }
35    /// Type of provider integration
36    pub fn provider_type(&self) -> &crate::types::ProviderType {
37        &self.provider_type
38    }
39    /// Display name for the integration
40    pub fn display_name(&self) -> ::std::option::Option<&str> {
41        self.display_name.as_deref()
42    }
43    /// KMS key ID for encrypting integration details
44    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
45        self.kms_key_id.as_deref()
46    }
47}
48impl ::aws_types::request_id::RequestId for GetIntegrationOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl GetIntegrationOutput {
54    /// Creates a new builder-style object to manufacture [`GetIntegrationOutput`](crate::operation::get_integration::GetIntegrationOutput).
55    pub fn builder() -> crate::operation::get_integration::builders::GetIntegrationOutputBuilder {
56        crate::operation::get_integration::builders::GetIntegrationOutputBuilder::default()
57    }
58}
59
60/// A builder for [`GetIntegrationOutput`](crate::operation::get_integration::GetIntegrationOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct GetIntegrationOutputBuilder {
64    pub(crate) integration_id: ::std::option::Option<::std::string::String>,
65    pub(crate) installation_id: ::std::option::Option<::std::string::String>,
66    pub(crate) provider: ::std::option::Option<crate::types::Provider>,
67    pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
68    pub(crate) display_name: ::std::option::Option<::std::string::String>,
69    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
70    _request_id: Option<String>,
71}
72impl GetIntegrationOutputBuilder {
73    /// Unique identifier of the integration
74    /// This field is required.
75    pub fn integration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.integration_id = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// Unique identifier of the integration
80    pub fn set_integration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.integration_id = input;
82        self
83    }
84    /// Unique identifier of the integration
85    pub fn get_integration_id(&self) -> &::std::option::Option<::std::string::String> {
86        &self.integration_id
87    }
88    /// Installation identifier from the provider
89    /// This field is required.
90    pub fn installation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.installation_id = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// Installation identifier from the provider
95    pub fn set_installation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.installation_id = input;
97        self
98    }
99    /// Installation identifier from the provider
100    pub fn get_installation_id(&self) -> &::std::option::Option<::std::string::String> {
101        &self.installation_id
102    }
103    /// Provider type
104    /// This field is required.
105    pub fn provider(mut self, input: crate::types::Provider) -> Self {
106        self.provider = ::std::option::Option::Some(input);
107        self
108    }
109    /// Provider type
110    pub fn set_provider(mut self, input: ::std::option::Option<crate::types::Provider>) -> Self {
111        self.provider = input;
112        self
113    }
114    /// Provider type
115    pub fn get_provider(&self) -> &::std::option::Option<crate::types::Provider> {
116        &self.provider
117    }
118    /// Type of provider integration
119    /// This field is required.
120    pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
121        self.provider_type = ::std::option::Option::Some(input);
122        self
123    }
124    /// Type of provider integration
125    pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
126        self.provider_type = input;
127        self
128    }
129    /// Type of provider integration
130    pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
131        &self.provider_type
132    }
133    /// Display name for the integration
134    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.display_name = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// Display name for the integration
139    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.display_name = input;
141        self
142    }
143    /// Display name for the integration
144    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
145        &self.display_name
146    }
147    /// KMS key ID for encrypting integration details
148    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.kms_key_id = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// KMS key ID for encrypting integration details
153    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.kms_key_id = input;
155        self
156    }
157    /// KMS key ID for encrypting integration details
158    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
159        &self.kms_key_id
160    }
161    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
162        self._request_id = Some(request_id.into());
163        self
164    }
165
166    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
167        self._request_id = request_id;
168        self
169    }
170    /// Consumes the builder and constructs a [`GetIntegrationOutput`](crate::operation::get_integration::GetIntegrationOutput).
171    /// This method will fail if any of the following fields are not set:
172    /// - [`integration_id`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::integration_id)
173    /// - [`installation_id`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::installation_id)
174    /// - [`provider`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::provider)
175    /// - [`provider_type`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::provider_type)
176    pub fn build(
177        self,
178    ) -> ::std::result::Result<crate::operation::get_integration::GetIntegrationOutput, ::aws_smithy_types::error::operation::BuildError> {
179        ::std::result::Result::Ok(crate::operation::get_integration::GetIntegrationOutput {
180            integration_id: self.integration_id.ok_or_else(|| {
181                ::aws_smithy_types::error::operation::BuildError::missing_field(
182                    "integration_id",
183                    "integration_id was not specified but it is required when building GetIntegrationOutput",
184                )
185            })?,
186            installation_id: self.installation_id.ok_or_else(|| {
187                ::aws_smithy_types::error::operation::BuildError::missing_field(
188                    "installation_id",
189                    "installation_id was not specified but it is required when building GetIntegrationOutput",
190                )
191            })?,
192            provider: self.provider.ok_or_else(|| {
193                ::aws_smithy_types::error::operation::BuildError::missing_field(
194                    "provider",
195                    "provider was not specified but it is required when building GetIntegrationOutput",
196                )
197            })?,
198            provider_type: self.provider_type.ok_or_else(|| {
199                ::aws_smithy_types::error::operation::BuildError::missing_field(
200                    "provider_type",
201                    "provider_type was not specified but it is required when building GetIntegrationOutput",
202                )
203            })?,
204            display_name: self.display_name,
205            kms_key_id: self.kms_key_id,
206            _request_id: self._request_id,
207        })
208    }
209}