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

commonMain.aws.sdk.kotlin.services.cloudtraildata.model.AuditEvent.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudtraildata.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An event from a source outside of Amazon Web Services that you want CloudTrail to log.
 */
public class AuditEvent private constructor(builder: Builder) {
    /**
     * The content of an audit event that comes from the event, such as `userIdentity`, `userAgent`, and `eventSource`.
     */
    public val eventData: kotlin.String = requireNotNull(builder.eventData) { "A non-null value must be provided for eventData" }
    /**
     * A checksum is a base64-SHA256 algorithm that helps you verify that CloudTrail receives the event that matches with the checksum. Calculate the checksum by running a command like the following:
     *
     * `printf %s $eventdata | openssl dgst -binary -sha256 | base64`
     */
    public val eventDataChecksum: kotlin.String? = builder.eventDataChecksum
    /**
     * The original event ID from the source event.
     */
    public val id: kotlin.String = requireNotNull(builder.id) { "A non-null value must be provided for id" }

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

    override fun toString(): kotlin.String = buildString {
        append("AuditEvent(")
        append("eventData=$eventData,")
        append("eventDataChecksum=$eventDataChecksum,")
        append("id=$id")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = eventData.hashCode()
        result = 31 * result + (eventDataChecksum?.hashCode() ?: 0)
        result = 31 * result + (id.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 AuditEvent

        if (eventData != other.eventData) return false
        if (eventDataChecksum != other.eventDataChecksum) return false
        if (id != other.id) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The content of an audit event that comes from the event, such as `userIdentity`, `userAgent`, and `eventSource`.
         */
        public var eventData: kotlin.String? = null
        /**
         * A checksum is a base64-SHA256 algorithm that helps you verify that CloudTrail receives the event that matches with the checksum. Calculate the checksum by running a command like the following:
         *
         * `printf %s $eventdata | openssl dgst -binary -sha256 | base64`
         */
        public var eventDataChecksum: kotlin.String? = null
        /**
         * The original event ID from the source event.
         */
        public var id: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudtraildata.model.AuditEvent) : this() {
            this.eventData = x.eventData
            this.eventDataChecksum = x.eventDataChecksum
            this.id = x.id
        }

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

        internal fun correctErrors(): Builder {
            if (eventData == null) eventData = ""
            if (id == null) id = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy