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

com.pulumi.googlenative.monitoring.v3.kotlin.Snooze.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.monitoring.v3.kotlin

import com.pulumi.core.Output
import com.pulumi.googlenative.monitoring.v3.kotlin.outputs.CriteriaResponse
import com.pulumi.googlenative.monitoring.v3.kotlin.outputs.TimeIntervalResponse
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.googlenative.monitoring.v3.kotlin.outputs.CriteriaResponse.Companion.toKotlin as criteriaResponseToKotlin
import com.pulumi.googlenative.monitoring.v3.kotlin.outputs.TimeIntervalResponse.Companion.toKotlin as timeIntervalResponseToKotlin

/**
 * Builder for [Snooze].
 */
@PulumiTagMarker
public class SnoozeResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: SnoozeArgs = SnoozeArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend SnoozeArgsBuilder.() -> Unit) {
        val builder = SnoozeArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Snooze {
        val builtJavaResource = com.pulumi.googlenative.monitoring.v3.Snooze(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Snooze(builtJavaResource)
    }
}

/**
 * Creates a Snooze that will prevent alerts, which match the provided criteria, from being opened. The Snooze applies for a specific time interval.
 * Note - this resource's API doesn't support deletion. When deleted, the resource will persist
 * on Google Cloud even though it will be deleted from Pulumi state.
 */
public class Snooze internal constructor(
    override val javaResource: com.pulumi.googlenative.monitoring.v3.Snooze,
) : KotlinCustomResource(javaResource, SnoozeMapper) {
    /**
     * This defines the criteria for applying the Snooze. See Criteria for more information.
     */
    public val criteria: Output
        get() = javaResource.criteria().applyValue({ args0 ->
            args0.let({ args0 ->
                criteriaResponseToKotlin(args0)
            })
        })

    /**
     * A display name for the Snooze. This can be, at most, 512 unicode characters.
     */
    public val displayName: Output
        get() = javaResource.displayName().applyValue({ args0 -> args0 })

    /**
     * The Snooze will be active from interval.start_time through interval.end_time. interval.start_time cannot be in the past. There is a 15 second clock skew to account for the time it takes for a request to reach the API from the UI.
     */
    public val interval: Output
        get() = javaResource.interval().applyValue({ args0 ->
            args0.let({ args0 ->
                timeIntervalResponseToKotlin(args0)
            })
        })

    /**
     * The name of the Snooze. The format is: projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] The ID of the Snooze will be generated by the system.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })
}

public object SnoozeMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.googlenative.monitoring.v3.Snooze::class == javaResource::class

    override fun map(javaResource: Resource): Snooze = Snooze(
        javaResource as
            com.pulumi.googlenative.monitoring.v3.Snooze,
    )
}

/**
 * @see [Snooze].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Snooze].
 */
public suspend fun snooze(name: String, block: suspend SnoozeResourceBuilder.() -> Unit): Snooze {
    val builder = SnoozeResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Snooze].
 * @param name The _unique_ name of the resulting resource.
 */
public fun snooze(name: String): Snooze {
    val builder = SnoozeResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy