All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.chatbot.model.SlackChannelConfiguration.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.chatbot.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An AWS Chatbot configuration for Slack.
 */
public class SlackChannelConfiguration private constructor(builder: Builder) {
    /**
     * The ARN of the SlackChannelConfiguration.
     */
    public val chatConfigurationArn: kotlin.String = requireNotNull(builder.chatConfigurationArn) { "A non-null value must be provided for chatConfigurationArn" }
    /**
     * The name of the configuration.
     */
    public val configurationName: kotlin.String? = builder.configurationName
    /**
     * The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed 'AdministratorAccess' policy is applied by default if this is not set.
     */
    public val guardrailPolicyArns: List? = builder.guardrailPolicyArns
    /**
     * The ARN of the IAM role that defines the permissions for AWS Chatbot. This is a user-defined role that AWS Chatbot will assume. This is not the service-linked role. For more information, see IAM Policies for AWS Chatbot.
     */
    public val iamRoleArn: kotlin.String = requireNotNull(builder.iamRoleArn) { "A non-null value must be provided for iamRoleArn" }
    /**
     * Logging levels include ERROR, INFO, or NONE.
     */
    public val loggingLevel: kotlin.String? = builder.loggingLevel
    /**
     * The ID of the Slack channel. To get the ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.
     */
    public val slackChannelId: kotlin.String = requireNotNull(builder.slackChannelId) { "A non-null value must be provided for slackChannelId" }
    /**
     * The name of the Slack Channel.
     */
    public val slackChannelName: kotlin.String = requireNotNull(builder.slackChannelName) { "A non-null value must be provided for slackChannelName" }
    /**
     * The ID of the Slack workspace authorized with AWS Chatbot.
     */
    public val slackTeamId: kotlin.String = requireNotNull(builder.slackTeamId) { "A non-null value must be provided for slackTeamId" }
    /**
     * Name of the Slack Workspace.
     */
    public val slackTeamName: kotlin.String = requireNotNull(builder.slackTeamName) { "A non-null value must be provided for slackTeamName" }
    /**
     * The ARNs of the SNS topics that deliver notifications to AWS Chatbot.
     */
    public val snsTopicArns: List = requireNotNull(builder.snsTopicArns) { "A non-null value must be provided for snsTopicArns" }
    /**
     * A list of tags applied to the configuration.
     */
    public val tags: List? = builder.tags
    /**
     * Enables use of a user role requirement in your chat configuration.
     */
    public val userAuthorizationRequired: kotlin.Boolean? = builder.userAuthorizationRequired

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.chatbot.model.SlackChannelConfiguration = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("SlackChannelConfiguration(")
        append("chatConfigurationArn=$chatConfigurationArn,")
        append("configurationName=$configurationName,")
        append("guardrailPolicyArns=$guardrailPolicyArns,")
        append("iamRoleArn=$iamRoleArn,")
        append("loggingLevel=$loggingLevel,")
        append("slackChannelId=$slackChannelId,")
        append("slackChannelName=$slackChannelName,")
        append("slackTeamId=$slackTeamId,")
        append("slackTeamName=$slackTeamName,")
        append("snsTopicArns=$snsTopicArns,")
        append("tags=$tags,")
        append("userAuthorizationRequired=$userAuthorizationRequired")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = chatConfigurationArn.hashCode()
        result = 31 * result + (configurationName?.hashCode() ?: 0)
        result = 31 * result + (guardrailPolicyArns?.hashCode() ?: 0)
        result = 31 * result + (iamRoleArn.hashCode())
        result = 31 * result + (loggingLevel?.hashCode() ?: 0)
        result = 31 * result + (slackChannelId.hashCode())
        result = 31 * result + (slackChannelName.hashCode())
        result = 31 * result + (slackTeamId.hashCode())
        result = 31 * result + (slackTeamName.hashCode())
        result = 31 * result + (snsTopicArns.hashCode())
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (userAuthorizationRequired?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as SlackChannelConfiguration

        if (chatConfigurationArn != other.chatConfigurationArn) return false
        if (configurationName != other.configurationName) return false
        if (guardrailPolicyArns != other.guardrailPolicyArns) return false
        if (iamRoleArn != other.iamRoleArn) return false
        if (loggingLevel != other.loggingLevel) return false
        if (slackChannelId != other.slackChannelId) return false
        if (slackChannelName != other.slackChannelName) return false
        if (slackTeamId != other.slackTeamId) return false
        if (slackTeamName != other.slackTeamName) return false
        if (snsTopicArns != other.snsTopicArns) return false
        if (tags != other.tags) return false
        if (userAuthorizationRequired != other.userAuthorizationRequired) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.chatbot.model.SlackChannelConfiguration = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The ARN of the SlackChannelConfiguration.
         */
        public var chatConfigurationArn: kotlin.String? = null
        /**
         * The name of the configuration.
         */
        public var configurationName: kotlin.String? = null
        /**
         * The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed 'AdministratorAccess' policy is applied by default if this is not set.
         */
        public var guardrailPolicyArns: List? = null
        /**
         * The ARN of the IAM role that defines the permissions for AWS Chatbot. This is a user-defined role that AWS Chatbot will assume. This is not the service-linked role. For more information, see IAM Policies for AWS Chatbot.
         */
        public var iamRoleArn: kotlin.String? = null
        /**
         * Logging levels include ERROR, INFO, or NONE.
         */
        public var loggingLevel: kotlin.String? = null
        /**
         * The ID of the Slack channel. To get the ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.
         */
        public var slackChannelId: kotlin.String? = null
        /**
         * The name of the Slack Channel.
         */
        public var slackChannelName: kotlin.String? = null
        /**
         * The ID of the Slack workspace authorized with AWS Chatbot.
         */
        public var slackTeamId: kotlin.String? = null
        /**
         * Name of the Slack Workspace.
         */
        public var slackTeamName: kotlin.String? = null
        /**
         * The ARNs of the SNS topics that deliver notifications to AWS Chatbot.
         */
        public var snsTopicArns: List? = null
        /**
         * A list of tags applied to the configuration.
         */
        public var tags: List? = null
        /**
         * Enables use of a user role requirement in your chat configuration.
         */
        public var userAuthorizationRequired: kotlin.Boolean? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.chatbot.model.SlackChannelConfiguration) : this() {
            this.chatConfigurationArn = x.chatConfigurationArn
            this.configurationName = x.configurationName
            this.guardrailPolicyArns = x.guardrailPolicyArns
            this.iamRoleArn = x.iamRoleArn
            this.loggingLevel = x.loggingLevel
            this.slackChannelId = x.slackChannelId
            this.slackChannelName = x.slackChannelName
            this.slackTeamId = x.slackTeamId
            this.slackTeamName = x.slackTeamName
            this.snsTopicArns = x.snsTopicArns
            this.tags = x.tags
            this.userAuthorizationRequired = x.userAuthorizationRequired
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.chatbot.model.SlackChannelConfiguration = SlackChannelConfiguration(this)

        internal fun correctErrors(): Builder {
            if (chatConfigurationArn == null) chatConfigurationArn = ""
            if (iamRoleArn == null) iamRoleArn = ""
            if (slackChannelId == null) slackChannelId = ""
            if (slackChannelName == null) slackChannelName = ""
            if (slackTeamId == null) slackTeamId = ""
            if (slackTeamName == null) slackTeamName = ""
            if (snsTopicArns == null) snsTopicArns = emptyList()
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy