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

commonMain.aws.sdk.kotlin.services.pipes.model.PipeLogConfigurationParameters.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.pipes.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Specifies the logging configuration settings for the pipe.
 *
 * When you call `UpdatePipe`, EventBridge updates the fields in the `PipeLogConfigurationParameters` object atomically as one and overrides existing values. This is by design. If you don't specify an optional field in any of the Amazon Web Services service parameters objects (`CloudwatchLogsLogDestinationParameters`, `FirehoseLogDestinationParameters`, or `S3LogDestinationParameters`), EventBridge sets that field to its system-default value during the update.
 *
 * For example, suppose when you created the pipe you specified a Kinesis Data Firehose stream log destination. You then update the pipe to add an Amazon S3 log destination. In addition to specifying the `S3LogDestinationParameters` for the new log destination, you must also specify the fields in the `FirehoseLogDestinationParameters` object in order to retain the Kinesis Data Firehose stream log destination.
 *
 * For more information on generating pipe log records, see [Log EventBridge Pipes](eventbridge/latest/userguide/eb-pipes-logs.html) in the *Amazon EventBridge User Guide*.
 */
public class PipeLogConfigurationParameters private constructor(builder: Builder) {
    /**
     * The Amazon CloudWatch Logs logging configuration settings for the pipe.
     */
    public val cloudwatchLogsLogDestination: aws.sdk.kotlin.services.pipes.model.CloudwatchLogsLogDestinationParameters? = builder.cloudwatchLogsLogDestination
    /**
     * The Amazon Kinesis Data Firehose logging configuration settings for the pipe.
     */
    public val firehoseLogDestination: aws.sdk.kotlin.services.pipes.model.FirehoseLogDestinationParameters? = builder.firehoseLogDestination
    /**
     * Specify `ON` to include the execution data (specifically, the `payload` and `awsRequest` fields) in the log messages for this pipe.
     *
     * This applies to all log destinations for the pipe.
     *
     * For more information, see [Including execution data in logs](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-execution-data) in the *Amazon EventBridge User Guide*.
     *
     * The default is `OFF`.
     */
    public val includeExecutionData: List? = builder.includeExecutionData
    /**
     * The level of logging detail to include. This applies to all log destinations for the pipe.
     *
     * For more information, see [Specifying EventBridge Pipes log level](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-level) in the *Amazon EventBridge User Guide*.
     */
    public val level: aws.sdk.kotlin.services.pipes.model.LogLevel = requireNotNull(builder.level) { "A non-null value must be provided for level" }
    /**
     * The Amazon S3 logging configuration settings for the pipe.
     */
    public val s3LogDestination: aws.sdk.kotlin.services.pipes.model.S3LogDestinationParameters? = builder.s3LogDestination

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

    override fun toString(): kotlin.String = buildString {
        append("PipeLogConfigurationParameters(")
        append("cloudwatchLogsLogDestination=$cloudwatchLogsLogDestination,")
        append("firehoseLogDestination=$firehoseLogDestination,")
        append("includeExecutionData=$includeExecutionData,")
        append("level=$level,")
        append("s3LogDestination=$s3LogDestination")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = cloudwatchLogsLogDestination?.hashCode() ?: 0
        result = 31 * result + (firehoseLogDestination?.hashCode() ?: 0)
        result = 31 * result + (includeExecutionData?.hashCode() ?: 0)
        result = 31 * result + (level.hashCode())
        result = 31 * result + (s3LogDestination?.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 PipeLogConfigurationParameters

        if (cloudwatchLogsLogDestination != other.cloudwatchLogsLogDestination) return false
        if (firehoseLogDestination != other.firehoseLogDestination) return false
        if (includeExecutionData != other.includeExecutionData) return false
        if (level != other.level) return false
        if (s3LogDestination != other.s3LogDestination) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon CloudWatch Logs logging configuration settings for the pipe.
         */
        public var cloudwatchLogsLogDestination: aws.sdk.kotlin.services.pipes.model.CloudwatchLogsLogDestinationParameters? = null
        /**
         * The Amazon Kinesis Data Firehose logging configuration settings for the pipe.
         */
        public var firehoseLogDestination: aws.sdk.kotlin.services.pipes.model.FirehoseLogDestinationParameters? = null
        /**
         * Specify `ON` to include the execution data (specifically, the `payload` and `awsRequest` fields) in the log messages for this pipe.
         *
         * This applies to all log destinations for the pipe.
         *
         * For more information, see [Including execution data in logs](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-execution-data) in the *Amazon EventBridge User Guide*.
         *
         * The default is `OFF`.
         */
        public var includeExecutionData: List? = null
        /**
         * The level of logging detail to include. This applies to all log destinations for the pipe.
         *
         * For more information, see [Specifying EventBridge Pipes log level](https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-pipes-logs.html#eb-pipes-logs-level) in the *Amazon EventBridge User Guide*.
         */
        public var level: aws.sdk.kotlin.services.pipes.model.LogLevel? = null
        /**
         * The Amazon S3 logging configuration settings for the pipe.
         */
        public var s3LogDestination: aws.sdk.kotlin.services.pipes.model.S3LogDestinationParameters? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.pipes.model.PipeLogConfigurationParameters) : this() {
            this.cloudwatchLogsLogDestination = x.cloudwatchLogsLogDestination
            this.firehoseLogDestination = x.firehoseLogDestination
            this.includeExecutionData = x.includeExecutionData
            this.level = x.level
            this.s3LogDestination = x.s3LogDestination
        }

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

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

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

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

        internal fun correctErrors(): Builder {
            if (level == null) level = LogLevel.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy