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

commonMain.aws.sdk.kotlin.services.ssmincidents.model.SsmAutomation.kt Maven / Gradle / Ivy

There is a newer version: 1.3.79
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.ssmincidents.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details about the Systems Manager automation document that will be used as a runbook during an incident.
 */
public class SsmAutomation private constructor(builder: Builder) {
    /**
     * The automation document's name.
     */
    public val documentName: kotlin.String = requireNotNull(builder.documentName) { "A non-null value must be provided for documentName" }
    /**
     * The automation document's version to use when running.
     */
    public val documentVersion: kotlin.String? = builder.documentVersion
    /**
     * The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook.
     */
    public val dynamicParameters: Map? = builder.dynamicParameters
    /**
     * The key-value pair parameters to use when running the automation document.
     */
    public val parameters: Map>? = builder.parameters
    /**
     * The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands.
     */
    public val roleArn: kotlin.String = requireNotNull(builder.roleArn) { "A non-null value must be provided for roleArn" }
    /**
     * The account that the automation document will be run in. This can be in either the management account or an application account.
     */
    public val targetAccount: aws.sdk.kotlin.services.ssmincidents.model.SsmTargetAccount? = builder.targetAccount

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

    override fun toString(): kotlin.String = buildString {
        append("SsmAutomation(")
        append("documentName=$documentName,")
        append("documentVersion=$documentVersion,")
        append("dynamicParameters=$dynamicParameters,")
        append("parameters=$parameters,")
        append("roleArn=$roleArn,")
        append("targetAccount=$targetAccount")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = documentName.hashCode()
        result = 31 * result + (documentVersion?.hashCode() ?: 0)
        result = 31 * result + (dynamicParameters?.hashCode() ?: 0)
        result = 31 * result + (parameters?.hashCode() ?: 0)
        result = 31 * result + (roleArn.hashCode())
        result = 31 * result + (targetAccount?.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 SsmAutomation

        if (documentName != other.documentName) return false
        if (documentVersion != other.documentVersion) return false
        if (dynamicParameters != other.dynamicParameters) return false
        if (parameters != other.parameters) return false
        if (roleArn != other.roleArn) return false
        if (targetAccount != other.targetAccount) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The automation document's name.
         */
        public var documentName: kotlin.String? = null
        /**
         * The automation document's version to use when running.
         */
        public var documentVersion: kotlin.String? = null
        /**
         * The key-value pair to resolve dynamic parameter values when processing a Systems Manager Automation runbook.
         */
        public var dynamicParameters: Map? = null
        /**
         * The key-value pair parameters to use when running the automation document.
         */
        public var parameters: Map>? = null
        /**
         * The Amazon Resource Name (ARN) of the role that the automation document will assume when running commands.
         */
        public var roleArn: kotlin.String? = null
        /**
         * The account that the automation document will be run in. This can be in either the management account or an application account.
         */
        public var targetAccount: aws.sdk.kotlin.services.ssmincidents.model.SsmTargetAccount? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.SsmAutomation) : this() {
            this.documentName = x.documentName
            this.documentVersion = x.documentVersion
            this.dynamicParameters = x.dynamicParameters
            this.parameters = x.parameters
            this.roleArn = x.roleArn
            this.targetAccount = x.targetAccount
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy