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

commonMain.aws.sdk.kotlin.services.autoscalingplans.model.PredefinedScalingMetricSpecification.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.autoscalingplans.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Represents a predefined metric that can be used for dynamic scaling as part of a target tracking scaling policy.
 */
public class PredefinedScalingMetricSpecification private constructor(builder: Builder) {
    /**
     * The metric type. The `ALBRequestCountPerTarget` metric type applies only to Auto Scaling groups, Spot Fleet requests, and ECS services.
     */
    public val predefinedScalingMetricType: aws.sdk.kotlin.services.autoscalingplans.model.ScalingMetricType = requireNotNull(builder.predefinedScalingMetricType) { "A non-null value must be provided for predefinedScalingMetricType" }
    /**
     * Identifies the resource associated with the metric type. You can't specify a resource label unless the metric type is `ALBRequestCountPerTarget` and there is a target group for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, or ECS service.
     *
     * You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format is app///targetgroup//, where:
     * + app// is the final portion of the load balancer ARN
     * + targetgroup// is the final portion of the target group ARN.
     *
     * This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.
     *
     * To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation.
     */
    public val resourceLabel: kotlin.String? = builder.resourceLabel

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

    override fun toString(): kotlin.String = buildString {
        append("PredefinedScalingMetricSpecification(")
        append("predefinedScalingMetricType=$predefinedScalingMetricType,")
        append("resourceLabel=$resourceLabel")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = predefinedScalingMetricType.hashCode()
        result = 31 * result + (resourceLabel?.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 PredefinedScalingMetricSpecification

        if (predefinedScalingMetricType != other.predefinedScalingMetricType) return false
        if (resourceLabel != other.resourceLabel) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The metric type. The `ALBRequestCountPerTarget` metric type applies only to Auto Scaling groups, Spot Fleet requests, and ECS services.
         */
        public var predefinedScalingMetricType: aws.sdk.kotlin.services.autoscalingplans.model.ScalingMetricType? = null
        /**
         * Identifies the resource associated with the metric type. You can't specify a resource label unless the metric type is `ALBRequestCountPerTarget` and there is a target group for an Application Load Balancer attached to the Auto Scaling group, Spot Fleet request, or ECS service.
         *
         * You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format is app///targetgroup//, where:
         * + app// is the final portion of the load balancer ARN
         * + targetgroup// is the final portion of the target group ARN.
         *
         * This is an example: app/EC2Co-EcsEl-1TKLTMITMM0EO/f37c06a68c1748aa/targetgroup/EC2Co-Defau-LDNM7Q3ZH1ZN/6d4ea56ca2d6a18d.
         *
         * To find the ARN for an Application Load Balancer, use the [DescribeLoadBalancers](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeLoadBalancers.html) API operation. To find the ARN for the target group, use the [DescribeTargetGroups](https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_DescribeTargetGroups.html) API operation.
         */
        public var resourceLabel: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.autoscalingplans.model.PredefinedScalingMetricSpecification) : this() {
            this.predefinedScalingMetricType = x.predefinedScalingMetricType
            this.resourceLabel = x.resourceLabel
        }

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

        internal fun correctErrors(): Builder {
            if (predefinedScalingMetricType == null) predefinedScalingMetricType = ScalingMetricType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy