commonMain.aws.sdk.kotlin.services.route53.model.TrafficPolicyInstance.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of route53-jvm Show documentation
Show all versions of route53-jvm Show documentation
The AWS SDK for Kotlin client for Route 53
// 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 settings for the new traffic policy instance.
*/
public class TrafficPolicyInstance private constructor(builder: Builder) {
/**
* The ID of the hosted zone that Amazon Route 53 created resource record sets in.
*/
public val hostedZoneId: kotlin.String = requireNotNull(builder.hostedZoneId) { "A non-null value must be provided for hostedZoneId" }
/**
* The ID that Amazon Route 53 assigned to the new traffic policy instance.
*/
public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }
/**
* If `State` is `Failed`, an explanation of the reason for the failure. If `State` is another value, `Message` is empty.
*/
public val message: kotlin.String = requireNotNull(builder.message) { "A non-null value must be provided for message" }
/**
* The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record sets that are associated with this traffic policy instance.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The value of `State` is one of the following values:
*
* ## Applied
* Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge locations.
*
* ## Creating
* Route 53 is creating the resource record sets. Use `GetTrafficPolicyInstance` to confirm that the `CreateTrafficPolicyInstance` request completed successfully.
*
* ## Failed
* Route 53 wasn't able to create or update the resource record sets. When the value of `State` is `Failed`, see `Message` for an explanation of what caused the request to fail.
*/
public val state: kotlin.String = requireNotNull(builder.state) { "A non-null value must be provided for state" }
/**
* The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone.
*/
public val trafficPolicyId: kotlin.String = requireNotNull(builder.trafficPolicyId) { "A non-null value must be provided for trafficPolicyId" }
/**
* The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic policy instance.
*/
public val trafficPolicyType: aws.sdk.kotlin.services.route53.model.RrType = requireNotNull(builder.trafficPolicyType) { "A non-null value must be provided for trafficPolicyType" }
/**
* The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone.
*/
public val trafficPolicyVersion: kotlin.Int = requireNotNull(builder.trafficPolicyVersion) { "A non-null value must be provided for trafficPolicyVersion" }
/**
* The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted zone.
*/
public val ttl: kotlin.Long = requireNotNull(builder.ttl) { "A non-null value must be provided for ttl" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.route53.model.TrafficPolicyInstance = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("TrafficPolicyInstance(")
append("hostedZoneId=$hostedZoneId,")
append("id=$id,")
append("message=$message,")
append("name=$name,")
append("state=$state,")
append("trafficPolicyId=$trafficPolicyId,")
append("trafficPolicyType=$trafficPolicyType,")
append("trafficPolicyVersion=$trafficPolicyVersion,")
append("ttl=$ttl")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = hostedZoneId.hashCode()
result = 31 * result + (id.hashCode())
result = 31 * result + (message.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (state.hashCode())
result = 31 * result + (trafficPolicyId.hashCode())
result = 31 * result + (trafficPolicyType.hashCode())
result = 31 * result + (trafficPolicyVersion)
result = 31 * result + (ttl.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 TrafficPolicyInstance
if (hostedZoneId != other.hostedZoneId) return false
if (id != other.id) return false
if (message != other.message) return false
if (name != other.name) return false
if (state != other.state) return false
if (trafficPolicyId != other.trafficPolicyId) return false
if (trafficPolicyType != other.trafficPolicyType) return false
if (trafficPolicyVersion != other.trafficPolicyVersion) return false
if (ttl != other.ttl) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.route53.model.TrafficPolicyInstance = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The ID of the hosted zone that Amazon Route 53 created resource record sets in.
*/
public var hostedZoneId: kotlin.String? = null
/**
* The ID that Amazon Route 53 assigned to the new traffic policy instance.
*/
public var id: kotlin.String? = null
/**
* If `State` is `Failed`, an explanation of the reason for the failure. If `State` is another value, `Message` is empty.
*/
public var message: kotlin.String? = null
/**
* The DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record sets that are associated with this traffic policy instance.
*/
public var name: kotlin.String? = null
/**
* The value of `State` is one of the following values:
*
* ## Applied
* Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge locations.
*
* ## Creating
* Route 53 is creating the resource record sets. Use `GetTrafficPolicyInstance` to confirm that the `CreateTrafficPolicyInstance` request completed successfully.
*
* ## Failed
* Route 53 wasn't able to create or update the resource record sets. When the value of `State` is `Failed`, see `Message` for an explanation of what caused the request to fail.
*/
public var state: kotlin.String? = null
/**
* The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone.
*/
public var trafficPolicyId: kotlin.String? = null
/**
* The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic policy instance.
*/
public var trafficPolicyType: aws.sdk.kotlin.services.route53.model.RrType? = null
/**
* The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone.
*/
public var trafficPolicyVersion: kotlin.Int? = null
/**
* The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted zone.
*/
public var ttl: kotlin.Long? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.route53.model.TrafficPolicyInstance) : this() {
this.hostedZoneId = x.hostedZoneId
this.id = x.id
this.message = x.message
this.name = x.name
this.state = x.state
this.trafficPolicyId = x.trafficPolicyId
this.trafficPolicyType = x.trafficPolicyType
this.trafficPolicyVersion = x.trafficPolicyVersion
this.ttl = x.ttl
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.route53.model.TrafficPolicyInstance = TrafficPolicyInstance(this)
internal fun correctErrors(): Builder {
if (hostedZoneId == null) hostedZoneId = ""
if (id == null) id = ""
if (message == null) message = ""
if (name == null) name = ""
if (state == null) state = ""
if (trafficPolicyId == null) trafficPolicyId = ""
if (trafficPolicyType == null) trafficPolicyType = RrType.SdkUnknown("no value provided")
if (trafficPolicyVersion == null) trafficPolicyVersion = 0
if (ttl == null) ttl = 0L
return this
}
}
}