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

commonMain.aws.sdk.kotlin.services.ssmincidents.model.PagerDutyConfiguration.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ssmincidents.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Details about the PagerDuty configuration for a response plan.
 */
public class PagerDutyConfiguration private constructor(builder: Builder) {
    /**
     * The name of the PagerDuty configuration.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * Details about the PagerDuty service associated with the configuration.
     */
    public val pagerDutyIncidentConfiguration: aws.sdk.kotlin.services.ssmincidents.model.PagerDutyIncidentConfiguration? = builder.pagerDutyIncidentConfiguration
    /**
     * The ID of the Amazon Web Services Secrets Manager secret that stores your PagerDuty key, either a General Access REST API Key or User Token REST API Key, and other user credentials.
     */
    public val secretId: kotlin.String = requireNotNull(builder.secretId) { "A non-null value must be provided for secretId" }

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

    override fun toString(): kotlin.String = buildString {
        append("PagerDutyConfiguration(")
        append("name=$name,")
        append("pagerDutyIncidentConfiguration=$pagerDutyIncidentConfiguration,")
        append("secretId=$secretId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = name.hashCode()
        result = 31 * result + (pagerDutyIncidentConfiguration?.hashCode() ?: 0)
        result = 31 * result + (secretId.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 PagerDutyConfiguration

        if (name != other.name) return false
        if (pagerDutyIncidentConfiguration != other.pagerDutyIncidentConfiguration) return false
        if (secretId != other.secretId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The name of the PagerDuty configuration.
         */
        public var name: kotlin.String? = null
        /**
         * Details about the PagerDuty service associated with the configuration.
         */
        public var pagerDutyIncidentConfiguration: aws.sdk.kotlin.services.ssmincidents.model.PagerDutyIncidentConfiguration? = null
        /**
         * The ID of the Amazon Web Services Secrets Manager secret that stores your PagerDuty key, either a General Access REST API Key or User Token REST API Key, and other user credentials.
         */
        public var secretId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.PagerDutyConfiguration) : this() {
            this.name = x.name
            this.pagerDutyIncidentConfiguration = x.pagerDutyIncidentConfiguration
            this.secretId = x.secretId
        }

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

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            if (secretId == null) secretId = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy