commonMain.aws.sdk.kotlin.services.cloudtraildata.model.PutAuditEventsRequest.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cloudtraildata-jvm Show documentation
Show all versions of cloudtraildata-jvm Show documentation
The AWS SDK for Kotlin client for CloudTrail Data
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.cloudtraildata.model
import aws.smithy.kotlin.runtime.SdkDsl
public class PutAuditEventsRequest private constructor(builder: Builder) {
/**
* The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file.
*/
public val auditEvents: List = requireNotNull(builder.auditEvents) { "A non-null value must be provided for auditEvents" }
/**
* The ARN or ID (the ARN suffix) of a channel.
*/
public val channelArn: kotlin.String = requireNotNull(builder.channelArn) { "A non-null value must be provided for channelArn" }
/**
* A unique identifier that is conditionally required when the channel's resource policy includes an external ID. This value can be any string, such as a passphrase or account number.
*/
public val externalId: kotlin.String? = builder.externalId
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.cloudtraildata.model.PutAuditEventsRequest = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("PutAuditEventsRequest(")
append("auditEvents=$auditEvents,")
append("channelArn=$channelArn,")
append("externalId=$externalId")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = auditEvents.hashCode()
result = 31 * result + (channelArn.hashCode())
result = 31 * result + (externalId?.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 PutAuditEventsRequest
if (auditEvents != other.auditEvents) return false
if (channelArn != other.channelArn) return false
if (externalId != other.externalId) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.cloudtraildata.model.PutAuditEventsRequest = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file.
*/
public var auditEvents: List? = null
/**
* The ARN or ID (the ARN suffix) of a channel.
*/
public var channelArn: kotlin.String? = null
/**
* A unique identifier that is conditionally required when the channel's resource policy includes an external ID. This value can be any string, such as a passphrase or account number.
*/
public var externalId: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.cloudtraildata.model.PutAuditEventsRequest) : this() {
this.auditEvents = x.auditEvents
this.channelArn = x.channelArn
this.externalId = x.externalId
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.cloudtraildata.model.PutAuditEventsRequest = PutAuditEventsRequest(this)
internal fun correctErrors(): Builder {
if (auditEvents == null) auditEvents = emptyList()
if (channelArn == null) channelArn = ""
return this
}
}
}