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

commonMain.aws.sdk.kotlin.services.cloudwatchlogs.model.PutLogEventsRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudwatchlogs.model

import aws.smithy.kotlin.runtime.SdkDsl

public class PutLogEventsRequest private constructor(builder: Builder) {
    /**
     * Reserved for internal use.
     */
    public val entity: aws.sdk.kotlin.services.cloudwatchlogs.model.Entity? = builder.entity
    /**
     * The log events.
     */
    public val logEvents: List? = builder.logEvents
    /**
     * The name of the log group.
     */
    public val logGroupName: kotlin.String? = builder.logGroupName
    /**
     * The name of the log stream.
     */
    public val logStreamName: kotlin.String? = builder.logStreamName
    /**
     * The sequence token obtained from the response of the previous `PutLogEvents` call.
     *
     * The `sequenceToken` parameter is now ignored in `PutLogEvents` actions. `PutLogEvents` actions are now accepted and never return `InvalidSequenceTokenException` or `DataAlreadyAcceptedException` even if the sequence token is not valid.
     */
    public val sequenceToken: kotlin.String? = builder.sequenceToken

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

    override fun toString(): kotlin.String = buildString {
        append("PutLogEventsRequest(")
        append("entity=$entity,")
        append("logEvents=$logEvents,")
        append("logGroupName=$logGroupName,")
        append("logStreamName=$logStreamName,")
        append("sequenceToken=$sequenceToken")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = entity?.hashCode() ?: 0
        result = 31 * result + (logEvents?.hashCode() ?: 0)
        result = 31 * result + (logGroupName?.hashCode() ?: 0)
        result = 31 * result + (logStreamName?.hashCode() ?: 0)
        result = 31 * result + (sequenceToken?.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 PutLogEventsRequest

        if (entity != other.entity) return false
        if (logEvents != other.logEvents) return false
        if (logGroupName != other.logGroupName) return false
        if (logStreamName != other.logStreamName) return false
        if (sequenceToken != other.sequenceToken) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Reserved for internal use.
         */
        public var entity: aws.sdk.kotlin.services.cloudwatchlogs.model.Entity? = null
        /**
         * The log events.
         */
        public var logEvents: List? = null
        /**
         * The name of the log group.
         */
        public var logGroupName: kotlin.String? = null
        /**
         * The name of the log stream.
         */
        public var logStreamName: kotlin.String? = null
        /**
         * The sequence token obtained from the response of the previous `PutLogEvents` call.
         *
         * The `sequenceToken` parameter is now ignored in `PutLogEvents` actions. `PutLogEvents` actions are now accepted and never return `InvalidSequenceTokenException` or `DataAlreadyAcceptedException` even if the sequence token is not valid.
         */
        public var sequenceToken: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudwatchlogs.model.PutLogEventsRequest) : this() {
            this.entity = x.entity
            this.logEvents = x.logEvents
            this.logGroupName = x.logGroupName
            this.logStreamName = x.logStreamName
            this.sequenceToken = x.sequenceToken
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy