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

commonMain.aws.sdk.kotlin.services.greengrass.model.ResourceAccessPolicy.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.greengrass.model



/**
 * A policy used by the function to access a resource.
 */
public class ResourceAccessPolicy private constructor(builder: Builder) {
    /**
     * The permissions that the Lambda function has to the resource. Can be one of ''rw'' (read/write) or ''ro'' (read-only).
     */
    public val permission: aws.sdk.kotlin.services.greengrass.model.Permission? = builder.permission
    /**
     * The ID of the resource. (This ID is assigned to the resource when you create the resource definiton.)
     */
    public val resourceId: kotlin.String? = builder.resourceId

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

    override fun toString(): kotlin.String = buildString {
        append("ResourceAccessPolicy(")
        append("permission=$permission,")
        append("resourceId=$resourceId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = permission?.hashCode() ?: 0
        result = 31 * result + (resourceId?.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 ResourceAccessPolicy

        if (permission != other.permission) return false
        if (resourceId != other.resourceId) return false

        return true
    }

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

    public class Builder {
        /**
         * The permissions that the Lambda function has to the resource. Can be one of ''rw'' (read/write) or ''ro'' (read-only).
         */
        public var permission: aws.sdk.kotlin.services.greengrass.model.Permission? = null
        /**
         * The ID of the resource. (This ID is assigned to the resource when you create the resource definiton.)
         */
        public var resourceId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.greengrass.model.ResourceAccessPolicy) : this() {
            this.permission = x.permission
            this.resourceId = x.resourceId
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy