aws-sdk-securityagent 1.1.0

AWS SDK for AWS Security Agent
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetIntegrationOutput {
    /// Unique identifier of the integration
    pub integration_id: ::std::string::String,
    /// Installation identifier from the provider
    pub installation_id: ::std::string::String,
    /// Provider type
    pub provider: crate::types::Provider,
    /// Type of provider integration
    pub provider_type: crate::types::ProviderType,
    /// Display name for the integration
    pub display_name: ::std::option::Option<::std::string::String>,
    /// KMS key ID for encrypting integration details
    pub kms_key_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetIntegrationOutput {
    /// Unique identifier of the integration
    pub fn integration_id(&self) -> &str {
        use std::ops::Deref;
        self.integration_id.deref()
    }
    /// Installation identifier from the provider
    pub fn installation_id(&self) -> &str {
        use std::ops::Deref;
        self.installation_id.deref()
    }
    /// Provider type
    pub fn provider(&self) -> &crate::types::Provider {
        &self.provider
    }
    /// Type of provider integration
    pub fn provider_type(&self) -> &crate::types::ProviderType {
        &self.provider_type
    }
    /// Display name for the integration
    pub fn display_name(&self) -> ::std::option::Option<&str> {
        self.display_name.as_deref()
    }
    /// KMS key ID for encrypting integration details
    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
        self.kms_key_id.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetIntegrationOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetIntegrationOutput {
    /// Creates a new builder-style object to manufacture [`GetIntegrationOutput`](crate::operation::get_integration::GetIntegrationOutput).
    pub fn builder() -> crate::operation::get_integration::builders::GetIntegrationOutputBuilder {
        crate::operation::get_integration::builders::GetIntegrationOutputBuilder::default()
    }
}

/// A builder for [`GetIntegrationOutput`](crate::operation::get_integration::GetIntegrationOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetIntegrationOutputBuilder {
    pub(crate) integration_id: ::std::option::Option<::std::string::String>,
    pub(crate) installation_id: ::std::option::Option<::std::string::String>,
    pub(crate) provider: ::std::option::Option<crate::types::Provider>,
    pub(crate) provider_type: ::std::option::Option<crate::types::ProviderType>,
    pub(crate) display_name: ::std::option::Option<::std::string::String>,
    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetIntegrationOutputBuilder {
    /// Unique identifier of the integration
    /// This field is required.
    pub fn integration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.integration_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Unique identifier of the integration
    pub fn set_integration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.integration_id = input;
        self
    }
    /// Unique identifier of the integration
    pub fn get_integration_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.integration_id
    }
    /// Installation identifier from the provider
    /// This field is required.
    pub fn installation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.installation_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Installation identifier from the provider
    pub fn set_installation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.installation_id = input;
        self
    }
    /// Installation identifier from the provider
    pub fn get_installation_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.installation_id
    }
    /// Provider type
    /// This field is required.
    pub fn provider(mut self, input: crate::types::Provider) -> Self {
        self.provider = ::std::option::Option::Some(input);
        self
    }
    /// Provider type
    pub fn set_provider(mut self, input: ::std::option::Option<crate::types::Provider>) -> Self {
        self.provider = input;
        self
    }
    /// Provider type
    pub fn get_provider(&self) -> &::std::option::Option<crate::types::Provider> {
        &self.provider
    }
    /// Type of provider integration
    /// This field is required.
    pub fn provider_type(mut self, input: crate::types::ProviderType) -> Self {
        self.provider_type = ::std::option::Option::Some(input);
        self
    }
    /// Type of provider integration
    pub fn set_provider_type(mut self, input: ::std::option::Option<crate::types::ProviderType>) -> Self {
        self.provider_type = input;
        self
    }
    /// Type of provider integration
    pub fn get_provider_type(&self) -> &::std::option::Option<crate::types::ProviderType> {
        &self.provider_type
    }
    /// Display name for the integration
    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.display_name = ::std::option::Option::Some(input.into());
        self
    }
    /// Display name for the integration
    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.display_name = input;
        self
    }
    /// Display name for the integration
    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.display_name
    }
    /// KMS key ID for encrypting integration details
    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// KMS key ID for encrypting integration details
    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_id = input;
        self
    }
    /// KMS key ID for encrypting integration details
    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_id
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetIntegrationOutput`](crate::operation::get_integration::GetIntegrationOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`integration_id`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::integration_id)
    /// - [`installation_id`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::installation_id)
    /// - [`provider`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::provider)
    /// - [`provider_type`](crate::operation::get_integration::builders::GetIntegrationOutputBuilder::provider_type)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_integration::GetIntegrationOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_integration::GetIntegrationOutput {
            integration_id: self.integration_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "integration_id",
                    "integration_id was not specified but it is required when building GetIntegrationOutput",
                )
            })?,
            installation_id: self.installation_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "installation_id",
                    "installation_id was not specified but it is required when building GetIntegrationOutput",
                )
            })?,
            provider: self.provider.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "provider",
                    "provider was not specified but it is required when building GetIntegrationOutput",
                )
            })?,
            provider_type: self.provider_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "provider_type",
                    "provider_type was not specified but it is required when building GetIntegrationOutput",
                )
            })?,
            display_name: self.display_name,
            kms_key_id: self.kms_key_id,
            _request_id: self._request_id,
        })
    }
}