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

commonMain.aws.sdk.kotlin.services.route53.model.HealthCheck.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.route53.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A complex type that contains information about one health check that is associated with the current Amazon Web Services account.
 */
public class HealthCheck private constructor(builder: Builder) {
    /**
     * A unique string that you specified when you created the health check.
     */
    public val callerReference: kotlin.String = requireNotNull(builder.callerReference) { "A non-null value must be provided for callerReference" }
    /**
     * A complex type that contains information about the CloudWatch alarm that Amazon Route 53 is monitoring for this health check.
     */
    public val cloudWatchAlarmConfiguration: aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration? = builder.cloudWatchAlarmConfiguration
    /**
     * A complex type that contains detailed information about one health check.
     */
    public val healthCheckConfig: aws.sdk.kotlin.services.route53.model.HealthCheckConfig? = builder.healthCheckConfig
    /**
     * The version of the health check. You can optionally pass this value in a call to `UpdateHealthCheck` to prevent overwriting another change to the health check.
     */
    public val healthCheckVersion: kotlin.Long = requireNotNull(builder.healthCheckVersion) { "A non-null value must be provided for healthCheckVersion" }
    /**
     * The identifier that Amazon Route 53 assigned to the health check when you created it. When you add or update a resource record set, you use this value to specify which health check to use. The value can be up to 64 characters long.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
    /**
     * If the health check was created by another service, the service that created the health check. When a health check is created by another service, you can't edit or delete it using Amazon Route 53.
     */
    public val linkedService: aws.sdk.kotlin.services.route53.model.LinkedService? = builder.linkedService

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

    override fun toString(): kotlin.String = buildString {
        append("HealthCheck(")
        append("callerReference=$callerReference,")
        append("cloudWatchAlarmConfiguration=$cloudWatchAlarmConfiguration,")
        append("healthCheckConfig=$healthCheckConfig,")
        append("healthCheckVersion=$healthCheckVersion,")
        append("id=$id,")
        append("linkedService=$linkedService")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = callerReference.hashCode()
        result = 31 * result + (cloudWatchAlarmConfiguration?.hashCode() ?: 0)
        result = 31 * result + (healthCheckConfig?.hashCode() ?: 0)
        result = 31 * result + (healthCheckVersion.hashCode())
        result = 31 * result + (id.hashCode())
        result = 31 * result + (linkedService?.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 HealthCheck

        if (callerReference != other.callerReference) return false
        if (cloudWatchAlarmConfiguration != other.cloudWatchAlarmConfiguration) return false
        if (healthCheckConfig != other.healthCheckConfig) return false
        if (healthCheckVersion != other.healthCheckVersion) return false
        if (id != other.id) return false
        if (linkedService != other.linkedService) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A unique string that you specified when you created the health check.
         */
        public var callerReference: kotlin.String? = null
        /**
         * A complex type that contains information about the CloudWatch alarm that Amazon Route 53 is monitoring for this health check.
         */
        public var cloudWatchAlarmConfiguration: aws.sdk.kotlin.services.route53.model.CloudWatchAlarmConfiguration? = null
        /**
         * A complex type that contains detailed information about one health check.
         */
        public var healthCheckConfig: aws.sdk.kotlin.services.route53.model.HealthCheckConfig? = null
        /**
         * The version of the health check. You can optionally pass this value in a call to `UpdateHealthCheck` to prevent overwriting another change to the health check.
         */
        public var healthCheckVersion: kotlin.Long? = null
        /**
         * The identifier that Amazon Route 53 assigned to the health check when you created it. When you add or update a resource record set, you use this value to specify which health check to use. The value can be up to 64 characters long.
         */
        public var id: kotlin.String? = null
        /**
         * If the health check was created by another service, the service that created the health check. When a health check is created by another service, you can't edit or delete it using Amazon Route 53.
         */
        public var linkedService: aws.sdk.kotlin.services.route53.model.LinkedService? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.route53.model.HealthCheck) : this() {
            this.callerReference = x.callerReference
            this.cloudWatchAlarmConfiguration = x.cloudWatchAlarmConfiguration
            this.healthCheckConfig = x.healthCheckConfig
            this.healthCheckVersion = x.healthCheckVersion
            this.id = x.id
            this.linkedService = x.linkedService
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            if (callerReference == null) callerReference = ""
            if (healthCheckVersion == null) healthCheckVersion = 0L
            if (id == null) id = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy