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

com.pulumi.azurenative.kusto.kotlin.ReadOnlyFollowingDatabase.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.kusto.kotlin

import com.pulumi.azurenative.kusto.kotlin.outputs.DatabaseStatisticsResponse
import com.pulumi.azurenative.kusto.kotlin.outputs.TableLevelSharingPropertiesResponse
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 com.pulumi.azurenative.kusto.kotlin.outputs.DatabaseStatisticsResponse.Companion.toKotlin as databaseStatisticsResponseToKotlin
import com.pulumi.azurenative.kusto.kotlin.outputs.TableLevelSharingPropertiesResponse.Companion.toKotlin as tableLevelSharingPropertiesResponseToKotlin

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

    public var args: ReadOnlyFollowingDatabaseArgs = ReadOnlyFollowingDatabaseArgs()

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

/**
 * Class representing a read only following database.
 * Azure REST API version: 2022-12-29. Prior API version in Azure Native 1.x: 2021-01-01.
 * ## Example Usage
 * ### Kusto ReadOnly database update
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var readOnlyFollowingDatabase = new AzureNative.Kusto.ReadOnlyFollowingDatabase("readOnlyFollowingDatabase", new()
 *     {
 *         ClusterName = "kustoCluster",
 *         DatabaseName = "kustoReadOnlyDatabase",
 *         HotCachePeriod = "P1D",
 *         Kind = "ReadOnlyFollowing",
 *         Location = "westus",
 *         ResourceGroupName = "kustorptest",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	kusto "github.com/pulumi/pulumi-azure-native-sdk/kusto/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := kusto.NewReadOnlyFollowingDatabase(ctx, "readOnlyFollowingDatabase", &kusto.ReadOnlyFollowingDatabaseArgs{
 * 			ClusterName:       pulumi.String("kustoCluster"),
 * 			DatabaseName:      pulumi.String("kustoReadOnlyDatabase"),
 * 			HotCachePeriod:    pulumi.String("P1D"),
 * 			Kind:              pulumi.String("ReadOnlyFollowing"),
 * 			Location:          pulumi.String("westus"),
 * 			ResourceGroupName: pulumi.String("kustorptest"),
 * 		})
 * 		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.kusto.ReadOnlyFollowingDatabase;
 * import com.pulumi.azurenative.kusto.ReadOnlyFollowingDatabaseArgs;
 * 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 readOnlyFollowingDatabase = new ReadOnlyFollowingDatabase("readOnlyFollowingDatabase", ReadOnlyFollowingDatabaseArgs.builder()
 *             .clusterName("kustoCluster")
 *             .databaseName("kustoReadOnlyDatabase")
 *             .hotCachePeriod("P1D")
 *             .kind("ReadOnlyFollowing")
 *             .location("westus")
 *             .resourceGroupName("kustorptest")
 *             .build());
 *     }
 * }
 * ```
 * ### Kusto ReadWrite database create or update
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var readOnlyFollowingDatabase = new AzureNative.Kusto.ReadOnlyFollowingDatabase("readOnlyFollowingDatabase", new()
 *     {
 *         CallerRole = "Admin",
 *         ClusterName = "kustoCluster",
 *         DatabaseName = "KustoDatabase8",
 *         ResourceGroupName = "kustorptest",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	kusto "github.com/pulumi/pulumi-azure-native-sdk/kusto/v2"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := kusto.NewReadOnlyFollowingDatabase(ctx, "readOnlyFollowingDatabase", &kusto.ReadOnlyFollowingDatabaseArgs{
 * 			CallerRole:        pulumi.String("Admin"),
 * 			ClusterName:       pulumi.String("kustoCluster"),
 * 			DatabaseName:      pulumi.String("KustoDatabase8"),
 * 			ResourceGroupName: pulumi.String("kustorptest"),
 * 		})
 * 		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.kusto.ReadOnlyFollowingDatabase;
 * import com.pulumi.azurenative.kusto.ReadOnlyFollowingDatabaseArgs;
 * 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 readOnlyFollowingDatabase = new ReadOnlyFollowingDatabase("readOnlyFollowingDatabase", ReadOnlyFollowingDatabaseArgs.builder()
 *             .callerRole("Admin")
 *             .clusterName("kustoCluster")
 *             .databaseName("KustoDatabase8")
 *             .resourceGroupName("kustorptest")
 *             .build());
 *     }
 * }
 * ```
 * ## Import
 * An existing resource can be imported using its type token, name, and identifier, e.g.
 * ```sh
 * $ pulumi import azure-native:kusto:ReadOnlyFollowingDatabase kustoCluster/KustoDatabase8 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Kusto/clusters/{clusterName}/databases/{databaseName}
 * ```
 */
public class ReadOnlyFollowingDatabase internal constructor(
    override val javaResource: com.pulumi.azurenative.kusto.ReadOnlyFollowingDatabase,
) : KotlinCustomResource(javaResource, ReadOnlyFollowingDatabaseMapper) {
    /**
     * The name of the attached database configuration cluster
     */
    public val attachedDatabaseConfigurationName: Output
        get() = javaResource.attachedDatabaseConfigurationName().applyValue({ args0 -> args0 })

    /**
     * The origin of the following setup.
     */
    public val databaseShareOrigin: Output
        get() = javaResource.databaseShareOrigin().applyValue({ args0 -> args0 })

    /**
     * The time the data should be kept in cache for fast queries in TimeSpan.
     */
    public val hotCachePeriod: Output?
        get() = javaResource.hotCachePeriod().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Kind of the database
     * Expected value is 'ReadOnlyFollowing'.
     */
    public val kind: Output
        get() = javaResource.kind().applyValue({ args0 -> args0 })

    /**
     * The name of the leader cluster
     */
    public val leaderClusterResourceId: Output
        get() = javaResource.leaderClusterResourceId().applyValue({ args0 -> args0 })

    /**
     * Resource location.
     */
    public val location: Output?
        get() = javaResource.location().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })

    /**
     * The name of the resource
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    /**
     * The original database name, before databaseNameOverride or databaseNamePrefix where applied.
     */
    public val originalDatabaseName: Output
        get() = javaResource.originalDatabaseName().applyValue({ args0 -> args0 })

    /**
     * The principals modification kind of the database
     */
    public val principalsModificationKind: Output
        get() = javaResource.principalsModificationKind().applyValue({ args0 -> args0 })

    /**
     * The provisioned state of the resource.
     */
    public val provisioningState: Output
        get() = javaResource.provisioningState().applyValue({ args0 -> args0 })

    /**
     * The time the data should be kept before it stops being accessible to queries in TimeSpan.
     */
    public val softDeletePeriod: Output
        get() = javaResource.softDeletePeriod().applyValue({ args0 -> args0 })

    /**
     * The statistics of the database.
     */
    public val statistics: Output
        get() = javaResource.statistics().applyValue({ args0 ->
            args0.let({ args0 ->
                databaseStatisticsResponseToKotlin(args0)
            })
        })

    /**
     * Table level sharing specifications
     */
    public val tableLevelSharingProperties: Output
        get() = javaResource.tableLevelSharingProperties().applyValue({ args0 ->
            args0.let({ args0 ->
                tableLevelSharingPropertiesResponseToKotlin(args0)
            })
        })

    /**
     * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
     */
    public val type: Output
        get() = javaResource.type().applyValue({ args0 -> args0 })
}

public object ReadOnlyFollowingDatabaseMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.azurenative.kusto.ReadOnlyFollowingDatabase::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy