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

commonMain.aws.sdk.kotlin.services.verifiedpermissions.model.GetPolicyTemplateResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.verifiedpermissions.model

import aws.smithy.kotlin.runtime.time.Instant

public class GetPolicyTemplateResponse private constructor(builder: Builder) {
    /**
     * The date and time that the policy template was originally created.
     */
    public val createdDate: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createdDate) { "A non-null value must be provided for createdDate" }
    /**
     * The description of the policy template.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The date and time that the policy template was most recently updated.
     */
    public val lastUpdatedDate: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.lastUpdatedDate) { "A non-null value must be provided for lastUpdatedDate" }
    /**
     * The ID of the policy store that contains the policy template.
     */
    public val policyStoreId: kotlin.String = requireNotNull(builder.policyStoreId) { "A non-null value must be provided for policyStoreId" }
    /**
     * The ID of the policy template.
     */
    public val policyTemplateId: kotlin.String = requireNotNull(builder.policyTemplateId) { "A non-null value must be provided for policyTemplateId" }
    /**
     * The content of the body of the policy template written in the Cedar policy language.
     */
    public val statement: kotlin.String = requireNotNull(builder.statement) { "A non-null value must be provided for statement" }

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

    override fun toString(): kotlin.String = buildString {
        append("GetPolicyTemplateResponse(")
        append("createdDate=$createdDate,")
        append("description=*** Sensitive Data Redacted ***,")
        append("lastUpdatedDate=$lastUpdatedDate,")
        append("policyStoreId=$policyStoreId,")
        append("policyTemplateId=$policyTemplateId,")
        append("statement=*** Sensitive Data Redacted ***")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = createdDate.hashCode()
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (lastUpdatedDate.hashCode())
        result = 31 * result + (policyStoreId.hashCode())
        result = 31 * result + (policyTemplateId.hashCode())
        result = 31 * result + (statement.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 GetPolicyTemplateResponse

        if (createdDate != other.createdDate) return false
        if (description != other.description) return false
        if (lastUpdatedDate != other.lastUpdatedDate) return false
        if (policyStoreId != other.policyStoreId) return false
        if (policyTemplateId != other.policyTemplateId) return false
        if (statement != other.statement) return false

        return true
    }

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

    public class Builder {
        /**
         * The date and time that the policy template was originally created.
         */
        public var createdDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The description of the policy template.
         */
        public var description: kotlin.String? = null
        /**
         * The date and time that the policy template was most recently updated.
         */
        public var lastUpdatedDate: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The ID of the policy store that contains the policy template.
         */
        public var policyStoreId: kotlin.String? = null
        /**
         * The ID of the policy template.
         */
        public var policyTemplateId: kotlin.String? = null
        /**
         * The content of the body of the policy template written in the Cedar policy language.
         */
        public var statement: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.verifiedpermissions.model.GetPolicyTemplateResponse) : this() {
            this.createdDate = x.createdDate
            this.description = x.description
            this.lastUpdatedDate = x.lastUpdatedDate
            this.policyStoreId = x.policyStoreId
            this.policyTemplateId = x.policyTemplateId
            this.statement = x.statement
        }

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

        internal fun correctErrors(): Builder {
            if (createdDate == null) createdDate = Instant.fromEpochSeconds(0)
            if (lastUpdatedDate == null) lastUpdatedDate = Instant.fromEpochSeconds(0)
            if (policyStoreId == null) policyStoreId = ""
            if (policyTemplateId == null) policyTemplateId = ""
            if (statement == null) statement = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy