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

com.pulumi.azurenative.testbase.kotlin.CustomerEvent.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.testbase.kotlin

import com.pulumi.azurenative.testbase.kotlin.outputs.NotificationEventReceiverResponse
import com.pulumi.azurenative.testbase.kotlin.outputs.SystemDataResponse
import com.pulumi.core.Output
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 kotlin.collections.List
import com.pulumi.azurenative.testbase.kotlin.outputs.NotificationEventReceiverResponse.Companion.toKotlin as notificationEventReceiverResponseToKotlin
import com.pulumi.azurenative.testbase.kotlin.outputs.SystemDataResponse.Companion.toKotlin as systemDataResponseToKotlin

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

    public var args: CustomerEventArgs = CustomerEventArgs()

    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 CustomerEventArgsBuilder.() -> Unit) {
        val builder = CustomerEventArgsBuilder()
        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(): CustomerEvent {
        val builtJavaResource = com.pulumi.azurenative.testbase.CustomerEvent(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return CustomerEvent(builtJavaResource)
    }
}

/**
 * The Customer Notification Event resource.
 * Azure REST API version: 2022-04-01-preview. Prior API version in Azure Native 1.x: 2022-04-01-preview.
 * Other available API versions: 2023-11-01-preview.
 * ## Example Usage
 * ### CustomerEventCreate
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var customerEvent = new AzureNative.TestBase.CustomerEvent("customerEvent", new()
 *     {
 *         CustomerEventName = "WeeklySummary",
 *         EventName = "WeeklySummary",
 *         Receivers = new[]
 *         {
 *             new AzureNative.TestBase.Inputs.NotificationEventReceiverArgs
 *             {
 *                 ReceiverType = "UserObjects",
 *                 ReceiverValue = new AzureNative.TestBase.Inputs.NotificationReceiverValueArgs
 *                 {
 *                     UserObjectReceiverValue = new AzureNative.TestBase.Inputs.UserObjectReceiverValueArgs
 *                     {
 *                         UserObjectIds = new[]
 *                         {
 *                             "245245245245325",
 *                             "365365365363565",
 *                         },
 *                     },
 *                 },
 *             },
 *             new AzureNative.TestBase.Inputs.NotificationEventReceiverArgs
 *             {
 *                 ReceiverType = "DistributionGroup",
 *                 ReceiverValue = new AzureNative.TestBase.Inputs.NotificationReceiverValueArgs
 *                 {
 *                     DistributionGroupListReceiverValue = new AzureNative.TestBase.Inputs.DistributionGroupListReceiverValueArgs
 *                     {
 *                         DistributionGroups = new[]
 *                         {
 *                             "[email protected]",
 *                         },
 *                     },
 *                 },
 *             },
 *         },
 *         ResourceGroupName = "contoso-rg1",
 *         TestBaseAccountName = "contoso-testBaseAccount1",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	testbase "github.com/pulumi/pulumi-azure-native-sdk/testbase/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := testbase.NewCustomerEvent(ctx, "customerEvent", &testbase.CustomerEventArgs{
 * 			CustomerEventName: pulumi.String("WeeklySummary"),
 * 			EventName:         pulumi.String("WeeklySummary"),
 * 			Receivers: testbase.NotificationEventReceiverArray{
 * 				&testbase.NotificationEventReceiverArgs{
 * 					ReceiverType: pulumi.String("UserObjects"),
 * 					ReceiverValue: &testbase.NotificationReceiverValueArgs{
 * 						UserObjectReceiverValue: &testbase.UserObjectReceiverValueArgs{
 * 							UserObjectIds: pulumi.StringArray{
 * 								pulumi.String("245245245245325"),
 * 								pulumi.String("365365365363565"),
 * 							},
 * 						},
 * 					},
 * 				},
 * 				&testbase.NotificationEventReceiverArgs{
 * 					ReceiverType: pulumi.String("DistributionGroup"),
 * 					ReceiverValue: &testbase.NotificationReceiverValueArgs{
 * 						DistributionGroupListReceiverValue: &testbase.DistributionGroupListReceiverValueArgs{
 * 							DistributionGroups: pulumi.StringArray{
 * 								pulumi.String("[email protected]"),
 * 							},
 * 						},
 * 					},
 * 				},
 * 			},
 * 			ResourceGroupName:   pulumi.String("contoso-rg1"),
 * 			TestBaseAccountName: pulumi.String("contoso-testBaseAccount1"),
 * 		})
 * 		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.testbase.CustomerEvent;
 * import com.pulumi.azurenative.testbase.CustomerEventArgs;
 * import com.pulumi.azurenative.testbase.inputs.NotificationEventReceiverArgs;
 * import com.pulumi.azurenative.testbase.inputs.NotificationReceiverValueArgs;
 * import com.pulumi.azurenative.testbase.inputs.UserObjectReceiverValueArgs;
 * import com.pulumi.azurenative.testbase.inputs.DistributionGroupListReceiverValueArgs;
 * 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 customerEvent = new CustomerEvent("customerEvent", CustomerEventArgs.builder()
 *             .customerEventName("WeeklySummary")
 *             .eventName("WeeklySummary")
 *             .receivers(
 *                 NotificationEventReceiverArgs.builder()
 *                     .receiverType("UserObjects")
 *                     .receiverValue(NotificationReceiverValueArgs.builder()
 *                         .userObjectReceiverValue(UserObjectReceiverValueArgs.builder()
 *                             .userObjectIds(
 *                                 "245245245245325",
 *                                 "365365365363565")
 *                             .build())
 *                         .build())
 *                     .build(),
 *                 NotificationEventReceiverArgs.builder()
 *                     .receiverType("DistributionGroup")
 *                     .receiverValue(NotificationReceiverValueArgs.builder()
 *                         .distributionGroupListReceiverValue(DistributionGroupListReceiverValueArgs.builder()
 *                             .distributionGroups("[email protected]")
 *                             .build())
 *                         .build())
 *                     .build())
 *             .resourceGroupName("contoso-rg1")
 *             .testBaseAccountName("contoso-testBaseAccount1")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:testbase:CustomerEvent WeeklySummary /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TestBase/testBaseAccounts/{testBaseAccountName}/customerEvents/{customerEventName}
 * ```
 */
public class CustomerEvent internal constructor(
    override val javaResource: com.pulumi.azurenative.testbase.CustomerEvent,
) : KotlinCustomResource(javaResource, CustomerEventMapper) {
    /**
     * The name of the event subscribed to.
     */
    public val eventName: Output
        get() = javaResource.eventName().applyValue({ args0 -> args0 })

    /**
     * Resource name.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The notification event receivers.
     */
    public val receivers: Output>
        get() = javaResource.receivers().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    notificationEventReceiverResponseToKotlin(args0)
                })
            })
        })

    /**
     * The system metadata relating to this resource
     */
    public val systemData: Output
        get() = javaResource.systemData().applyValue({ args0 ->
            args0.let({ args0 ->
                systemDataResponseToKotlin(args0)
            })
        })

    /**
     * Resource type.
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object CustomerEventMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.testbase.CustomerEvent::class == javaResource::class

    override fun map(javaResource: Resource): CustomerEvent = CustomerEvent(
        javaResource as
            com.pulumi.azurenative.testbase.CustomerEvent,
    )
}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy