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

commonMain.aws.sdk.kotlin.services.sns.model.AddPermissionRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.sns.model



public class AddPermissionRequest private constructor(builder: Builder) {
    /**
     * The action you want to allow for the specified principal(s).
     *
     * Valid values: Any Amazon SNS action name, for example `Publish`.
     */
    public val actionName: List? = builder.actionName
    /**
     * The Amazon Web Services account IDs of the users (principals) who will be given access to the specified actions. The users must have Amazon Web Services account, but do not need to be signed up for this service.
     */
    public val awsAccountId: List? = builder.awsAccountId
    /**
     * A unique identifier for the new policy statement.
     */
    public val label: kotlin.String? = builder.label
    /**
     * The ARN of the topic whose access control policy you wish to modify.
     */
    public val topicArn: kotlin.String? = builder.topicArn

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

    override fun toString(): kotlin.String = buildString {
        append("AddPermissionRequest(")
        append("actionName=$actionName,")
        append("awsAccountId=$awsAccountId,")
        append("label=$label,")
        append("topicArn=$topicArn")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = actionName?.hashCode() ?: 0
        result = 31 * result + (awsAccountId?.hashCode() ?: 0)
        result = 31 * result + (label?.hashCode() ?: 0)
        result = 31 * result + (topicArn?.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 AddPermissionRequest

        if (actionName != other.actionName) return false
        if (awsAccountId != other.awsAccountId) return false
        if (label != other.label) return false
        if (topicArn != other.topicArn) return false

        return true
    }

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

    public class Builder {
        /**
         * The action you want to allow for the specified principal(s).
         *
         * Valid values: Any Amazon SNS action name, for example `Publish`.
         */
        public var actionName: List? = null
        /**
         * The Amazon Web Services account IDs of the users (principals) who will be given access to the specified actions. The users must have Amazon Web Services account, but do not need to be signed up for this service.
         */
        public var awsAccountId: List? = null
        /**
         * A unique identifier for the new policy statement.
         */
        public var label: kotlin.String? = null
        /**
         * The ARN of the topic whose access control policy you wish to modify.
         */
        public var topicArn: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.sns.model.AddPermissionRequest) : this() {
            this.actionName = x.actionName
            this.awsAccountId = x.awsAccountId
            this.label = x.label
            this.topicArn = x.topicArn
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy