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

commonMain.aws.sdk.kotlin.services.signer.model.Permission.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.signer.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A cross-account permission for a signing profile.
 */
public class Permission private constructor(builder: Builder) {
    /**
     * An AWS Signer action permitted as part of cross-account permissions.
     */
    public val action: kotlin.String? = builder.action
    /**
     * The AWS principal that has been granted a cross-account permission.
     */
    public val principal: kotlin.String? = builder.principal
    /**
     * The signing profile version that a permission applies to.
     */
    public val profileVersion: kotlin.String? = builder.profileVersion
    /**
     * A unique identifier for a cross-account permission statement.
     */
    public val statementId: kotlin.String? = builder.statementId

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

    override fun toString(): kotlin.String = buildString {
        append("Permission(")
        append("action=$action,")
        append("principal=$principal,")
        append("profileVersion=$profileVersion,")
        append("statementId=$statementId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = action?.hashCode() ?: 0
        result = 31 * result + (principal?.hashCode() ?: 0)
        result = 31 * result + (profileVersion?.hashCode() ?: 0)
        result = 31 * result + (statementId?.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 Permission

        if (action != other.action) return false
        if (principal != other.principal) return false
        if (profileVersion != other.profileVersion) return false
        if (statementId != other.statementId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An AWS Signer action permitted as part of cross-account permissions.
         */
        public var action: kotlin.String? = null
        /**
         * The AWS principal that has been granted a cross-account permission.
         */
        public var principal: kotlin.String? = null
        /**
         * The signing profile version that a permission applies to.
         */
        public var profileVersion: kotlin.String? = null
        /**
         * A unique identifier for a cross-account permission statement.
         */
        public var statementId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.signer.model.Permission) : this() {
            this.action = x.action
            this.principal = x.principal
            this.profileVersion = x.profileVersion
            this.statementId = x.statementId
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy