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

commonMain.aws.sdk.kotlin.services.iot.model.CloudwatchLogsAction.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.iot.model



/**
 * Describes an action that sends data to CloudWatch Logs.
 */
public class CloudwatchLogsAction private constructor(builder: Builder) {
    /**
     * Indicates whether batches of log records will be extracted and uploaded into CloudWatch. Values include `true` or `false`*(default)*.
     */
    public val batchMode: kotlin.Boolean? = builder.batchMode
    /**
     * The CloudWatch log group to which the action sends data.
     */
    public val logGroupName: kotlin.String = requireNotNull(builder.logGroupName) { "A non-null value must be provided for logGroupName" }
    /**
     * The IAM role that allows access to the CloudWatch log.
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }

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

    override fun toString(): kotlin.String = buildString {
        append("CloudwatchLogsAction(")
        append("batchMode=$batchMode,")
        append("logGroupName=$logGroupName,")
        append("roleArn=$roleArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = batchMode?.hashCode() ?: 0
        result = 31 * result + (logGroupName.hashCode())
        result = 31 * result + (roleArn.hashCode())
        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 CloudwatchLogsAction

        if (batchMode != other.batchMode) return false
        if (logGroupName != other.logGroupName) return false
        if (roleArn != other.roleArn) return false

        return true
    }

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

    public class Builder {
        /**
         * Indicates whether batches of log records will be extracted and uploaded into CloudWatch. Values include `true` or `false`*(default)*.
         */
        public var batchMode: kotlin.Boolean? = null
        /**
         * The CloudWatch log group to which the action sends data.
         */
        public var logGroupName: kotlin.String? = null
        /**
         * The IAM role that allows access to the CloudWatch log.
         */
        public var roleArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.iot.model.CloudwatchLogsAction) : this() {
            this.batchMode = x.batchMode
            this.logGroupName = x.logGroupName
            this.roleArn = x.roleArn
        }

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

        internal fun correctErrors(): Builder {
            if (logGroupName == null) logGroupName = ""
            if (roleArn == null) roleArn = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy