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.

/// A connection between CloudWatch and an external system — such as a source of telemetry or configuration data, a messaging destination, or a model provider.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Integration {
    /// The unique identifier of the integration.
    pub integration_id: ::std::string::String,
    /// The Amazon Resource Name (ARN) of the integration.
    pub integration_arn: ::std::option::Option<::std::string::String>,
    /// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
    pub integration_type: crate::types::IntegrationType,
    /// The customer-provided name of the integration.
    pub name: ::std::string::String,
    /// The current lifecycle state of an integration.
    pub status: crate::types::IntegrationStatus,
    /// The authentication method that an integration uses to connect to its external system.
    pub auth_type: ::std::option::Option<crate::types::AuthType>,
    /// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
    pub credential_arn: ::std::option::Option<::std::string::String>,
    /// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
    pub role_arn: ::std::option::Option<::std::string::String>,
    /// Provider-specific key/value attributes that configure the integration.
    pub integration_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
    pub authorization_url: ::std::option::Option<::std::string::String>,
    /// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
    pub error_message: ::std::option::Option<::std::string::String>,
    /// The time at which the integration was created.
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// The time at which the integration was last updated.
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
    pub scope: ::std::option::Option<crate::types::Scope>,
}
impl Integration {
    /// The unique identifier of the integration.
    pub fn integration_id(&self) -> &str {
        use std::ops::Deref;
        self.integration_id.deref()
    }
    /// The Amazon Resource Name (ARN) of the integration.
    pub fn integration_arn(&self) -> ::std::option::Option<&str> {
        self.integration_arn.as_deref()
    }
    /// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
    pub fn integration_type(&self) -> &crate::types::IntegrationType {
        &self.integration_type
    }
    /// The customer-provided name of the integration.
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// The current lifecycle state of an integration.
    pub fn status(&self) -> &crate::types::IntegrationStatus {
        &self.status
    }
    /// The authentication method that an integration uses to connect to its external system.
    pub fn auth_type(&self) -> ::std::option::Option<&crate::types::AuthType> {
        self.auth_type.as_ref()
    }
    /// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
    pub fn credential_arn(&self) -> ::std::option::Option<&str> {
        self.credential_arn.as_deref()
    }
    /// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
    pub fn role_arn(&self) -> ::std::option::Option<&str> {
        self.role_arn.as_deref()
    }
    /// Provider-specific key/value attributes that configure 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 URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
    pub fn authorization_url(&self) -> ::std::option::Option<&str> {
        self.authorization_url.as_deref()
    }
    /// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
    pub fn error_message(&self) -> ::std::option::Option<&str> {
        self.error_message.as_deref()
    }
    /// The time at which the integration was created.
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// The time at which the integration was last updated.
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
    /// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
    pub fn scope(&self) -> ::std::option::Option<&crate::types::Scope> {
        self.scope.as_ref()
    }
}
impl Integration {
    /// Creates a new builder-style object to manufacture [`Integration`](crate::types::Integration).
    pub fn builder() -> crate::types::builders::IntegrationBuilder {
        crate::types::builders::IntegrationBuilder::default()
    }
}

/// A builder for [`Integration`](crate::types::Integration).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct IntegrationBuilder {
    pub(crate) integration_id: ::std::option::Option<::std::string::String>,
    pub(crate) integration_arn: ::std::option::Option<::std::string::String>,
    pub(crate) integration_type: ::std::option::Option<crate::types::IntegrationType>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::IntegrationStatus>,
    pub(crate) auth_type: ::std::option::Option<crate::types::AuthType>,
    pub(crate) credential_arn: ::std::option::Option<::std::string::String>,
    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
    pub(crate) integration_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) authorization_url: ::std::option::Option<::std::string::String>,
    pub(crate) error_message: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) scope: ::std::option::Option<crate::types::Scope>,
}
impl IntegrationBuilder {
    /// The 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
    }
    /// The 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
    }
    /// The unique identifier of the integration.
    pub fn get_integration_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.integration_id
    }
    /// The Amazon Resource Name (ARN) of the integration.
    pub fn integration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.integration_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the integration.
    pub fn set_integration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.integration_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the integration.
    pub fn get_integration_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.integration_arn
    }
    /// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
    /// 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 external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
    pub fn set_integration_type(mut self, input: ::std::option::Option<crate::types::IntegrationType>) -> Self {
        self.integration_type = input;
        self
    }
    /// The type of external system that an integration connects to, such as a source of configuration data, a messaging destination, or a model provider.
    pub fn get_integration_type(&self) -> &::std::option::Option<crate::types::IntegrationType> {
        &self.integration_type
    }
    /// The customer-provided name of the integration.
    /// 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 customer-provided name of the integration.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The customer-provided name of the integration.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The current lifecycle state of an integration.
    /// This field is required.
    pub fn status(mut self, input: crate::types::IntegrationStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The current lifecycle state of an integration.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::IntegrationStatus>) -> Self {
        self.status = input;
        self
    }
    /// The current lifecycle state of an integration.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::IntegrationStatus> {
        &self.status
    }
    /// The authentication method that an integration uses to connect to its external system.
    pub fn auth_type(mut self, input: crate::types::AuthType) -> Self {
        self.auth_type = ::std::option::Option::Some(input);
        self
    }
    /// The authentication method that an integration uses to connect to its external system.
    pub fn set_auth_type(mut self, input: ::std::option::Option<crate::types::AuthType>) -> Self {
        self.auth_type = input;
        self
    }
    /// The authentication method that an integration uses to connect to its external system.
    pub fn get_auth_type(&self) -> &::std::option::Option<crate::types::AuthType> {
        &self.auth_type
    }
    /// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
    pub fn credential_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.credential_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
    pub fn set_credential_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.credential_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the secret that stores the integration's credentials.
    pub fn get_credential_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.credential_arn
    }
    /// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
    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 (ARN) of the IAM role that CloudWatch assumes to access the external system.
    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.role_arn = input;
        self
    }
    /// The Amazon Resource Name (ARN) of the IAM role that CloudWatch assumes to access the external system.
    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.role_arn
    }
    /// 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 key/value attributes that configure 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 key/value attributes that configure 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 key/value attributes that configure the integration.
    pub fn get_integration_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.integration_attributes
    }
    /// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
    pub fn authorization_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.authorization_url = ::std::option::Option::Some(input.into());
        self
    }
    /// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
    pub fn set_authorization_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.authorization_url = input;
        self
    }
    /// The URL the customer visits to authorize the integration. Present while an OAuth authorization is pending.
    pub fn get_authorization_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.authorization_url
    }
    /// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
    pub fn error_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.error_message = ::std::option::Option::Some(input.into());
        self
    }
    /// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
    pub fn set_error_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.error_message = input;
        self
    }
    /// A human-readable description of why the integration is in an ERROR or FAILED state. Present only when the integration has failed.
    pub fn get_error_message(&self) -> &::std::option::Option<::std::string::String> {
        &self.error_message
    }
    /// The time at which the integration was created.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// The time at which the integration was created.
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// The time at which the integration was created.
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// The time at which the integration was last updated.
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// The time at which the integration was last updated.
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// The time at which the integration was last updated.
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
    pub fn scope(mut self, input: crate::types::Scope) -> Self {
        self.scope = ::std::option::Option::Some(input);
        self
    }
    /// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::Scope>) -> Self {
        self.scope = input;
        self
    }
    /// Whether this integration is account-scoped (ACCOUNT, customer-created) or organization-scoped (ORGANIZATION, created by an org-enablement rule). Absent on legacy records is treated as ACCOUNT.
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::Scope> {
        &self.scope
    }
    /// Consumes the builder and constructs a [`Integration`](crate::types::Integration).
    /// This method will fail if any of the following fields are not set:
    /// - [`integration_id`](crate::types::builders::IntegrationBuilder::integration_id)
    /// - [`integration_type`](crate::types::builders::IntegrationBuilder::integration_type)
    /// - [`name`](crate::types::builders::IntegrationBuilder::name)
    /// - [`status`](crate::types::builders::IntegrationBuilder::status)
    pub fn build(self) -> ::std::result::Result<crate::types::Integration, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::Integration {
            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 Integration",
                )
            })?,
            integration_arn: self.integration_arn,
            integration_type: self.integration_type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "integration_type",
                    "integration_type was not specified but it is required when building Integration",
                )
            })?,
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building Integration",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building Integration",
                )
            })?,
            auth_type: self.auth_type,
            credential_arn: self.credential_arn,
            role_arn: self.role_arn,
            integration_attributes: self.integration_attributes,
            authorization_url: self.authorization_url,
            error_message: self.error_message,
            created_at: self.created_at,
            updated_at: self.updated_at,
            scope: self.scope,
        })
    }
}