
commonMain.aws.sdk.kotlin.services.ssmcontacts.model.ContactChannel.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
/**
* The method that Incident Manager uses to engage a contact.
*/
public class ContactChannel private constructor(builder: Builder) {
/**
* A Boolean value describing if the contact channel has been activated or not. If the contact channel isn't activated, Incident Manager can't engage the contact through it.
*/
public val activationStatus: aws.sdk.kotlin.services.ssmcontacts.model.ActivationStatus = requireNotNull(builder.activationStatus) { "A non-null value must be provided for activationStatus" }
/**
* The ARN of the contact that contains the contact channel.
*/
public val contactArn: kotlin.String = requireNotNull(builder.contactArn) { "A non-null value must be provided for contactArn" }
/**
* The Amazon Resource Name (ARN) of the contact channel.
*/
public val contactChannelArn: kotlin.String = requireNotNull(builder.contactChannelArn) { "A non-null value must be provided for contactChannelArn" }
/**
* The details that Incident Manager uses when trying to engage the contact channel.
*/
public val deliveryAddress: aws.sdk.kotlin.services.ssmcontacts.model.ContactChannelAddress? = builder.deliveryAddress
/**
* The name of the contact channel.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* The type of the contact channel. Incident Manager supports three contact methods:
* + SMS
* + VOICE
* + EMAIL
*/
public val type: aws.sdk.kotlin.services.ssmcontacts.model.ChannelType? = builder.type
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.ssmcontacts.model.ContactChannel = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("ContactChannel(")
append("activationStatus=$activationStatus,")
append("contactArn=$contactArn,")
append("contactChannelArn=$contactChannelArn,")
append("deliveryAddress=$deliveryAddress,")
append("name=$name,")
append("type=$type")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = activationStatus.hashCode()
result = 31 * result + (contactArn.hashCode())
result = 31 * result + (contactChannelArn.hashCode())
result = 31 * result + (deliveryAddress?.hashCode() ?: 0)
result = 31 * result + (name.hashCode())
result = 31 * result + (type?.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 ContactChannel
if (activationStatus != other.activationStatus) return false
if (contactArn != other.contactArn) return false
if (contactChannelArn != other.contactChannelArn) return false
if (deliveryAddress != other.deliveryAddress) return false
if (name != other.name) return false
if (type != other.type) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.ssmcontacts.model.ContactChannel = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A Boolean value describing if the contact channel has been activated or not. If the contact channel isn't activated, Incident Manager can't engage the contact through it.
*/
public var activationStatus: aws.sdk.kotlin.services.ssmcontacts.model.ActivationStatus? = null
/**
* The ARN of the contact that contains the contact channel.
*/
public var contactArn: kotlin.String? = null
/**
* The Amazon Resource Name (ARN) of the contact channel.
*/
public var contactChannelArn: kotlin.String? = null
/**
* The details that Incident Manager uses when trying to engage the contact channel.
*/
public var deliveryAddress: aws.sdk.kotlin.services.ssmcontacts.model.ContactChannelAddress? = null
/**
* The name of the contact channel.
*/
public var name: kotlin.String? = null
/**
* The type of the contact channel. Incident Manager supports three contact methods:
* + SMS
* + VOICE
* + EMAIL
*/
public var type: aws.sdk.kotlin.services.ssmcontacts.model.ChannelType? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.ssmcontacts.model.ContactChannel) : this() {
this.activationStatus = x.activationStatus
this.contactArn = x.contactArn
this.contactChannelArn = x.contactChannelArn
this.deliveryAddress = x.deliveryAddress
this.name = x.name
this.type = x.type
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.ssmcontacts.model.ContactChannel = ContactChannel(this)
/**
* construct an [aws.sdk.kotlin.services.ssmcontacts.model.ContactChannelAddress] inside the given [block]
*/
public fun deliveryAddress(block: aws.sdk.kotlin.services.ssmcontacts.model.ContactChannelAddress.Builder.() -> kotlin.Unit) {
this.deliveryAddress = aws.sdk.kotlin.services.ssmcontacts.model.ContactChannelAddress.invoke(block)
}
internal fun correctErrors(): Builder {
if (activationStatus == null) activationStatus = ActivationStatus.SdkUnknown("no value provided")
if (contactArn == null) contactArn = ""
if (contactChannelArn == null) contactChannelArn = ""
if (name == null) name = ""
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy