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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

public class PutDestinationPolicyRequest private constructor(builder: Builder) {
    /**
     * An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.
     */
    public val accessPolicy: kotlin.String? = builder.accessPolicy
    /**
     * A name for an existing destination.
     */
    public val destinationName: kotlin.String? = builder.destinationName
    /**
     * Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying `true` for `forceUpdate`, you are affirming that you have already updated the subscription filters. For more information, see [ Updating an existing cross-account subscription](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html)
     *
     * If you omit this parameter, the default of `false` is used.
     */
    public val forceUpdate: kotlin.Boolean? = builder.forceUpdate

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

    override fun toString(): kotlin.String = buildString {
        append("PutDestinationPolicyRequest(")
        append("accessPolicy=$accessPolicy,")
        append("destinationName=$destinationName,")
        append("forceUpdate=$forceUpdate")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = accessPolicy?.hashCode() ?: 0
        result = 31 * result + (destinationName?.hashCode() ?: 0)
        result = 31 * result + (forceUpdate?.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 PutDestinationPolicyRequest

        if (accessPolicy != other.accessPolicy) return false
        if (destinationName != other.destinationName) return false
        if (forceUpdate != other.forceUpdate) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination. This can be up to 5120 bytes.
         */
        public var accessPolicy: kotlin.String? = null
        /**
         * A name for an existing destination.
         */
        public var destinationName: kotlin.String? = null
        /**
         * Specify true if you are updating an existing destination policy to grant permission to an organization ID instead of granting permission to individual Amazon Web Services accounts. Before you update a destination policy this way, you must first update the subscription filters in the accounts that send logs to this destination. If you do not, the subscription filters might stop working. By specifying `true` for `forceUpdate`, you are affirming that you have already updated the subscription filters. For more information, see [ Updating an existing cross-account subscription](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Cross-Account-Log_Subscription-Update.html)
         *
         * If you omit this parameter, the default of `false` is used.
         */
        public var forceUpdate: kotlin.Boolean? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudwatchlogs.model.PutDestinationPolicyRequest) : this() {
            this.accessPolicy = x.accessPolicy
            this.destinationName = x.destinationName
            this.forceUpdate = x.forceUpdate
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy