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

com.pulumi.azurenative.automation.kotlin.WatcherArgs.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.

There is a newer version: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.automation.kotlin

import com.pulumi.azurenative.automation.WatcherArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Double
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Definition of the watcher type.
 * Azure REST API version: 2020-01-13-preview. Prior API version in Azure Native 1.x: 2019-06-01.
 * Other available API versions: 2023-05-15-preview.
 * ## Example Usage
 * ### Create or update watcher
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var watcher = new AzureNative.Automation.Watcher("watcher", new()
 *     {
 *         AutomationAccountName = "MyTestAutomationAccount",
 *         Description = "This is a test watcher.",
 *         ExecutionFrequencyInSeconds = 60,
 *         ResourceGroupName = "rg",
 *         ScriptName = "MyTestWatcherRunbook",
 *         ScriptRunOn = "MyTestHybridWorkerGroup",
 *         Tags = null,
 *         WatcherName = "MyTestWatcher",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := automation.NewWatcher(ctx, "watcher", &automation.WatcherArgs{
 * 			AutomationAccountName:       pulumi.String("MyTestAutomationAccount"),
 * 			Description:                 pulumi.String("This is a test watcher."),
 * 			ExecutionFrequencyInSeconds: pulumi.Float64(60),
 * 			ResourceGroupName:           pulumi.String("rg"),
 * 			ScriptName:                  pulumi.String("MyTestWatcherRunbook"),
 * 			ScriptRunOn:                 pulumi.String("MyTestHybridWorkerGroup"),
 * 			Tags:                        nil,
 * 			WatcherName:                 pulumi.String("MyTestWatcher"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.automation.Watcher;
 * import com.pulumi.azurenative.automation.WatcherArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var watcher = new Watcher("watcher", WatcherArgs.builder()
 *             .automationAccountName("MyTestAutomationAccount")
 *             .description("This is a test watcher.")
 *             .executionFrequencyInSeconds(60)
 *             .resourceGroupName("rg")
 *             .scriptName("MyTestWatcherRunbook")
 *             .scriptRunOn("MyTestHybridWorkerGroup")
 *             .tags()
 *             .watcherName("MyTestWatcher")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:automation:Watcher MyTestWatcher /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/watchers/{watcherName}
 * ```
 * @property automationAccountName The name of the automation account.
 * @property description Gets or sets the description.
 * @property executionFrequencyInSeconds Gets or sets the frequency at which the watcher is invoked.
 * @property location The geo-location where the resource lives
 * @property resourceGroupName Name of an Azure Resource group.
 * @property scriptName Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
 * @property scriptParameters Gets or sets the parameters of the script.
 * @property scriptRunOn Gets or sets the name of the hybrid worker group the watcher will run on.
 * @property tags Resource tags.
 * @property watcherName The watcher name.
 */
public data class WatcherArgs(
    public val automationAccountName: Output? = null,
    public val description: Output? = null,
    public val executionFrequencyInSeconds: Output? = null,
    public val location: Output? = null,
    public val resourceGroupName: Output? = null,
    public val scriptName: Output? = null,
    public val scriptParameters: Output>? = null,
    public val scriptRunOn: Output? = null,
    public val tags: Output>? = null,
    public val watcherName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.automation.WatcherArgs =
        com.pulumi.azurenative.automation.WatcherArgs.builder()
            .automationAccountName(automationAccountName?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .executionFrequencyInSeconds(executionFrequencyInSeconds?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scriptName(scriptName?.applyValue({ args0 -> args0 }))
            .scriptParameters(
                scriptParameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .scriptRunOn(scriptRunOn?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .watcherName(watcherName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [WatcherArgs].
 */
@PulumiTagMarker
public class WatcherArgsBuilder internal constructor() {
    private var automationAccountName: Output? = null

    private var description: Output? = null

    private var executionFrequencyInSeconds: Output? = null

    private var location: Output? = null

    private var resourceGroupName: Output? = null

    private var scriptName: Output? = null

    private var scriptParameters: Output>? = null

    private var scriptRunOn: Output? = null

    private var tags: Output>? = null

    private var watcherName: Output? = null

    /**
     * @param value The name of the automation account.
     */
    @JvmName("dieqgtrbajoomfom")
    public suspend fun automationAccountName(`value`: Output) {
        this.automationAccountName = value
    }

    /**
     * @param value Gets or sets the description.
     */
    @JvmName("ptheansqhkckaaos")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Gets or sets the frequency at which the watcher is invoked.
     */
    @JvmName("xgpoegxgolhvewmc")
    public suspend fun executionFrequencyInSeconds(`value`: Output) {
        this.executionFrequencyInSeconds = value
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("oagfwjhbgrpepseg")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Name of an Azure Resource group.
     */
    @JvmName("baotbetnkonbggid")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
     */
    @JvmName("nkjwrkrqgicnalow")
    public suspend fun scriptName(`value`: Output) {
        this.scriptName = value
    }

    /**
     * @param value Gets or sets the parameters of the script.
     */
    @JvmName("hiprfuxotrphmyhn")
    public suspend fun scriptParameters(`value`: Output>) {
        this.scriptParameters = value
    }

    /**
     * @param value Gets or sets the name of the hybrid worker group the watcher will run on.
     */
    @JvmName("gmbvhylphantsheo")
    public suspend fun scriptRunOn(`value`: Output) {
        this.scriptRunOn = value
    }

    /**
     * @param value Resource tags.
     */
    @JvmName("qaymxoukstgodxxq")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value The watcher name.
     */
    @JvmName("cwughmsxehmmvdkl")
    public suspend fun watcherName(`value`: Output) {
        this.watcherName = value
    }

    /**
     * @param value The name of the automation account.
     */
    @JvmName("orolowgpcflegodr")
    public suspend fun automationAccountName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.automationAccountName = mapped
    }

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

    /**
     * @param value Gets or sets the frequency at which the watcher is invoked.
     */
    @JvmName("iodlhthhnrjfprca")
    public suspend fun executionFrequencyInSeconds(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.executionFrequencyInSeconds = mapped
    }

    /**
     * @param value The geo-location where the resource lives
     */
    @JvmName("qeoyoftknyqkaeck")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Name of an Azure Resource group.
     */
    @JvmName("lukioqscjsuparyx")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Gets or sets the name of the script the watcher is attached to, i.e. the name of an existing runbook.
     */
    @JvmName("dlbtstykgswuobnw")
    public suspend fun scriptName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scriptName = mapped
    }

    /**
     * @param value Gets or sets the parameters of the script.
     */
    @JvmName("krlpwnenhnbkhfna")
    public suspend fun scriptParameters(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scriptParameters = mapped
    }

    /**
     * @param values Gets or sets the parameters of the script.
     */
    @JvmName("eqeniqcvywxosmsg")
    public fun scriptParameters(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.scriptParameters = mapped
    }

    /**
     * @param value Gets or sets the name of the hybrid worker group the watcher will run on.
     */
    @JvmName("acyhmyasilwfmgry")
    public suspend fun scriptRunOn(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scriptRunOn = mapped
    }

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

    /**
     * @param values Resource tags.
     */
    @JvmName("afqstxcsxsmkqfkn")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

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

    internal fun build(): WatcherArgs = WatcherArgs(
        automationAccountName = automationAccountName,
        description = description,
        executionFrequencyInSeconds = executionFrequencyInSeconds,
        location = location,
        resourceGroupName = resourceGroupName,
        scriptName = scriptName,
        scriptParameters = scriptParameters,
        scriptRunOn = scriptRunOn,
        tags = tags,
        watcherName = watcherName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy