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

commonMain.aws.sdk.kotlin.services.cloudcontrol.model.CreateResourceRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cloudcontrol.model



public class CreateResourceRequest private constructor(builder: Builder) {
    /**
     * A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.
     *
     * A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.
     *
     * If you do not specify a client token, one is generated for inclusion in the request.
     *
     * For more information, see [Ensuring resource operation requests are unique](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency) in the *Amazon Web Services Cloud Control API User Guide*.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * Structured data format representing the desired state of the resource, consisting of that resource's properties and their desired values.
     *
     * Cloud Control API currently supports JSON as a structured data format.
     *
     * Specify the desired state as one of the following:
     * + A JSON blob
     * + A local path containing the desired state in JSON data format
     *
     * For more information, see [Composing the desired state of the resource](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html#resource-operations-create-desiredstate) in the *Amazon Web Services Cloud Control API User Guide*.
     *
     * For more information about the properties of a specific resource, refer to the related topic for the resource in the [Resource and property types reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) in the *CloudFormation Users Guide*.
     */
    public val desiredState: kotlin.String = requireNotNull(builder.desiredState) { "A non-null value must be provided for desiredState" }
    /**
     * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the ` handlers ` section of the [resource type definition schema](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html).
     *
     * If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.
     *
     * For more information, see [Specifying credentials](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) in the *Amazon Web Services Cloud Control API User Guide*.
     */
    public val roleArn: kotlin.String? = builder.roleArn
    /**
     * The name of the resource type.
     */
    public val typeName: kotlin.String = requireNotNull(builder.typeName) { "A non-null value must be provided for typeName" }
    /**
     * For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.
     */
    public val typeVersionId: kotlin.String? = builder.typeVersionId

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

    override fun toString(): kotlin.String = buildString {
        append("CreateResourceRequest(")
        append("clientToken=$clientToken,")
        append("desiredState=*** Sensitive Data Redacted ***,")
        append("roleArn=$roleArn,")
        append("typeName=$typeName,")
        append("typeVersionId=$typeVersionId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientToken?.hashCode() ?: 0
        result = 31 * result + (desiredState.hashCode())
        result = 31 * result + (roleArn?.hashCode() ?: 0)
        result = 31 * result + (typeName.hashCode())
        result = 31 * result + (typeVersionId?.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 CreateResourceRequest

        if (clientToken != other.clientToken) return false
        if (desiredState != other.desiredState) return false
        if (roleArn != other.roleArn) return false
        if (typeName != other.typeName) return false
        if (typeVersionId != other.typeVersionId) return false

        return true
    }

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

    public class Builder {
        /**
         * A unique identifier to ensure the idempotency of the resource request. As a best practice, specify this token to ensure idempotency, so that Amazon Web Services Cloud Control API can accurately distinguish between request retries and new resource requests. You might retry a resource request to ensure that it was successfully received.
         *
         * A client token is valid for 36 hours once used. After that, a resource request with the same client token is treated as a new request.
         *
         * If you do not specify a client token, one is generated for inclusion in the request.
         *
         * For more information, see [Ensuring resource operation requests are unique](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-idempotency) in the *Amazon Web Services Cloud Control API User Guide*.
         */
        public var clientToken: kotlin.String? = null
        /**
         * Structured data format representing the desired state of the resource, consisting of that resource's properties and their desired values.
         *
         * Cloud Control API currently supports JSON as a structured data format.
         *
         * Specify the desired state as one of the following:
         * + A JSON blob
         * + A local path containing the desired state in JSON data format
         *
         * For more information, see [Composing the desired state of the resource](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations-create.html#resource-operations-create-desiredstate) in the *Amazon Web Services Cloud Control API User Guide*.
         *
         * For more information about the properties of a specific resource, refer to the related topic for the resource in the [Resource and property types reference](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html) in the *CloudFormation Users Guide*.
         */
        public var desiredState: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role for Cloud Control API to use when performing this resource operation. The role specified must have the permissions required for this operation. The necessary permissions for each event handler are defined in the ` handlers ` section of the [resource type definition schema](https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html).
         *
         * If you do not specify a role, Cloud Control API uses a temporary session created using your Amazon Web Services user credentials.
         *
         * For more information, see [Specifying credentials](https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/resource-operations.html#resource-operations-permissions) in the *Amazon Web Services Cloud Control API User Guide*.
         */
        public var roleArn: kotlin.String? = null
        /**
         * The name of the resource type.
         */
        public var typeName: kotlin.String? = null
        /**
         * For private resource types, the type version to use in this resource operation. If you do not specify a resource version, CloudFormation uses the default version.
         */
        public var typeVersionId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cloudcontrol.model.CreateResourceRequest) : this() {
            this.clientToken = x.clientToken
            this.desiredState = x.desiredState
            this.roleArn = x.roleArn
            this.typeName = x.typeName
            this.typeVersionId = x.typeVersionId
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy