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

com.pulumi.azure.containerservice.kotlin.RegistryWebookArgs.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: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.containerservice.kotlin

import com.pulumi.azure.containerservice.RegistryWebookArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Deprecated
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an Azure Container Registry Webhook.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const acr = new azure.containerservice.Registry("acr", {
 *     name: "containerRegistry1",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     sku: "Standard",
 *     adminEnabled: false,
 * });
 * const webhook = new azure.containerservice.RegistryWebhook("webhook", {
 *     name: "mywebhook",
 *     resourceGroupName: example.name,
 *     registryName: acr.name,
 *     location: example.location,
 *     serviceUri: "https://mywebhookreceiver.example/mytag",
 *     status: "enabled",
 *     scope: "mytag:*",
 *     actions: ["push"],
 *     customHeaders: {
 *         "Content-Type": "application/json",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * acr = azure.containerservice.Registry("acr",
 *     name="containerRegistry1",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     sku="Standard",
 *     admin_enabled=False)
 * webhook = azure.containerservice.RegistryWebhook("webhook",
 *     name="mywebhook",
 *     resource_group_name=example.name,
 *     registry_name=acr.name,
 *     location=example.location,
 *     service_uri="https://mywebhookreceiver.example/mytag",
 *     status="enabled",
 *     scope="mytag:*",
 *     actions=["push"],
 *     custom_headers={
 *         "Content-Type": "application/json",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var acr = new Azure.ContainerService.Registry("acr", new()
 *     {
 *         Name = "containerRegistry1",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Sku = "Standard",
 *         AdminEnabled = false,
 *     });
 *     var webhook = new Azure.ContainerService.RegistryWebhook("webhook", new()
 *     {
 *         Name = "mywebhook",
 *         ResourceGroupName = example.Name,
 *         RegistryName = acr.Name,
 *         Location = example.Location,
 *         ServiceUri = "https://mywebhookreceiver.example/mytag",
 *         Status = "enabled",
 *         Scope = "mytag:*",
 *         Actions = new[]
 *         {
 *             "push",
 *         },
 *         CustomHeaders =
 *         {
 *             { "Content-Type", "application/json" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/containerservice"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		acr, err := containerservice.NewRegistry(ctx, "acr", &containerservice.RegistryArgs{
 * 			Name:              pulumi.String("containerRegistry1"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			Sku:               pulumi.String("Standard"),
 * 			AdminEnabled:      pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = containerservice.NewRegistryWebhook(ctx, "webhook", &containerservice.RegistryWebhookArgs{
 * 			Name:              pulumi.String("mywebhook"),
 * 			ResourceGroupName: example.Name,
 * 			RegistryName:      acr.Name,
 * 			Location:          example.Location,
 * 			ServiceUri:        pulumi.String("https://mywebhookreceiver.example/mytag"),
 * 			Status:            pulumi.String("enabled"),
 * 			Scope:             pulumi.String("mytag:*"),
 * 			Actions: pulumi.StringArray{
 * 				pulumi.String("push"),
 * 			},
 * 			CustomHeaders: pulumi.StringMap{
 * 				"Content-Type": pulumi.String("application/json"),
 * 			},
 * 		})
 * 		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.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.containerservice.Registry;
 * import com.pulumi.azure.containerservice.RegistryArgs;
 * import com.pulumi.azure.containerservice.RegistryWebhook;
 * import com.pulumi.azure.containerservice.RegistryWebhookArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var acr = new Registry("acr", RegistryArgs.builder()
 *             .name("containerRegistry1")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .sku("Standard")
 *             .adminEnabled(false)
 *             .build());
 *         var webhook = new RegistryWebhook("webhook", RegistryWebhookArgs.builder()
 *             .name("mywebhook")
 *             .resourceGroupName(example.name())
 *             .registryName(acr.name())
 *             .location(example.location())
 *             .serviceUri("https://mywebhookreceiver.example/mytag")
 *             .status("enabled")
 *             .scope("mytag:*")
 *             .actions("push")
 *             .customHeaders(Map.of("Content-Type", "application/json"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   acr:
 *     type: azure:containerservice:Registry
 *     properties:
 *       name: containerRegistry1
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       sku: Standard
 *       adminEnabled: false
 *   webhook:
 *     type: azure:containerservice:RegistryWebhook
 *     properties:
 *       name: mywebhook
 *       resourceGroupName: ${example.name}
 *       registryName: ${acr.name}
 *       location: ${example.location}
 *       serviceUri: https://mywebhookreceiver.example/mytag
 *       status: enabled
 *       scope: mytag:*
 *       actions:
 *         - push
 *       customHeaders:
 *         Content-Type: application/json
 * ```
 * 
 * ## Import
 * Container Registry Webhooks can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:containerservice/registryWebook:RegistryWebook example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ContainerRegistry/registries/myregistry1/webHooks/mywebhook1
 * ```
 * @property actions A list of actions that trigger the Webhook to post notifications. At least one action needs to be specified. Valid values are: `push`, `delete`, `quarantine`, `chart_push`, `chart_delete`
 * @property customHeaders Custom headers that will be added to the webhook notifications request.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property name Specifies the name of the Container Registry Webhook. Only Alphanumeric characters allowed. Changing this forces a new resource to be created.
 * @property registryName The Name of Container registry this Webhook belongs to. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which to create the Container Registry Webhook. Changing this forces a new resource to be created.
 * @property scope Specifies the scope of repositories that can trigger an event. For example, `foo:*` means events for all tags under repository `foo`. `foo:bar` means events for 'foo:bar' only. `foo` is equivalent to `foo:latest`. Empty means all events. Defaults to `""`.
 * @property serviceUri Specifies the service URI for the Webhook to post notifications.
 * @property status Specifies if this Webhook triggers notifications or not. Valid values: `enabled` and `disabled`. Default is `enabled`.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class RegistryWebookArgs
@Deprecated(
    message = """
azure.containerservice.RegistryWebook has been deprecated in favor of
    azure.containerservice.RegistryWebhook
""",
)
constructor(
    public val actions: Output>? = null,
    public val customHeaders: Output>? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val registryName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val scope: Output? = null,
    public val serviceUri: Output? = null,
    public val status: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.containerservice.RegistryWebookArgs =
        com.pulumi.azure.containerservice.RegistryWebookArgs.builder()
            .actions(actions?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .customHeaders(
                customHeaders?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .registryName(registryName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .scope(scope?.applyValue({ args0 -> args0 }))
            .serviceUri(serviceUri?.applyValue({ args0 -> args0 }))
            .status(status?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [RegistryWebookArgs].
 */
@PulumiTagMarker
@Deprecated(
    message = """
azure.containerservice.RegistryWebook has been deprecated in favor of
    azure.containerservice.RegistryWebhook
""",
)
public class RegistryWebookArgsBuilder internal constructor() {
    private var actions: Output>? = null

    private var customHeaders: Output>? = null

    private var location: Output? = null

    private var name: Output? = null

    private var registryName: Output? = null

    private var resourceGroupName: Output? = null

    private var scope: Output? = null

    private var serviceUri: Output? = null

    private var status: Output? = null

    private var tags: Output>? = null

    /**
     * @param value A list of actions that trigger the Webhook to post notifications. At least one action needs to be specified. Valid values are: `push`, `delete`, `quarantine`, `chart_push`, `chart_delete`
     */
    @JvmName("kncvdergnrcfjnmu")
    public suspend fun actions(`value`: Output>) {
        this.actions = value
    }

    @JvmName("cstaynkibgquqtrh")
    public suspend fun actions(vararg values: Output) {
        this.actions = Output.all(values.asList())
    }

    /**
     * @param values A list of actions that trigger the Webhook to post notifications. At least one action needs to be specified. Valid values are: `push`, `delete`, `quarantine`, `chart_push`, `chart_delete`
     */
    @JvmName("eitktnqxwmopeyrn")
    public suspend fun actions(values: List>) {
        this.actions = Output.all(values)
    }

    /**
     * @param value Custom headers that will be added to the webhook notifications request.
     */
    @JvmName("avxnhrafyssyhwtc")
    public suspend fun customHeaders(`value`: Output>) {
        this.customHeaders = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("tkrpdhsdwxsqniwq")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies the name of the Container Registry Webhook. Only Alphanumeric characters allowed. Changing this forces a new resource to be created.
     */
    @JvmName("snkgxlxksjpacvpo")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The Name of Container registry this Webhook belongs to. Changing this forces a new resource to be created.
     */
    @JvmName("fflgwmbncyaauukc")
    public suspend fun registryName(`value`: Output) {
        this.registryName = value
    }

    /**
     * @param value The name of the resource group in which to create the Container Registry Webhook. Changing this forces a new resource to be created.
     */
    @JvmName("jikqgbqlexwvlqne")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the scope of repositories that can trigger an event. For example, `foo:*` means events for all tags under repository `foo`. `foo:bar` means events for 'foo:bar' only. `foo` is equivalent to `foo:latest`. Empty means all events. Defaults to `""`.
     */
    @JvmName("waapybsdfhjvwhkb")
    public suspend fun scope(`value`: Output) {
        this.scope = value
    }

    /**
     * @param value Specifies the service URI for the Webhook to post notifications.
     */
    @JvmName("kyrqhwcyqofpbdex")
    public suspend fun serviceUri(`value`: Output) {
        this.serviceUri = value
    }

    /**
     * @param value Specifies if this Webhook triggers notifications or not. Valid values: `enabled` and `disabled`. Default is `enabled`.
     */
    @JvmName("lvhwuhttacknhcia")
    public suspend fun status(`value`: Output) {
        this.status = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("fsdhwqvjpqeunkhg")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value A list of actions that trigger the Webhook to post notifications. At least one action needs to be specified. Valid values are: `push`, `delete`, `quarantine`, `chart_push`, `chart_delete`
     */
    @JvmName("kqxdgueqqtwniaok")
    public suspend fun actions(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param values A list of actions that trigger the Webhook to post notifications. At least one action needs to be specified. Valid values are: `push`, `delete`, `quarantine`, `chart_push`, `chart_delete`
     */
    @JvmName("wtxrsyxnaaljueal")
    public suspend fun actions(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.actions = mapped
    }

    /**
     * @param value Custom headers that will be added to the webhook notifications request.
     */
    @JvmName("sjcsxosghyncbvme")
    public suspend fun customHeaders(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.customHeaders = mapped
    }

    /**
     * @param values Custom headers that will be added to the webhook notifications request.
     */
    @JvmName("drudjepempavoiwa")
    public fun customHeaders(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.customHeaders = mapped
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("pyiftgirfnxhphbg")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies the name of the Container Registry Webhook. Only Alphanumeric characters allowed. Changing this forces a new resource to be created.
     */
    @JvmName("mxxjwhyyfgrkwamv")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The Name of Container registry this Webhook belongs to. Changing this forces a new resource to be created.
     */
    @JvmName("sfsdsjkeuhdpqebq")
    public suspend fun registryName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.registryName = mapped
    }

    /**
     * @param value The name of the resource group in which to create the Container Registry Webhook. Changing this forces a new resource to be created.
     */
    @JvmName("mhhnfwrglxpfkbwe")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value Specifies the scope of repositories that can trigger an event. For example, `foo:*` means events for all tags under repository `foo`. `foo:bar` means events for 'foo:bar' only. `foo` is equivalent to `foo:latest`. Empty means all events. Defaults to `""`.
     */
    @JvmName("gudlnlejrshimmsi")
    public suspend fun scope(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.scope = mapped
    }

    /**
     * @param value Specifies the service URI for the Webhook to post notifications.
     */
    @JvmName("rwgpoclhhtjudsau")
    public suspend fun serviceUri(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serviceUri = mapped
    }

    /**
     * @param value Specifies if this Webhook triggers notifications or not. Valid values: `enabled` and `disabled`. Default is `enabled`.
     */
    @JvmName("savnnkcbnjulrajc")
    public suspend fun status(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.status = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("lcxdlriogvefvyav")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("djfalkxupkhpltdq")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): RegistryWebookArgs = RegistryWebookArgs(
        actions = actions,
        customHeaders = customHeaders,
        location = location,
        name = name,
        registryName = registryName,
        resourceGroupName = resourceGroupName,
        scope = scope,
        serviceUri = serviceUri,
        status = status,
        tags = tags,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy