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

commonMain.aws.sdk.kotlin.services.configservice.model.SourceDetail.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.configservice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Provides the source and the message types that trigger Config to evaluate your Amazon Web Services resources against a rule. It also provides the frequency with which you want Config to run evaluations for the rule if the trigger type is periodic. You can specify the parameter values for `SourceDetail` only for custom rules.
 */
public class SourceDetail private constructor(builder: Builder) {
    /**
     * The source of the event, such as an Amazon Web Services service, that triggers Config to evaluate your Amazon Web Services resources.
     */
    public val eventSource: aws.sdk.kotlin.services.configservice.model.EventSource? = builder.eventSource
    /**
     * The frequency at which you want Config to run evaluations for a custom rule with a periodic trigger. If you specify a value for `MaximumExecutionFrequency`, then `MessageType` must use the `ScheduledNotification` value.
     *
     * By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the `MaximumExecutionFrequency` parameter.
     *
     * Based on the valid value you choose, Config runs evaluations once for each valid value. For example, if you choose `Three_Hours`, Config runs evaluations once every three hours. In this case, `Three_Hours` is the frequency of this rule.
     */
    public val maximumExecutionFrequency: aws.sdk.kotlin.services.configservice.model.MaximumExecutionFrequency? = builder.maximumExecutionFrequency
    /**
     * The type of notification that triggers Config to run an evaluation for a rule. You can specify the following notification types:
     * + `ConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers a configuration item as a result of a resource change.
     * + `OversizedConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers an oversized configuration item. Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
     * + `ScheduledNotification` - Triggers a periodic evaluation at the frequency specified for `MaximumExecutionFrequency`.
     * + `ConfigurationSnapshotDeliveryCompleted` - Triggers a periodic evaluation when Config delivers a configuration snapshot.
     *
     * If you want your custom rule to be triggered by configuration changes, specify two SourceDetail objects, one for `ConfigurationItemChangeNotification` and one for `OversizedConfigurationItemChangeNotification`.
     */
    public val messageType: aws.sdk.kotlin.services.configservice.model.MessageType? = builder.messageType

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

    override fun toString(): kotlin.String = buildString {
        append("SourceDetail(")
        append("eventSource=$eventSource,")
        append("maximumExecutionFrequency=$maximumExecutionFrequency,")
        append("messageType=$messageType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = eventSource?.hashCode() ?: 0
        result = 31 * result + (maximumExecutionFrequency?.hashCode() ?: 0)
        result = 31 * result + (messageType?.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 SourceDetail

        if (eventSource != other.eventSource) return false
        if (maximumExecutionFrequency != other.maximumExecutionFrequency) return false
        if (messageType != other.messageType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The source of the event, such as an Amazon Web Services service, that triggers Config to evaluate your Amazon Web Services resources.
         */
        public var eventSource: aws.sdk.kotlin.services.configservice.model.EventSource? = null
        /**
         * The frequency at which you want Config to run evaluations for a custom rule with a periodic trigger. If you specify a value for `MaximumExecutionFrequency`, then `MessageType` must use the `ScheduledNotification` value.
         *
         * By default, rules with a periodic trigger are evaluated every 24 hours. To change the frequency, specify a valid value for the `MaximumExecutionFrequency` parameter.
         *
         * Based on the valid value you choose, Config runs evaluations once for each valid value. For example, if you choose `Three_Hours`, Config runs evaluations once every three hours. In this case, `Three_Hours` is the frequency of this rule.
         */
        public var maximumExecutionFrequency: aws.sdk.kotlin.services.configservice.model.MaximumExecutionFrequency? = null
        /**
         * The type of notification that triggers Config to run an evaluation for a rule. You can specify the following notification types:
         * + `ConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers a configuration item as a result of a resource change.
         * + `OversizedConfigurationItemChangeNotification` - Triggers an evaluation when Config delivers an oversized configuration item. Config may generate this notification type when a resource changes and the notification exceeds the maximum size allowed by Amazon SNS.
         * + `ScheduledNotification` - Triggers a periodic evaluation at the frequency specified for `MaximumExecutionFrequency`.
         * + `ConfigurationSnapshotDeliveryCompleted` - Triggers a periodic evaluation when Config delivers a configuration snapshot.
         *
         * If you want your custom rule to be triggered by configuration changes, specify two SourceDetail objects, one for `ConfigurationItemChangeNotification` and one for `OversizedConfigurationItemChangeNotification`.
         */
        public var messageType: aws.sdk.kotlin.services.configservice.model.MessageType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.configservice.model.SourceDetail) : this() {
            this.eventSource = x.eventSource
            this.maximumExecutionFrequency = x.maximumExecutionFrequency
            this.messageType = x.messageType
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy