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

commonMain.aws.sdk.kotlin.services.budgets.model.IamActionDefinition.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.budgets.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The Identity and Access Management (IAM) action definition details.
 */
public class IamActionDefinition private constructor(builder: Builder) {
    /**
     * A list of groups to be attached. There must be at least one group.
     */
    public val groups: List? = builder.groups
    /**
     * The Amazon Resource Name (ARN) of the policy to be attached.
     */
    public val policyArn: kotlin.String = requireNotNull(builder.policyArn) { "A non-null value must be provided for policyArn" }
    /**
     * A list of roles to be attached. There must be at least one role.
     */
    public val roles: List? = builder.roles
    /**
     * A list of users to be attached. There must be at least one user.
     */
    public val users: List? = builder.users

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

    override fun toString(): kotlin.String = buildString {
        append("IamActionDefinition(")
        append("groups=$groups,")
        append("policyArn=$policyArn,")
        append("roles=$roles,")
        append("users=$users")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = groups?.hashCode() ?: 0
        result = 31 * result + (policyArn.hashCode())
        result = 31 * result + (roles?.hashCode() ?: 0)
        result = 31 * result + (users?.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 IamActionDefinition

        if (groups != other.groups) return false
        if (policyArn != other.policyArn) return false
        if (roles != other.roles) return false
        if (users != other.users) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A list of groups to be attached. There must be at least one group.
         */
        public var groups: List? = null
        /**
         * The Amazon Resource Name (ARN) of the policy to be attached.
         */
        public var policyArn: kotlin.String? = null
        /**
         * A list of roles to be attached. There must be at least one role.
         */
        public var roles: List? = null
        /**
         * A list of users to be attached. There must be at least one user.
         */
        public var users: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.budgets.model.IamActionDefinition) : this() {
            this.groups = x.groups
            this.policyArn = x.policyArn
            this.roles = x.roles
            this.users = x.users
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy