
commonMain.aws.sdk.kotlin.services.ssmcontacts.model.Contact.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.ssmcontacts.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A personal contact or escalation plan that Incident Manager engages during an incident.
*/
public class Contact private constructor(builder: Builder) {
/**
* The unique and identifiable alias of the contact or escalation plan.
*/
public val alias: kotlin.String = requireNotNull(builder.alias) { "A non-null value must be provided for alias" }
/**
* The Amazon Resource Name (ARN) of the contact or escalation plan.
*/
public val contactArn: kotlin.String = requireNotNull(builder.contactArn) { "A non-null value must be provided for contactArn" }
/**
* The full name of the contact or escalation plan.
*/
public val displayName: kotlin.String? = builder.displayName
/**
* Refers to the type of contact. A single contact is type `PERSONAL` and an escalation plan is type `ESCALATION`.
*/
public val type: aws.sdk.kotlin.services.ssmcontacts.model.ContactType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ssmcontacts.model.Contact = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("Contact(")
append("alias=$alias,")
append("contactArn=$contactArn,")
append("displayName=$displayName,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = alias.hashCode()
result = 31 * result + (contactArn.hashCode())
result = 31 * result + (displayName?.hashCode() ?: 0)
result = 31 * result + (type.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 Contact
if (alias != other.alias) return false
if (contactArn != other.contactArn) return false
if (displayName != other.displayName) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ssmcontacts.model.Contact = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The unique and identifiable alias of the contact or escalation plan.
*/
public var alias: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the contact or escalation plan.
*/
public var contactArn: kotlin.String? = null
/**
* The full name of the contact or escalation plan.
*/
public var displayName: kotlin.String? = null
/**
* Refers to the type of contact. A single contact is type `PERSONAL` and an escalation plan is type `ESCALATION`.
*/
public var type: aws.sdk.kotlin.services.ssmcontacts.model.ContactType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.ssmcontacts.model.Contact) : this() {
this.alias = x.alias
this.contactArn = x.contactArn
this.displayName = x.displayName
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.ssmcontacts.model.Contact = Contact(this)
internal fun correctErrors(): Builder {
if (alias == null) alias = ""
if (contactArn == null) contactArn = ""
if (type == null) type = ContactType.SdkUnknown("no value provided")
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy