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

commonMain.aws.sdk.kotlin.services.fis.model.CreateExperimentTemplateTargetInput.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.fis.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Specifies a target for an experiment. You must specify at least one Amazon Resource Name (ARN) or at least one resource tag. You cannot specify both ARNs and tags.
 *
 * For more information, see [Targets](https://docs.aws.amazon.com/fis/latest/userguide/targets.html) in the *Fault Injection Service User Guide*.
 */
public class CreateExperimentTemplateTargetInput private constructor(builder: Builder) {
    /**
     * The filters to apply to identify target resources using specific attributes.
     */
    public val filters: List? = builder.filters
    /**
     * The resource type parameters.
     */
    public val parameters: Map? = builder.parameters
    /**
     * The Amazon Resource Names (ARNs) of the resources.
     */
    public val resourceArns: List? = builder.resourceArns
    /**
     * The tags for the target resources.
     */
    public val resourceTags: Map? = builder.resourceTags
    /**
     * The resource type. The resource type must be supported for the specified action.
     */
    public val resourceType: kotlin.String = requireNotNull(builder.resourceType) { "A non-null value must be provided for resourceType" }
    /**
     * Scopes the identified resources to a specific count of the resources at random, or a percentage of the resources. All identified resources are included in the target.
     * + ALL - Run the action on all identified targets. This is the default.
     * + COUNT(n) - Run the action on the specified number of targets, chosen from the identified targets at random. For example, COUNT(1) selects one of the targets.
     * + PERCENT(n) - Run the action on the specified percentage of targets, chosen from the identified targets at random. For example, PERCENT(25) selects 25% of the targets.
     */
    public val selectionMode: kotlin.String = requireNotNull(builder.selectionMode) { "A non-null value must be provided for selectionMode" }

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

    override fun toString(): kotlin.String = buildString {
        append("CreateExperimentTemplateTargetInput(")
        append("filters=$filters,")
        append("parameters=$parameters,")
        append("resourceArns=$resourceArns,")
        append("resourceTags=$resourceTags,")
        append("resourceType=$resourceType,")
        append("selectionMode=$selectionMode")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = filters?.hashCode() ?: 0
        result = 31 * result + (parameters?.hashCode() ?: 0)
        result = 31 * result + (resourceArns?.hashCode() ?: 0)
        result = 31 * result + (resourceTags?.hashCode() ?: 0)
        result = 31 * result + (resourceType.hashCode())
        result = 31 * result + (selectionMode.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 CreateExperimentTemplateTargetInput

        if (filters != other.filters) return false
        if (parameters != other.parameters) return false
        if (resourceArns != other.resourceArns) return false
        if (resourceTags != other.resourceTags) return false
        if (resourceType != other.resourceType) return false
        if (selectionMode != other.selectionMode) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The filters to apply to identify target resources using specific attributes.
         */
        public var filters: List? = null
        /**
         * The resource type parameters.
         */
        public var parameters: Map? = null
        /**
         * The Amazon Resource Names (ARNs) of the resources.
         */
        public var resourceArns: List? = null
        /**
         * The tags for the target resources.
         */
        public var resourceTags: Map? = null
        /**
         * The resource type. The resource type must be supported for the specified action.
         */
        public var resourceType: kotlin.String? = null
        /**
         * Scopes the identified resources to a specific count of the resources at random, or a percentage of the resources. All identified resources are included in the target.
         * + ALL - Run the action on all identified targets. This is the default.
         * + COUNT(n) - Run the action on the specified number of targets, chosen from the identified targets at random. For example, COUNT(1) selects one of the targets.
         * + PERCENT(n) - Run the action on the specified percentage of targets, chosen from the identified targets at random. For example, PERCENT(25) selects 25% of the targets.
         */
        public var selectionMode: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.fis.model.CreateExperimentTemplateTargetInput) : this() {
            this.filters = x.filters
            this.parameters = x.parameters
            this.resourceArns = x.resourceArns
            this.resourceTags = x.resourceTags
            this.resourceType = x.resourceType
            this.selectionMode = x.selectionMode
        }

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

        internal fun correctErrors(): Builder {
            if (resourceType == null) resourceType = ""
            if (selectionMode == null) selectionMode = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy