aws-sdk-cloudwatchomni 1.2.0

AWS SDK for CloudWatch Omni
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// The request for updating an existing integration.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateIntegrationInput {
    /// Identifies the integration to update — exactly one of integrationId, integrationArn, or integrationName.
    pub identifier: ::std::option::Option<crate::types::IntegrationIdentifier>,
    /// The replacement credential used to authenticate with the provider.
    pub credential: ::std::option::Option<crate::types::IntegrationCredential>,
    /// The provider-specific attributes to associate with the integration.
    pub integration_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// The Amazon Resource Name of the IAM role assumed to access the integration.
    pub role_arn: ::std::option::Option<::std::string::String>,
}
impl UpdateIntegrationInput {
    /// Identifies the integration to update — exactly one of integrationId, integrationArn, or integrationName.
    pub fn identifier(&self) -> ::std::option::Option<&crate::types::IntegrationIdentifier> {
        self.identifier.as_ref()
    }
    /// The replacement credential used to authenticate with the provider.
    pub fn credential(&self) -> ::std::option::Option<&crate::types::IntegrationCredential> {
        self.credential.as_ref()
    }
    /// The provider-specific attributes to associate with the integration.
    pub fn integration_attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.integration_attributes.as_ref()
    }
    /// The Amazon Resource Name of the IAM role assumed to access the integration.
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
}
impl UpdateIntegrationInput {
    /// Creates a new builder-style object to manufacture [`UpdateIntegrationInput`](crate::operation::update_integration::UpdateIntegrationInput).
    pub fn builder() -> crate::operation::update_integration::builders::UpdateIntegrationInputBuilder {
        crate::operation::update_integration::builders::UpdateIntegrationInputBuilder::default()
    }
}

/// A builder for [`UpdateIntegrationInput`](crate::operation::update_integration::UpdateIntegrationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateIntegrationInputBuilder {
    pub(crate) identifier: ::std::option::Option<crate::types::IntegrationIdentifier>,
    pub(crate) credential: ::std::option::Option<crate::types::IntegrationCredential>,
    pub(crate) integration_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
}
impl UpdateIntegrationInputBuilder {
    /// Identifies the integration to update — exactly one of integrationId, integrationArn, or integrationName.
    /// This field is required.
    pub fn identifier(mut self, input: crate::types::IntegrationIdentifier) -> Self {
        self.identifier = ::std::option::Option::Some(input);
        self
    }
    /// Identifies the integration to update — exactly one of integrationId, integrationArn, or integrationName.
    pub fn set_identifier(mut self, input: ::std::option::Option<crate::types::IntegrationIdentifier>) -> Self {
        self.identifier = input;
        self
    }
    /// Identifies the integration to update — exactly one of integrationId, integrationArn, or integrationName.
    pub fn get_identifier(&self) -> &::std::option::Option<crate::types::IntegrationIdentifier> {
        &self.identifier
    }
    /// The replacement credential used to authenticate with the provider.
    pub fn credential(mut self, input: crate::types::IntegrationCredential) -> Self {
        self.credential = ::std::option::Option::Some(input);
        self
    }
    /// The replacement credential used to authenticate with the provider.
    pub fn set_credential(mut self, input: ::std::option::Option<crate::types::IntegrationCredential>) -> Self {
        self.credential = input;
        self
    }
    /// The replacement credential used to authenticate with the provider.
    pub fn get_credential(&self) -> &::std::option::Option<crate::types::IntegrationCredential> {
        &self.credential
    }
    /// Adds a key-value pair to `integration_attributes`.
    ///
    /// To override the contents of this collection use [`set_integration_attributes`](Self::set_integration_attributes).
    ///
    /// The provider-specific attributes to associate with the integration.
    pub fn integration_attributes(
        mut self,
        k: impl ::std::convert::Into<::std::string::String>,
        v: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        let mut hash_map = self.integration_attributes.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.integration_attributes = ::std::option::Option::Some(hash_map);
        self
    }
    /// The provider-specific attributes to associate with the integration.
    pub fn set_integration_attributes(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    ) -> Self {
        self.integration_attributes = input;
        self
    }
    /// The provider-specific attributes to associate with the integration.
    pub fn get_integration_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.integration_attributes
    }
    /// The Amazon Resource Name of the IAM role assumed to access the integration.
    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.role_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name of the IAM role assumed to access the integration.
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// The Amazon Resource Name of the IAM role assumed to access the integration.
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// Consumes the builder and constructs a [`UpdateIntegrationInput`](crate::operation::update_integration::UpdateIntegrationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_integration::UpdateIntegrationInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_integration::UpdateIntegrationInput {
            identifier: self.identifier,
            credential: self.credential,
            integration_attributes: self.integration_attributes,
            role_arn: self.role_arn,
        })
    }
}