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

commonMain.aws.sdk.kotlin.services.ssmincidents.model.ResourcePolicy.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.ssmincidents.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The resource policy that allows Incident Manager to perform actions on resources on your behalf.
 */
public class ResourcePolicy private constructor(builder: Builder) {
    /**
     * The JSON blob that describes the policy.
     */
    public val policyDocument: kotlin.String = requireNotNull(builder.policyDocument) { "A non-null value must be provided for policyDocument" }
    /**
     * The ID of the resource policy.
     */
    public val policyId: kotlin.String = requireNotNull(builder.policyId) { "A non-null value must be provided for policyId" }
    /**
     * The Amazon Web Services Region that policy allows resources to be used in.
     */
    public val ramResourceShareRegion: kotlin.String = requireNotNull(builder.ramResourceShareRegion) { "A non-null value must be provided for ramResourceShareRegion" }

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

    override fun toString(): kotlin.String = buildString {
        append("ResourcePolicy(")
        append("policyDocument=$policyDocument,")
        append("policyId=$policyId,")
        append("ramResourceShareRegion=$ramResourceShareRegion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = policyDocument.hashCode()
        result = 31 * result + (policyId.hashCode())
        result = 31 * result + (ramResourceShareRegion.hashCode())
        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 ResourcePolicy

        if (policyDocument != other.policyDocument) return false
        if (policyId != other.policyId) return false
        if (ramResourceShareRegion != other.ramResourceShareRegion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The JSON blob that describes the policy.
         */
        public var policyDocument: kotlin.String? = null
        /**
         * The ID of the resource policy.
         */
        public var policyId: kotlin.String? = null
        /**
         * The Amazon Web Services Region that policy allows resources to be used in.
         */
        public var ramResourceShareRegion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.ssmincidents.model.ResourcePolicy) : this() {
            this.policyDocument = x.policyDocument
            this.policyId = x.policyId
            this.ramResourceShareRegion = x.ramResourceShareRegion
        }

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

        internal fun correctErrors(): Builder {
            if (policyDocument == null) policyDocument = ""
            if (policyId == null) policyId = ""
            if (ramResourceShareRegion == null) ramResourceShareRegion = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy