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

com.pulumi.googlenative.compute.alpha.kotlin.ResourcePolicyArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.compute.alpha.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.compute.alpha.ResourcePolicyArgs.builder
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyDiskConsistencyGroupPolicyArgs
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyDiskConsistencyGroupPolicyArgsBuilder
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyGroupPlacementPolicyArgs
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyGroupPlacementPolicyArgsBuilder
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyInstanceSchedulePolicyArgs
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyInstanceSchedulePolicyArgsBuilder
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicySnapshotSchedulePolicyArgs
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicySnapshotSchedulePolicyArgsBuilder
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyVmMaintenancePolicyArgs
import com.pulumi.googlenative.compute.alpha.kotlin.inputs.ResourcePolicyVmMaintenancePolicyArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName

/**
 * Creates a new resource policy.
 * @property description
 * @property diskConsistencyGroupPolicy Resource policy for disk consistency groups.
 * @property groupPlacementPolicy Resource policy for instances for placement configuration.
 * @property instanceSchedulePolicy Resource policy for scheduling instance operations.
 * @property name The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
 * @property project
 * @property region
 * @property requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
 * @property snapshotSchedulePolicy Resource policy for persistent disks for creating snapshots.
 * @property vmMaintenancePolicy Resource policy applicable to VMs for infrastructure maintenance.
 */
public data class ResourcePolicyArgs(
    public val description: Output? = null,
    public val diskConsistencyGroupPolicy: Output? =
        null,
    public val groupPlacementPolicy: Output? = null,
    public val instanceSchedulePolicy: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val requestId: Output? = null,
    public val snapshotSchedulePolicy: Output? = null,
    public val vmMaintenancePolicy: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.compute.alpha.ResourcePolicyArgs =
        com.pulumi.googlenative.compute.alpha.ResourcePolicyArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .diskConsistencyGroupPolicy(
                diskConsistencyGroupPolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .groupPlacementPolicy(
                groupPlacementPolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .instanceSchedulePolicy(
                instanceSchedulePolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .requestId(requestId?.applyValue({ args0 -> args0 }))
            .snapshotSchedulePolicy(
                snapshotSchedulePolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .vmMaintenancePolicy(
                vmMaintenancePolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [ResourcePolicyArgs].
 */
@PulumiTagMarker
public class ResourcePolicyArgsBuilder internal constructor() {
    private var description: Output? = null

    private var diskConsistencyGroupPolicy: Output? =
        null

    private var groupPlacementPolicy: Output? = null

    private var instanceSchedulePolicy: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var requestId: Output? = null

    private var snapshotSchedulePolicy: Output? = null

    private var vmMaintenancePolicy: Output? = null

    /**
     * @param value
     */
    @JvmName("qxwefjjehekbuwab")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Resource policy for disk consistency groups.
     */
    @JvmName("eybntqlxybioekcg")
    public suspend fun diskConsistencyGroupPolicy(`value`: Output) {
        this.diskConsistencyGroupPolicy = value
    }

    /**
     * @param value Resource policy for instances for placement configuration.
     */
    @JvmName("vqlxkeqhjdgbebws")
    public suspend fun groupPlacementPolicy(`value`: Output) {
        this.groupPlacementPolicy = value
    }

    /**
     * @param value Resource policy for scheduling instance operations.
     */
    @JvmName("hsvtlofboxvepfwb")
    public suspend fun instanceSchedulePolicy(`value`: Output) {
        this.instanceSchedulePolicy = value
    }

    /**
     * @param value The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     */
    @JvmName("bpdfiftjbrlvfwrt")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("nqvuvshydkaksbxh")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value
     */
    @JvmName("gbbhhgahsveaoufh")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
     */
    @JvmName("uiqcaedwcvsgoodo")
    public suspend fun requestId(`value`: Output) {
        this.requestId = value
    }

    /**
     * @param value Resource policy for persistent disks for creating snapshots.
     */
    @JvmName("akykvsfrirxfioic")
    public suspend fun snapshotSchedulePolicy(`value`: Output) {
        this.snapshotSchedulePolicy = value
    }

    /**
     * @param value Resource policy applicable to VMs for infrastructure maintenance.
     */
    @JvmName("melqqbsbankhqpkf")
    public suspend fun vmMaintenancePolicy(`value`: Output) {
        this.vmMaintenancePolicy = value
    }

    /**
     * @param value
     */
    @JvmName("nnobxdatixmljxru")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Resource policy for disk consistency groups.
     */
    @JvmName("icuaqwtofrqltatn")
    public suspend fun diskConsistencyGroupPolicy(`value`: ResourcePolicyDiskConsistencyGroupPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.diskConsistencyGroupPolicy = mapped
    }

    /**
     * @param argument Resource policy for disk consistency groups.
     */
    @JvmName("bhrkfuldxxbuklas")
    public suspend fun diskConsistencyGroupPolicy(argument: suspend ResourcePolicyDiskConsistencyGroupPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = ResourcePolicyDiskConsistencyGroupPolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.diskConsistencyGroupPolicy = mapped
    }

    /**
     * @param value Resource policy for instances for placement configuration.
     */
    @JvmName("aaqdqgadlmjhumak")
    public suspend fun groupPlacementPolicy(`value`: ResourcePolicyGroupPlacementPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.groupPlacementPolicy = mapped
    }

    /**
     * @param argument Resource policy for instances for placement configuration.
     */
    @JvmName("kicsrcgjqeqalqab")
    public suspend fun groupPlacementPolicy(argument: suspend ResourcePolicyGroupPlacementPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = ResourcePolicyGroupPlacementPolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.groupPlacementPolicy = mapped
    }

    /**
     * @param value Resource policy for scheduling instance operations.
     */
    @JvmName("oibohnyydwojmjoy")
    public suspend fun instanceSchedulePolicy(`value`: ResourcePolicyInstanceSchedulePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instanceSchedulePolicy = mapped
    }

    /**
     * @param argument Resource policy for scheduling instance operations.
     */
    @JvmName("aimkjdsiidiiqgvr")
    public suspend fun instanceSchedulePolicy(argument: suspend ResourcePolicyInstanceSchedulePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = ResourcePolicyInstanceSchedulePolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.instanceSchedulePolicy = mapped
    }

    /**
     * @param value The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     */
    @JvmName("eaagxliixbksxcpn")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("idtrklkfepgkfcjk")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value
     */
    @JvmName("ignpuaqomnxbwxth")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
     */
    @JvmName("mtxcusvmqgyalfnw")
    public suspend fun requestId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestId = mapped
    }

    /**
     * @param value Resource policy for persistent disks for creating snapshots.
     */
    @JvmName("nqusdhuembmllyxk")
    public suspend fun snapshotSchedulePolicy(`value`: ResourcePolicySnapshotSchedulePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.snapshotSchedulePolicy = mapped
    }

    /**
     * @param argument Resource policy for persistent disks for creating snapshots.
     */
    @JvmName("mclhbirdlieatukd")
    public suspend fun snapshotSchedulePolicy(argument: suspend ResourcePolicySnapshotSchedulePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = ResourcePolicySnapshotSchedulePolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.snapshotSchedulePolicy = mapped
    }

    /**
     * @param value Resource policy applicable to VMs for infrastructure maintenance.
     */
    @JvmName("sxtnwwthnwaosuvx")
    public suspend fun vmMaintenancePolicy(`value`: ResourcePolicyVmMaintenancePolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vmMaintenancePolicy = mapped
    }

    /**
     * @param argument Resource policy applicable to VMs for infrastructure maintenance.
     */
    @JvmName("ikuiihkqukbkqubh")
    public suspend fun vmMaintenancePolicy(argument: suspend ResourcePolicyVmMaintenancePolicyArgsBuilder.() -> Unit) {
        val toBeMapped = ResourcePolicyVmMaintenancePolicyArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.vmMaintenancePolicy = mapped
    }

    internal fun build(): ResourcePolicyArgs = ResourcePolicyArgs(
        description = description,
        diskConsistencyGroupPolicy = diskConsistencyGroupPolicy,
        groupPlacementPolicy = groupPlacementPolicy,
        instanceSchedulePolicy = instanceSchedulePolicy,
        name = name,
        project = project,
        region = region,
        requestId = requestId,
        snapshotSchedulePolicy = snapshotSchedulePolicy,
        vmMaintenancePolicy = vmMaintenancePolicy,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy