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

commonMain.aws.sdk.kotlin.services.proton.model.UpdateEnvironmentRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.proton.model

import aws.smithy.kotlin.runtime.SdkDsl

public class UpdateEnvironmentRequest private constructor(builder: Builder) {
    /**
     * The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.
     */
    public val codebuildRoleArn: kotlin.String? = builder.codebuildRoleArn
    /**
     * The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.
     *
     * The environment must have a `componentRoleArn` to allow directly defined components to be associated with the environment.
     *
     * For more information about components, see [Proton components](https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html) in the *Proton User Guide*.
     */
    public val componentRoleArn: kotlin.String? = builder.componentRoleArn
    /**
     * There are four modes for updating an environment. The `deploymentType` field defines the mode.
     *
     * `NONE`
     *
     * In this mode, a deployment *doesn't* occur. Only the requested metadata parameters are updated.
     *
     * `CURRENT_VERSION`
     *
     * In this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. *Don’t* include major or minor version parameters when you use this `deployment-type`.
     *
     * `MINOR_VERSION`
     *
     * In this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.
     *
     * `MAJOR_VERSION`
     *
     * In this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that is higher than the major version in use and a minor version (optional).
     */
    public val deploymentType: aws.sdk.kotlin.services.proton.model.DeploymentUpdateType = requireNotNull(builder.deploymentType) { "A non-null value must be provided for deploymentType" }
    /**
     * A description of the environment update.
     */
    public val description: kotlin.String? = builder.description
    /**
     * The ID of the environment account connection.
     *
     * You can only update to a new environment account connection if it was created in the same environment account that the current environment account connection was created in and is associated with the current environment.
     */
    public val environmentAccountConnectionId: kotlin.String? = builder.environmentAccountConnectionId
    /**
     * The name of the environment to update.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.
     */
    public val protonServiceRoleArn: kotlin.String? = builder.protonServiceRoleArn
    /**
     * The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see CreateRepository.
     */
    public val provisioningRepository: aws.sdk.kotlin.services.proton.model.RepositoryBranchInput? = builder.provisioningRepository
    /**
     * The formatted specification that defines the update.
     */
    public val spec: kotlin.String? = builder.spec
    /**
     * The major version of the environment to update.
     */
    public val templateMajorVersion: kotlin.String? = builder.templateMajorVersion
    /**
     * The minor version of the environment to update.
     */
    public val templateMinorVersion: kotlin.String? = builder.templateMinorVersion

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

    override fun toString(): kotlin.String = buildString {
        append("UpdateEnvironmentRequest(")
        append("codebuildRoleArn=$codebuildRoleArn,")
        append("componentRoleArn=$componentRoleArn,")
        append("deploymentType=$deploymentType,")
        append("description=*** Sensitive Data Redacted ***,")
        append("environmentAccountConnectionId=$environmentAccountConnectionId,")
        append("name=$name,")
        append("protonServiceRoleArn=$protonServiceRoleArn,")
        append("provisioningRepository=$provisioningRepository,")
        append("spec=*** Sensitive Data Redacted ***,")
        append("templateMajorVersion=$templateMajorVersion,")
        append("templateMinorVersion=$templateMinorVersion")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = codebuildRoleArn?.hashCode() ?: 0
        result = 31 * result + (componentRoleArn?.hashCode() ?: 0)
        result = 31 * result + (deploymentType.hashCode())
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (environmentAccountConnectionId?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (protonServiceRoleArn?.hashCode() ?: 0)
        result = 31 * result + (provisioningRepository?.hashCode() ?: 0)
        result = 31 * result + (spec?.hashCode() ?: 0)
        result = 31 * result + (templateMajorVersion?.hashCode() ?: 0)
        result = 31 * result + (templateMinorVersion?.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 UpdateEnvironmentRequest

        if (codebuildRoleArn != other.codebuildRoleArn) return false
        if (componentRoleArn != other.componentRoleArn) return false
        if (deploymentType != other.deploymentType) return false
        if (description != other.description) return false
        if (environmentAccountConnectionId != other.environmentAccountConnectionId) return false
        if (name != other.name) return false
        if (protonServiceRoleArn != other.protonServiceRoleArn) return false
        if (provisioningRepository != other.provisioningRepository) return false
        if (spec != other.spec) return false
        if (templateMajorVersion != other.templateMajorVersion) return false
        if (templateMinorVersion != other.templateMinorVersion) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The Amazon Resource Name (ARN) of the IAM service role that allows Proton to provision infrastructure using CodeBuild-based provisioning on your behalf.
         */
        public var codebuildRoleArn: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the IAM service role that Proton uses when provisioning directly defined components in this environment. It determines the scope of infrastructure that a component can provision.
         *
         * The environment must have a `componentRoleArn` to allow directly defined components to be associated with the environment.
         *
         * For more information about components, see [Proton components](https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html) in the *Proton User Guide*.
         */
        public var componentRoleArn: kotlin.String? = null
        /**
         * There are four modes for updating an environment. The `deploymentType` field defines the mode.
         *
         * `NONE`
         *
         * In this mode, a deployment *doesn't* occur. Only the requested metadata parameters are updated.
         *
         * `CURRENT_VERSION`
         *
         * In this mode, the environment is deployed and updated with the new spec that you provide. Only requested parameters are updated. *Don’t* include major or minor version parameters when you use this `deployment-type`.
         *
         * `MINOR_VERSION`
         *
         * In this mode, the environment is deployed and updated with the published, recommended (latest) minor version of the current major version in use, by default. You can also specify a different minor version of the current major version in use.
         *
         * `MAJOR_VERSION`
         *
         * In this mode, the environment is deployed and updated with the published, recommended (latest) major and minor version of the current template, by default. You can also specify a different major version that is higher than the major version in use and a minor version (optional).
         */
        public var deploymentType: aws.sdk.kotlin.services.proton.model.DeploymentUpdateType? = null
        /**
         * A description of the environment update.
         */
        public var description: kotlin.String? = null
        /**
         * The ID of the environment account connection.
         *
         * You can only update to a new environment account connection if it was created in the same environment account that the current environment account connection was created in and is associated with the current environment.
         */
        public var environmentAccountConnectionId: kotlin.String? = null
        /**
         * The name of the environment to update.
         */
        public var name: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the Proton service role that allows Proton to make API calls to other services your behalf.
         */
        public var protonServiceRoleArn: kotlin.String? = null
        /**
         * The linked repository that you use to host your rendered infrastructure templates for self-managed provisioning. A linked repository is a repository that has been registered with Proton. For more information, see CreateRepository.
         */
        public var provisioningRepository: aws.sdk.kotlin.services.proton.model.RepositoryBranchInput? = null
        /**
         * The formatted specification that defines the update.
         */
        public var spec: kotlin.String? = null
        /**
         * The major version of the environment to update.
         */
        public var templateMajorVersion: kotlin.String? = null
        /**
         * The minor version of the environment to update.
         */
        public var templateMinorVersion: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.proton.model.UpdateEnvironmentRequest) : this() {
            this.codebuildRoleArn = x.codebuildRoleArn
            this.componentRoleArn = x.componentRoleArn
            this.deploymentType = x.deploymentType
            this.description = x.description
            this.environmentAccountConnectionId = x.environmentAccountConnectionId
            this.name = x.name
            this.protonServiceRoleArn = x.protonServiceRoleArn
            this.provisioningRepository = x.provisioningRepository
            this.spec = x.spec
            this.templateMajorVersion = x.templateMajorVersion
            this.templateMinorVersion = x.templateMinorVersion
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.proton.model.RepositoryBranchInput] inside the given [block]
         */
        public fun provisioningRepository(block: aws.sdk.kotlin.services.proton.model.RepositoryBranchInput.Builder.() -> kotlin.Unit) {
            this.provisioningRepository = aws.sdk.kotlin.services.proton.model.RepositoryBranchInput.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (deploymentType == null) deploymentType = DeploymentUpdateType.SdkUnknown("no value provided")
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy