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

commonMain.aws.sdk.kotlin.services.ssm.model.StartAutomationExecutionRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ssm.model

import aws.smithy.kotlin.runtime.SdkDsl

public class StartAutomationExecutionRequest private constructor(builder: Builder) {
    /**
     * The CloudWatch alarm you want to apply to your automation.
     */
    public val alarmConfiguration: aws.sdk.kotlin.services.ssm.model.AlarmConfiguration? = builder.alarmConfiguration
    /**
     * User-provided idempotency token. The token must be unique, is case insensitive, enforces the UUID format, and can't be reused.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The name of the SSM document to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document ARN. For more information about how to use shared documents, see [Sharing SSM documents](https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-ssm-sharing.html) in the *Amazon Web Services Systems Manager User Guide*.
     */
    public val documentName: kotlin.String? = builder.documentName
    /**
     * The version of the Automation runbook to use for this execution.
     */
    public val documentVersion: kotlin.String? = builder.documentVersion
    /**
     * The maximum number of targets allowed to run this task in parallel. You can specify a number, such as 10, or a percentage, such as 10%. The default value is `10`.
     *
     * If both this parameter and the `TargetLocation:TargetsMaxConcurrency` are supplied, `TargetLocation:TargetsMaxConcurrency` takes precedence.
     */
    public val maxConcurrency: kotlin.String? = builder.maxConcurrency
    /**
     * The number of errors that are allowed before the system stops running the automation on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops running the automation when the fourth error is received. If you specify 0, then the system stops running the automation on additional targets after the first error result is returned. If you run an automation on 50 resources and set max-errors to 10%, then the system stops running the automation on additional targets when the sixth error is received.
     *
     * Executions that are already running an automation when max-errors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set max-concurrency to 1 so the executions proceed one at a time.
     *
     * If this parameter and the `TargetLocation:TargetsMaxErrors` parameter are both supplied, `TargetLocation:TargetsMaxErrors` takes precedence.
     */
    public val maxErrors: kotlin.String? = builder.maxErrors
    /**
     * The execution mode of the automation. Valid modes include the following: Auto and Interactive. The default mode is Auto.
     */
    public val mode: aws.sdk.kotlin.services.ssm.model.ExecutionMode? = builder.mode
    /**
     * A key-value map of execution parameters, which match the declared parameters in the Automation runbook.
     */
    public val parameters: Map>? = builder.parameters
    /**
     * Optional metadata that you assign to a resource. You can specify a maximum of five tags for an automation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an automation to identify an environment or operating system. In this case, you could specify the following key-value pairs:
     * + `Key=environment,Value=test`
     * + `Key=OS,Value=Windows`
     *
     * To add tags to an existing automation, use the AddTagsToResource operation.
     */
    public val tags: List? = builder.tags
    /**
     * A location is a combination of Amazon Web Services Regions and/or Amazon Web Services accounts where you want to run the automation. Use this operation to start an automation in multiple Amazon Web Services Regions and multiple Amazon Web Services accounts. For more information, see [Running automations in multiple Amazon Web Services Regions and accounts](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) in the *Amazon Web Services Systems Manager User Guide*.
     */
    public val targetLocations: List? = builder.targetLocations
    /**
     * Specify a publicly accessible URL for a file that contains the `TargetLocations` body. Currently, only files in presigned Amazon S3 buckets are supported.
     */
    public val targetLocationsUrl: kotlin.String? = builder.targetLocationsUrl
    /**
     * A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.
     */
    public val targetMaps: List>>? = builder.targetMaps
    /**
     * The name of the parameter used as the target resource for the rate-controlled execution. Required if you specify targets.
     */
    public val targetParameterName: kotlin.String? = builder.targetParameterName
    /**
     * A key-value mapping to target resources. Required if you specify TargetParameterName.
     *
     * If both this parameter and the `TargetLocation:Targets` parameter are supplied, `TargetLocation:Targets` takes precedence.
     */
    public val targets: List? = builder.targets

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

    override fun toString(): kotlin.String = buildString {
        append("StartAutomationExecutionRequest(")
        append("alarmConfiguration=$alarmConfiguration,")
        append("clientToken=$clientToken,")
        append("documentName=$documentName,")
        append("documentVersion=$documentVersion,")
        append("maxConcurrency=$maxConcurrency,")
        append("maxErrors=$maxErrors,")
        append("mode=$mode,")
        append("parameters=$parameters,")
        append("tags=$tags,")
        append("targetLocations=$targetLocations,")
        append("targetLocationsUrl=$targetLocationsUrl,")
        append("targetMaps=$targetMaps,")
        append("targetParameterName=$targetParameterName,")
        append("targets=$targets")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = alarmConfiguration?.hashCode() ?: 0
        result = 31 * result + (clientToken?.hashCode() ?: 0)
        result = 31 * result + (documentName?.hashCode() ?: 0)
        result = 31 * result + (documentVersion?.hashCode() ?: 0)
        result = 31 * result + (maxConcurrency?.hashCode() ?: 0)
        result = 31 * result + (maxErrors?.hashCode() ?: 0)
        result = 31 * result + (mode?.hashCode() ?: 0)
        result = 31 * result + (parameters?.hashCode() ?: 0)
        result = 31 * result + (tags?.hashCode() ?: 0)
        result = 31 * result + (targetLocations?.hashCode() ?: 0)
        result = 31 * result + (targetLocationsUrl?.hashCode() ?: 0)
        result = 31 * result + (targetMaps?.hashCode() ?: 0)
        result = 31 * result + (targetParameterName?.hashCode() ?: 0)
        result = 31 * result + (targets?.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 StartAutomationExecutionRequest

        if (alarmConfiguration != other.alarmConfiguration) return false
        if (clientToken != other.clientToken) return false
        if (documentName != other.documentName) return false
        if (documentVersion != other.documentVersion) return false
        if (maxConcurrency != other.maxConcurrency) return false
        if (maxErrors != other.maxErrors) return false
        if (mode != other.mode) return false
        if (parameters != other.parameters) return false
        if (tags != other.tags) return false
        if (targetLocations != other.targetLocations) return false
        if (targetLocationsUrl != other.targetLocationsUrl) return false
        if (targetMaps != other.targetMaps) return false
        if (targetParameterName != other.targetParameterName) return false
        if (targets != other.targets) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The CloudWatch alarm you want to apply to your automation.
         */
        public var alarmConfiguration: aws.sdk.kotlin.services.ssm.model.AlarmConfiguration? = null
        /**
         * User-provided idempotency token. The token must be unique, is case insensitive, enforces the UUID format, and can't be reused.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The name of the SSM document to run. This can be a public document or a custom document. To run a shared document belonging to another account, specify the document ARN. For more information about how to use shared documents, see [Sharing SSM documents](https://docs.aws.amazon.com/systems-manager/latest/userguide/documents-ssm-sharing.html) in the *Amazon Web Services Systems Manager User Guide*.
         */
        public var documentName: kotlin.String? = null
        /**
         * The version of the Automation runbook to use for this execution.
         */
        public var documentVersion: kotlin.String? = null
        /**
         * The maximum number of targets allowed to run this task in parallel. You can specify a number, such as 10, or a percentage, such as 10%. The default value is `10`.
         *
         * If both this parameter and the `TargetLocation:TargetsMaxConcurrency` are supplied, `TargetLocation:TargetsMaxConcurrency` takes precedence.
         */
        public var maxConcurrency: kotlin.String? = null
        /**
         * The number of errors that are allowed before the system stops running the automation on additional targets. You can specify either an absolute number of errors, for example 10, or a percentage of the target set, for example 10%. If you specify 3, for example, the system stops running the automation when the fourth error is received. If you specify 0, then the system stops running the automation on additional targets after the first error result is returned. If you run an automation on 50 resources and set max-errors to 10%, then the system stops running the automation on additional targets when the sixth error is received.
         *
         * Executions that are already running an automation when max-errors is reached are allowed to complete, but some of these executions may fail as well. If you need to ensure that there won't be more than max-errors failed executions, set max-concurrency to 1 so the executions proceed one at a time.
         *
         * If this parameter and the `TargetLocation:TargetsMaxErrors` parameter are both supplied, `TargetLocation:TargetsMaxErrors` takes precedence.
         */
        public var maxErrors: kotlin.String? = null
        /**
         * The execution mode of the automation. Valid modes include the following: Auto and Interactive. The default mode is Auto.
         */
        public var mode: aws.sdk.kotlin.services.ssm.model.ExecutionMode? = null
        /**
         * A key-value map of execution parameters, which match the declared parameters in the Automation runbook.
         */
        public var parameters: Map>? = null
        /**
         * Optional metadata that you assign to a resource. You can specify a maximum of five tags for an automation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an automation to identify an environment or operating system. In this case, you could specify the following key-value pairs:
         * + `Key=environment,Value=test`
         * + `Key=OS,Value=Windows`
         *
         * To add tags to an existing automation, use the AddTagsToResource operation.
         */
        public var tags: List? = null
        /**
         * A location is a combination of Amazon Web Services Regions and/or Amazon Web Services accounts where you want to run the automation. Use this operation to start an automation in multiple Amazon Web Services Regions and multiple Amazon Web Services accounts. For more information, see [Running automations in multiple Amazon Web Services Regions and accounts](https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation-multiple-accounts-and-regions.html) in the *Amazon Web Services Systems Manager User Guide*.
         */
        public var targetLocations: List? = null
        /**
         * Specify a publicly accessible URL for a file that contains the `TargetLocations` body. Currently, only files in presigned Amazon S3 buckets are supported.
         */
        public var targetLocationsUrl: kotlin.String? = null
        /**
         * A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.
         */
        public var targetMaps: List>>? = null
        /**
         * The name of the parameter used as the target resource for the rate-controlled execution. Required if you specify targets.
         */
        public var targetParameterName: kotlin.String? = null
        /**
         * A key-value mapping to target resources. Required if you specify TargetParameterName.
         *
         * If both this parameter and the `TargetLocation:Targets` parameter are supplied, `TargetLocation:Targets` takes precedence.
         */
        public var targets: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssm.model.StartAutomationExecutionRequest) : this() {
            this.alarmConfiguration = x.alarmConfiguration
            this.clientToken = x.clientToken
            this.documentName = x.documentName
            this.documentVersion = x.documentVersion
            this.maxConcurrency = x.maxConcurrency
            this.maxErrors = x.maxErrors
            this.mode = x.mode
            this.parameters = x.parameters
            this.tags = x.tags
            this.targetLocations = x.targetLocations
            this.targetLocationsUrl = x.targetLocationsUrl
            this.targetMaps = x.targetMaps
            this.targetParameterName = x.targetParameterName
            this.targets = x.targets
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.ssm.model.AlarmConfiguration] inside the given [block]
         */
        public fun alarmConfiguration(block: aws.sdk.kotlin.services.ssm.model.AlarmConfiguration.Builder.() -> kotlin.Unit) {
            this.alarmConfiguration = aws.sdk.kotlin.services.ssm.model.AlarmConfiguration.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy