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

commonMain.aws.sdk.kotlin.services.ssm.model.Association.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
import aws.smithy.kotlin.runtime.time.Instant

/**
 * Describes an association of a Amazon Web Services Systems Manager document (SSM document) and a managed node.
 */
public class Association private constructor(builder: Builder) {
    /**
     * The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.
     */
    public val associationId: kotlin.String? = builder.associationId
    /**
     * The association name.
     */
    public val associationName: kotlin.String? = builder.associationName
    /**
     * The association version.
     */
    public val associationVersion: kotlin.String? = builder.associationVersion
    /**
     * The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the `apply-only-at-cron-interval` parameter.
     *
     * State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the `default` version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to `default`.
     */
    public val documentVersion: kotlin.String? = builder.documentVersion
    /**
     * The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.
     */
    public val duration: kotlin.Int? = builder.duration
    /**
     * The managed node ID.
     */
    public val instanceId: kotlin.String? = builder.instanceId
    /**
     * The date on which the association was last run.
     */
    public val lastExecutionDate: aws.smithy.kotlin.runtime.time.Instant? = builder.lastExecutionDate
    /**
     * The name of the SSM document.
     */
    public val name: kotlin.String? = builder.name
    /**
     * Information about the association.
     */
    public val overview: aws.sdk.kotlin.services.ssm.model.AssociationOverview? = builder.overview
    /**
     * A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).
     */
    public val scheduleExpression: kotlin.String? = builder.scheduleExpression
    /**
     * Number of days to wait after the scheduled day to run an association.
     */
    public val scheduleOffset: kotlin.Int? = builder.scheduleOffset
    /**
     * 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 managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the `InstanceIds` key with a value of `*`.
     */
    public val targets: List? = builder.targets

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

    override fun toString(): kotlin.String = buildString {
        append("Association(")
        append("associationId=$associationId,")
        append("associationName=$associationName,")
        append("associationVersion=$associationVersion,")
        append("documentVersion=$documentVersion,")
        append("duration=$duration,")
        append("instanceId=$instanceId,")
        append("lastExecutionDate=$lastExecutionDate,")
        append("name=$name,")
        append("overview=$overview,")
        append("scheduleExpression=$scheduleExpression,")
        append("scheduleOffset=$scheduleOffset,")
        append("targetMaps=$targetMaps,")
        append("targets=$targets")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = associationId?.hashCode() ?: 0
        result = 31 * result + (associationName?.hashCode() ?: 0)
        result = 31 * result + (associationVersion?.hashCode() ?: 0)
        result = 31 * result + (documentVersion?.hashCode() ?: 0)
        result = 31 * result + (duration ?: 0)
        result = 31 * result + (instanceId?.hashCode() ?: 0)
        result = 31 * result + (lastExecutionDate?.hashCode() ?: 0)
        result = 31 * result + (name?.hashCode() ?: 0)
        result = 31 * result + (overview?.hashCode() ?: 0)
        result = 31 * result + (scheduleExpression?.hashCode() ?: 0)
        result = 31 * result + (scheduleOffset ?: 0)
        result = 31 * result + (targetMaps?.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 Association

        if (associationId != other.associationId) return false
        if (associationName != other.associationName) return false
        if (associationVersion != other.associationVersion) return false
        if (documentVersion != other.documentVersion) return false
        if (duration != other.duration) return false
        if (instanceId != other.instanceId) return false
        if (lastExecutionDate != other.lastExecutionDate) return false
        if (name != other.name) return false
        if (overview != other.overview) return false
        if (scheduleExpression != other.scheduleExpression) return false
        if (scheduleOffset != other.scheduleOffset) return false
        if (targetMaps != other.targetMaps) return false
        if (targets != other.targets) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.
         */
        public var associationId: kotlin.String? = null
        /**
         * The association name.
         */
        public var associationName: kotlin.String? = null
        /**
         * The association version.
         */
        public var associationVersion: kotlin.String? = null
        /**
         * The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the `apply-only-at-cron-interval` parameter.
         *
         * State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the `default` version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to `default`.
         */
        public var documentVersion: kotlin.String? = null
        /**
         * The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.
         */
        public var duration: kotlin.Int? = null
        /**
         * The managed node ID.
         */
        public var instanceId: kotlin.String? = null
        /**
         * The date on which the association was last run.
         */
        public var lastExecutionDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The name of the SSM document.
         */
        public var name: kotlin.String? = null
        /**
         * Information about the association.
         */
        public var overview: aws.sdk.kotlin.services.ssm.model.AssociationOverview? = null
        /**
         * A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).
         */
        public var scheduleExpression: kotlin.String? = null
        /**
         * Number of days to wait after the scheduled day to run an association.
         */
        public var scheduleOffset: kotlin.Int? = 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 managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the `InstanceIds` key with a value of `*`.
         */
        public var targets: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssm.model.Association) : this() {
            this.associationId = x.associationId
            this.associationName = x.associationName
            this.associationVersion = x.associationVersion
            this.documentVersion = x.documentVersion
            this.duration = x.duration
            this.instanceId = x.instanceId
            this.lastExecutionDate = x.lastExecutionDate
            this.name = x.name
            this.overview = x.overview
            this.scheduleExpression = x.scheduleExpression
            this.scheduleOffset = x.scheduleOffset
            this.targetMaps = x.targetMaps
            this.targets = x.targets
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy