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

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

package com.pulumi.azure.eventhub.kotlin

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

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

    public var args: NamespaceSchemaGroupArgs = NamespaceSchemaGroupArgs()

    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 NamespaceSchemaGroupArgsBuilder.() -> Unit) {
        val builder = NamespaceSchemaGroupArgsBuilder()
        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(): NamespaceSchemaGroup {
        val builtJavaResource = com.pulumi.azure.eventhub.NamespaceSchemaGroup(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return NamespaceSchemaGroup(builtJavaResource)
    }
}

/**
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "exampleRG-ehn-schemaGroup",
 *     location: "East US",
 * });
 * const test = new azure.eventhub.EventHubNamespace("test", {
 *     name: "example-ehn-schemaGroup",
 *     location: testAzurermResourceGroup.location,
 *     resourceGroupName: testAzurermResourceGroup.name,
 *     sku: "Standard",
 * });
 * const testNamespaceSchemaGroup = new azure.eventhub.NamespaceSchemaGroup("test", {
 *     name: "example-schemaGroup",
 *     namespaceId: test.id,
 *     schemaCompatibility: "Forward",
 *     schemaType: "Avro",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="exampleRG-ehn-schemaGroup",
 *     location="East US")
 * test = azure.eventhub.EventHubNamespace("test",
 *     name="example-ehn-schemaGroup",
 *     location=test_azurerm_resource_group["location"],
 *     resource_group_name=test_azurerm_resource_group["name"],
 *     sku="Standard")
 * test_namespace_schema_group = azure.eventhub.NamespaceSchemaGroup("test",
 *     name="example-schemaGroup",
 *     namespace_id=test.id,
 *     schema_compatibility="Forward",
 *     schema_type="Avro")
 * ```
 * ```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 = "exampleRG-ehn-schemaGroup",
 *         Location = "East US",
 *     });
 *     var test = new Azure.EventHub.EventHubNamespace("test", new()
 *     {
 *         Name = "example-ehn-schemaGroup",
 *         Location = testAzurermResourceGroup.Location,
 *         ResourceGroupName = testAzurermResourceGroup.Name,
 *         Sku = "Standard",
 *     });
 *     var testNamespaceSchemaGroup = new Azure.EventHub.NamespaceSchemaGroup("test", new()
 *     {
 *         Name = "example-schemaGroup",
 *         NamespaceId = test.Id,
 *         SchemaCompatibility = "Forward",
 *         SchemaType = "Avro",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/eventhub"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("exampleRG-ehn-schemaGroup"),
 * 			Location: pulumi.String("East US"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		test, err := eventhub.NewEventHubNamespace(ctx, "test", &eventhub.EventHubNamespaceArgs{
 * 			Name:              pulumi.String("example-ehn-schemaGroup"),
 * 			Location:          pulumi.Any(testAzurermResourceGroup.Location),
 * 			ResourceGroupName: pulumi.Any(testAzurermResourceGroup.Name),
 * 			Sku:               pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = eventhub.NewNamespaceSchemaGroup(ctx, "test", &eventhub.NamespaceSchemaGroupArgs{
 * 			Name:                pulumi.String("example-schemaGroup"),
 * 			NamespaceId:         test.ID(),
 * 			SchemaCompatibility: pulumi.String("Forward"),
 * 			SchemaType:          pulumi.String("Avro"),
 * 		})
 * 		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.eventhub.EventHubNamespace;
 * import com.pulumi.azure.eventhub.EventHubNamespaceArgs;
 * import com.pulumi.azure.eventhub.NamespaceSchemaGroup;
 * import com.pulumi.azure.eventhub.NamespaceSchemaGroupArgs;
 * 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("exampleRG-ehn-schemaGroup")
 *             .location("East US")
 *             .build());
 *         var test = new EventHubNamespace("test", EventHubNamespaceArgs.builder()
 *             .name("example-ehn-schemaGroup")
 *             .location(testAzurermResourceGroup.location())
 *             .resourceGroupName(testAzurermResourceGroup.name())
 *             .sku("Standard")
 *             .build());
 *         var testNamespaceSchemaGroup = new NamespaceSchemaGroup("testNamespaceSchemaGroup", NamespaceSchemaGroupArgs.builder()
 *             .name("example-schemaGroup")
 *             .namespaceId(test.id())
 *             .schemaCompatibility("Forward")
 *             .schemaType("Avro")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: exampleRG-ehn-schemaGroup
 *       location: East US
 *   test:
 *     type: azure:eventhub:EventHubNamespace
 *     properties:
 *       name: example-ehn-schemaGroup
 *       location: ${testAzurermResourceGroup.location}
 *       resourceGroupName: ${testAzurermResourceGroup.name}
 *       sku: Standard
 *   testNamespaceSchemaGroup:
 *     type: azure:eventhub:NamespaceSchemaGroup
 *     name: test
 *     properties:
 *       name: example-schemaGroup
 *       namespaceId: ${test.id}
 *       schemaCompatibility: Forward
 *       schemaType: Avro
 * ```
 * 
 * ## Import
 * Schema Group for a EventHub Namespace can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:eventhub/namespaceSchemaGroup:NamespaceSchemaGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.EventHub/namespaces/namespace1/schemaGroups/group1
 * ```
 */
public class NamespaceSchemaGroup internal constructor(
    override val javaResource: com.pulumi.azure.eventhub.NamespaceSchemaGroup,
) : KotlinCustomResource(javaResource, NamespaceSchemaGroupMapper) {
    /**
     * Specifies the name of this schema group. Changing this forces a new resource to be created.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * Specifies the ID of the EventHub Namespace. Changing this forces a new resource to be created.
     */
    public val namespaceId: Output
        get() = javaResource.namespaceId().applyValue({ args0 -> args0 })

    /**
     * Specifies the compatibility of this schema group. Possible values are `None`, `Backward`, `Forward`. Changing this forces a new resource to be created.
     */
    public val schemaCompatibility: Output
        get() = javaResource.schemaCompatibility().applyValue({ args0 -> args0 })

    /**
     * Specifies the Type of this schema group. Possible values are `Avro`, `Unknown`. Changing this forces a new resource to be created.
     */
    public val schemaType: Output
        get() = javaResource.schemaType().applyValue({ args0 -> args0 })
}

public object NamespaceSchemaGroupMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azure.eventhub.NamespaceSchemaGroup::class == javaResource::class

    override fun map(javaResource: Resource): NamespaceSchemaGroup = NamespaceSchemaGroup(
        javaResource
            as com.pulumi.azure.eventhub.NamespaceSchemaGroup,
    )
}

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy