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 creating an integration with a third-party provider.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateIntegrationInput {
    /// The type of third-party provider to integrate with.
    pub integration_type: ::std::option::Option<crate::types::IntegrationType>,
    /// The name for the new integration; unique within the account.
    pub name: ::std::option::Option<::std::string::String>,
    /// The credential used to authenticate with the third-party provider.
    pub credential: ::std::option::Option<crate::types::IntegrationCredential>,
    /// 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>,
    /// Tags to apply to the integration at creation time (Tagris tag-on-create).
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// Idempotency token for safe retries. Retrying with the same token returns the original integration instead of creating a duplicate.
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateIntegrationInput {
    /// The type of third-party provider to integrate with.
    pub fn integration_type(&self) -> ::std::option::Option<&crate::types::IntegrationType> {
        self.integration_type.as_ref()
    }
    /// The name for the new integration; unique within the account.
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// The credential used to authenticate with the third-party provider.
    pub fn credential(&self) -> ::std::option::Option<&crate::types::IntegrationCredential> {
        self.credential.as_ref()
    }
    /// 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()
    }
    /// Tags to apply to the integration at creation time (Tagris tag-on-create).
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// Idempotency token for safe retries. Retrying with the same token returns the original integration instead of creating a duplicate.
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateIntegrationInput {
    /// Creates a new builder-style object to manufacture [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
    pub fn builder() -> crate::operation::create_integration::builders::CreateIntegrationInputBuilder {
        crate::operation::create_integration::builders::CreateIntegrationInputBuilder::default()
    }
}

/// A builder for [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateIntegrationInputBuilder {
    pub(crate) integration_type: ::std::option::Option<crate::types::IntegrationType>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    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>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateIntegrationInputBuilder {
    /// The type of third-party provider to integrate with.
    /// This field is required.
    pub fn integration_type(mut self, input: crate::types::IntegrationType) -> Self {
        self.integration_type = ::std::option::Option::Some(input);
        self
    }
    /// The type of third-party provider to integrate with.
    pub fn set_integration_type(mut self, input: ::std::option::Option<crate::types::IntegrationType>) -> Self {
        self.integration_type = input;
        self
    }
    /// The type of third-party provider to integrate with.
    pub fn get_integration_type(&self) -> &::std::option::Option<crate::types::IntegrationType> {
        &self.integration_type
    }
    /// The name for the new integration; unique within the account.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name for the new integration; unique within the account.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name for the new integration; unique within the account.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The credential used to authenticate with the third-party provider.
    pub fn credential(mut self, input: crate::types::IntegrationCredential) -> Self {
        self.credential = ::std::option::Option::Some(input);
        self
    }
    /// The credential used to authenticate with the third-party provider.
    pub fn set_credential(mut self, input: ::std::option::Option<crate::types::IntegrationCredential>) -> Self {
        self.credential = input;
        self
    }
    /// The credential used to authenticate with the third-party 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).
    ///
    /// 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
    }
    /// 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
    }
    /// 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
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// Tags to apply to the integration at creation time (Tagris tag-on-create).
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// Tags to apply to the integration at creation time (Tagris tag-on-create).
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// Tags to apply to the integration at creation time (Tagris tag-on-create).
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Idempotency token for safe retries. Retrying with the same token returns the original integration instead of creating a duplicate.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// Idempotency token for safe retries. Retrying with the same token returns the original integration instead of creating a duplicate.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// Idempotency token for safe retries. Retrying with the same token returns the original integration instead of creating a duplicate.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateIntegrationInput`](crate::operation::create_integration::CreateIntegrationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_integration::CreateIntegrationInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_integration::CreateIntegrationInput {
            integration_type: self.integration_type,
            name: self.name,
            credential: self.credential,
            integration_attributes: self.integration_attributes,
            role_arn: self.role_arn,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}