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

com.pulumi.azure.sql.kotlin.DatabaseArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.sql.kotlin

import com.pulumi.azure.sql.DatabaseArgs.builder
import com.pulumi.azure.sql.kotlin.inputs.DatabaseImportArgs
import com.pulumi.azure.sql.kotlin.inputs.DatabaseImportArgsBuilder
import com.pulumi.azure.sql.kotlin.inputs.DatabaseThreatDetectionPolicyArgs
import com.pulumi.azure.sql.kotlin.inputs.DatabaseThreatDetectionPolicyArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * ## 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 exampleSqlServer = new azure.sql.SqlServer("example", {
 *     name: "myexamplesqlserver",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     version: "12.0",
 *     administratorLogin: "4dm1n157r470r",
 *     administratorLoginPassword: "4-v3ry-53cr37-p455w0rd",
 *     tags: {
 *         environment: "production",
 *     },
 * });
 * const exampleAccount = new azure.storage.Account("example", {
 *     name: "examplesa",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     accountTier: "Standard",
 *     accountReplicationType: "LRS",
 * });
 * const exampleDatabase = new azure.sql.Database("example", {
 *     name: "myexamplesqldatabase",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     serverName: exampleSqlServer.name,
 *     tags: {
 *         environment: "production",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_sql_server = azure.sql.SqlServer("example",
 *     name="myexamplesqlserver",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     version="12.0",
 *     administrator_login="4dm1n157r470r",
 *     administrator_login_password="4-v3ry-53cr37-p455w0rd",
 *     tags={
 *         "environment": "production",
 *     })
 * example_account = azure.storage.Account("example",
 *     name="examplesa",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     account_tier="Standard",
 *     account_replication_type="LRS")
 * example_database = azure.sql.Database("example",
 *     name="myexamplesqldatabase",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     server_name=example_sql_server.name,
 *     tags={
 *         "environment": "production",
 *     })
 * ```
 * ```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 exampleSqlServer = new Azure.Sql.SqlServer("example", new()
 *     {
 *         Name = "myexamplesqlserver",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         Version = "12.0",
 *         AdministratorLogin = "4dm1n157r470r",
 *         AdministratorLoginPassword = "4-v3ry-53cr37-p455w0rd",
 *         Tags =
 *         {
 *             { "environment", "production" },
 *         },
 *     });
 *     var exampleAccount = new Azure.Storage.Account("example", new()
 *     {
 *         Name = "examplesa",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         AccountTier = "Standard",
 *         AccountReplicationType = "LRS",
 *     });
 *     var exampleDatabase = new Azure.Sql.Database("example", new()
 *     {
 *         Name = "myexamplesqldatabase",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         ServerName = exampleSqlServer.Name,
 *         Tags =
 *         {
 *             { "environment", "production" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/sql"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
 * 	"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
 * 		}
 * 		exampleSqlServer, err := sql.NewSqlServer(ctx, "example", &sql.SqlServerArgs{
 * 			Name:                       pulumi.String("myexamplesqlserver"),
 * 			ResourceGroupName:          example.Name,
 * 			Location:                   example.Location,
 * 			Version:                    pulumi.String("12.0"),
 * 			AdministratorLogin:         pulumi.String("4dm1n157r470r"),
 * 			AdministratorLoginPassword: pulumi.String("4-v3ry-53cr37-p455w0rd"),
 * 			Tags: pulumi.StringMap{
 * 				"environment": pulumi.String("production"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = storage.NewAccount(ctx, "example", &storage.AccountArgs{
 * 			Name:                   pulumi.String("examplesa"),
 * 			ResourceGroupName:      example.Name,
 * 			Location:               example.Location,
 * 			AccountTier:            pulumi.String("Standard"),
 * 			AccountReplicationType: pulumi.String("LRS"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = sql.NewDatabase(ctx, "example", &sql.DatabaseArgs{
 * 			Name:              pulumi.String("myexamplesqldatabase"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			ServerName:        exampleSqlServer.Name,
 * 			Tags: pulumi.StringMap{
 * 				"environment": pulumi.String("production"),
 * 			},
 * 		})
 * 		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.sql.SqlServer;
 * import com.pulumi.azure.sql.SqlServerArgs;
 * import com.pulumi.azure.storage.Account;
 * import com.pulumi.azure.storage.AccountArgs;
 * import com.pulumi.azure.sql.Database;
 * import com.pulumi.azure.sql.DatabaseArgs;
 * 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 exampleSqlServer = new SqlServer("exampleSqlServer", SqlServerArgs.builder()
 *             .name("myexamplesqlserver")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .version("12.0")
 *             .administratorLogin("4dm1n157r470r")
 *             .administratorLoginPassword("4-v3ry-53cr37-p455w0rd")
 *             .tags(Map.of("environment", "production"))
 *             .build());
 *         var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
 *             .name("examplesa")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .accountTier("Standard")
 *             .accountReplicationType("LRS")
 *             .build());
 *         var exampleDatabase = new Database("exampleDatabase", DatabaseArgs.builder()
 *             .name("myexamplesqldatabase")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .serverName(exampleSqlServer.name())
 *             .tags(Map.of("environment", "production"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleSqlServer:
 *     type: azure:sql:SqlServer
 *     name: example
 *     properties:
 *       name: myexamplesqlserver
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       version: '12.0'
 *       administratorLogin: 4dm1n157r470r
 *       administratorLoginPassword: 4-v3ry-53cr37-p455w0rd
 *       tags:
 *         environment: production
 *   exampleAccount:
 *     type: azure:storage:Account
 *     name: example
 *     properties:
 *       name: examplesa
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       accountTier: Standard
 *       accountReplicationType: LRS
 *   exampleDatabase:
 *     type: azure:sql:Database
 *     name: example
 *     properties:
 *       name: myexamplesqldatabase
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       serverName: ${exampleSqlServer.name}
 *       tags:
 *         environment: production
 * ```
 * 
 * ## Import
 * SQL Databases can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:sql/database:Database database1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myresourcegroup/providers/Microsoft.Sql/servers/myserver/databases/database1
 * ```
 * @property collation The name of the collation. Applies only if `create_mode` is `Default`. Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.
 * @property createMode Specifies how to create the database. Valid values are: `Default`, `Copy`, `OnlineSecondary`, `NonReadableSecondary`, `PointInTimeRestore`, `Recovery`, `Restore` or `RestoreLongTermRetentionBackup`. Must be `Default` to create a new database. Defaults to `Default`. Please see [Azure SQL Database REST API](https://docs.microsoft.com/rest/api/sql/databases/createorupdate#createmode)
 * @property edition The edition of the database to be created. Applies only if `create_mode` is `Default`. Valid values are: `Basic`, `Standard`, `Premium`, `DataWarehouse`, `Business`, `BusinessCritical`, `Free`, `GeneralPurpose`, `Hyperscale`, `Premium`, `PremiumRS`, `Standard`, `Stretch`, `System`, `System2`, or `Web`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
 * @property elasticPoolName The name of the elastic database pool.
 * @property import A `import` block as documented below. `create_mode` must be set to `Default`.
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property maxSizeBytes The maximum size that the database can grow to. Applies only if `create_mode` is `Default`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
 * @property maxSizeGb
 * @property name The name of the database. Changing this forces a new resource to be created.
 * @property readScale Read-only connections will be redirected to a high-available replica. Please see [Use read-only replicas to load-balance read-only query workloads](https://docs.microsoft.com/azure/sql-database/sql-database-read-scale-out).
 * @property requestedServiceObjectiveId A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level.
 * .
 * @property requestedServiceObjectiveName The service objective name for the database. Valid values depend on edition and location and may include `S0`, `S1`, `S2`, `S3`, `P1`, `P2`, `P4`, `P6`, `P11` and `ElasticPool`. You can list the available names with the CLI: `shell az sql db list-editions -l westus -o table`. For further information please see [Azure CLI - az sql db](https://docs.microsoft.com/cli/azure/sql/db?view=azure-cli-latest#az-sql-db-list-editions).
 * @property resourceGroupName The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
 * @property restorePointInTime The point in time for the restore. Only applies if `create_mode` is `PointInTimeRestore`, it should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
 * @property serverName The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
 * @property sourceDatabaseDeletionDate The deletion date time of the source database. Only applies to deleted databases where `create_mode` is `PointInTimeRestore`.
 * @property sourceDatabaseId The URI of the source database if `create_mode` value is not `Default`.
 * @property tags A mapping of tags to assign to the resource.
 * @property threatDetectionPolicy Threat detection policy configuration. The `threat_detection_policy` block supports fields documented below.
 * @property zoneRedundant Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
 */
public data class DatabaseArgs(
    public val collation: Output? = null,
    public val createMode: Output? = null,
    public val edition: Output? = null,
    public val elasticPoolName: Output? = null,
    public val `import`: Output? = null,
    public val location: Output? = null,
    public val maxSizeBytes: Output? = null,
    public val maxSizeGb: Output? = null,
    public val name: Output? = null,
    public val readScale: Output? = null,
    public val requestedServiceObjectiveId: Output? = null,
    public val requestedServiceObjectiveName: Output? = null,
    public val resourceGroupName: Output? = null,
    public val restorePointInTime: Output? = null,
    public val serverName: Output? = null,
    public val sourceDatabaseDeletionDate: Output? = null,
    public val sourceDatabaseId: Output? = null,
    public val tags: Output>? = null,
    public val threatDetectionPolicy: Output? = null,
    public val zoneRedundant: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.sql.DatabaseArgs =
        com.pulumi.azure.sql.DatabaseArgs.builder()
            .collation(collation?.applyValue({ args0 -> args0 }))
            .createMode(createMode?.applyValue({ args0 -> args0 }))
            .edition(edition?.applyValue({ args0 -> args0 }))
            .elasticPoolName(elasticPoolName?.applyValue({ args0 -> args0 }))
            .import_(`import`?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .location(location?.applyValue({ args0 -> args0 }))
            .maxSizeBytes(maxSizeBytes?.applyValue({ args0 -> args0 }))
            .maxSizeGb(maxSizeGb?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .readScale(readScale?.applyValue({ args0 -> args0 }))
            .requestedServiceObjectiveId(requestedServiceObjectiveId?.applyValue({ args0 -> args0 }))
            .requestedServiceObjectiveName(requestedServiceObjectiveName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .restorePointInTime(restorePointInTime?.applyValue({ args0 -> args0 }))
            .serverName(serverName?.applyValue({ args0 -> args0 }))
            .sourceDatabaseDeletionDate(sourceDatabaseDeletionDate?.applyValue({ args0 -> args0 }))
            .sourceDatabaseId(sourceDatabaseId?.applyValue({ args0 -> args0 }))
            .tags(tags?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .threatDetectionPolicy(
                threatDetectionPolicy?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .zoneRedundant(zoneRedundant?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [DatabaseArgs].
 */
@PulumiTagMarker
public class DatabaseArgsBuilder internal constructor() {
    private var collation: Output? = null

    private var createMode: Output? = null

    private var edition: Output? = null

    private var elasticPoolName: Output? = null

    private var `import`: Output? = null

    private var location: Output? = null

    private var maxSizeBytes: Output? = null

    private var maxSizeGb: Output? = null

    private var name: Output? = null

    private var readScale: Output? = null

    private var requestedServiceObjectiveId: Output? = null

    private var requestedServiceObjectiveName: Output? = null

    private var resourceGroupName: Output? = null

    private var restorePointInTime: Output? = null

    private var serverName: Output? = null

    private var sourceDatabaseDeletionDate: Output? = null

    private var sourceDatabaseId: Output? = null

    private var tags: Output>? = null

    private var threatDetectionPolicy: Output? = null

    private var zoneRedundant: Output? = null

    /**
     * @param value The name of the collation. Applies only if `create_mode` is `Default`. Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.
     */
    @JvmName("bvfbumyxyvyskftd")
    public suspend fun collation(`value`: Output) {
        this.collation = value
    }

    /**
     * @param value Specifies how to create the database. Valid values are: `Default`, `Copy`, `OnlineSecondary`, `NonReadableSecondary`, `PointInTimeRestore`, `Recovery`, `Restore` or `RestoreLongTermRetentionBackup`. Must be `Default` to create a new database. Defaults to `Default`. Please see [Azure SQL Database REST API](https://docs.microsoft.com/rest/api/sql/databases/createorupdate#createmode)
     */
    @JvmName("dcleuwehkknkcyxv")
    public suspend fun createMode(`value`: Output) {
        this.createMode = value
    }

    /**
     * @param value The edition of the database to be created. Applies only if `create_mode` is `Default`. Valid values are: `Basic`, `Standard`, `Premium`, `DataWarehouse`, `Business`, `BusinessCritical`, `Free`, `GeneralPurpose`, `Hyperscale`, `Premium`, `PremiumRS`, `Standard`, `Stretch`, `System`, `System2`, or `Web`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
     */
    @JvmName("ctyowyobjagpshko")
    public suspend fun edition(`value`: Output) {
        this.edition = value
    }

    /**
     * @param value The name of the elastic database pool.
     */
    @JvmName("omhxiylpffwsuxhf")
    public suspend fun elasticPoolName(`value`: Output) {
        this.elasticPoolName = value
    }

    /**
     * @param value A `import` block as documented below. `create_mode` must be set to `Default`.
     */
    @JvmName("wlhcmpovisdglqfl")
    public suspend fun `import`(`value`: Output) {
        this.`import` = value
    }

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

    /**
     * @param value The maximum size that the database can grow to. Applies only if `create_mode` is `Default`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
     */
    @JvmName("dcihpcpptjvpahxn")
    public suspend fun maxSizeBytes(`value`: Output) {
        this.maxSizeBytes = value
    }

    /**
     * @param value
     */
    @JvmName("crxxgasfwpqitmxx")
    public suspend fun maxSizeGb(`value`: Output) {
        this.maxSizeGb = value
    }

    /**
     * @param value The name of the database. Changing this forces a new resource to be created.
     */
    @JvmName("vshddajpdwnmthrn")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Read-only connections will be redirected to a high-available replica. Please see [Use read-only replicas to load-balance read-only query workloads](https://docs.microsoft.com/azure/sql-database/sql-database-read-scale-out).
     */
    @JvmName("qvaitcbyjbwgskpy")
    public suspend fun readScale(`value`: Output) {
        this.readScale = value
    }

    /**
     * @param value A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level.
     * .
     */
    @JvmName("ritdufdopsblsxlr")
    public suspend fun requestedServiceObjectiveId(`value`: Output) {
        this.requestedServiceObjectiveId = value
    }

    /**
     * @param value The service objective name for the database. Valid values depend on edition and location and may include `S0`, `S1`, `S2`, `S3`, `P1`, `P2`, `P4`, `P6`, `P11` and `ElasticPool`. You can list the available names with the CLI: `shell az sql db list-editions -l westus -o table`. For further information please see [Azure CLI - az sql db](https://docs.microsoft.com/cli/azure/sql/db?view=azure-cli-latest#az-sql-db-list-editions).
     */
    @JvmName("jreuknbkwevlnkjs")
    public suspend fun requestedServiceObjectiveName(`value`: Output) {
        this.requestedServiceObjectiveName = value
    }

    /**
     * @param value The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
     */
    @JvmName("puluexjtchacbviu")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value The point in time for the restore. Only applies if `create_mode` is `PointInTimeRestore`, it should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
     */
    @JvmName("ecfxjfnflveosmqg")
    public suspend fun restorePointInTime(`value`: Output) {
        this.restorePointInTime = value
    }

    /**
     * @param value The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
     */
    @JvmName("hmeolesahtwxnord")
    public suspend fun serverName(`value`: Output) {
        this.serverName = value
    }

    /**
     * @param value The deletion date time of the source database. Only applies to deleted databases where `create_mode` is `PointInTimeRestore`.
     */
    @JvmName("qthfwxjsjmxklnlq")
    public suspend fun sourceDatabaseDeletionDate(`value`: Output) {
        this.sourceDatabaseDeletionDate = value
    }

    /**
     * @param value The URI of the source database if `create_mode` value is not `Default`.
     */
    @JvmName("wdctchulkqlvwpxq")
    public suspend fun sourceDatabaseId(`value`: Output) {
        this.sourceDatabaseId = value
    }

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

    /**
     * @param value Threat detection policy configuration. The `threat_detection_policy` block supports fields documented below.
     */
    @JvmName("qdqttacgqfsionfh")
    public suspend fun threatDetectionPolicy(`value`: Output) {
        this.threatDetectionPolicy = value
    }

    /**
     * @param value Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
     */
    @JvmName("byamnmfdvdmdyjst")
    public suspend fun zoneRedundant(`value`: Output) {
        this.zoneRedundant = value
    }

    /**
     * @param value The name of the collation. Applies only if `create_mode` is `Default`. Azure default is `SQL_LATIN1_GENERAL_CP1_CI_AS`. Changing this forces a new resource to be created.
     */
    @JvmName("trkamgtyoeqvgave")
    public suspend fun collation(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.collation = mapped
    }

    /**
     * @param value Specifies how to create the database. Valid values are: `Default`, `Copy`, `OnlineSecondary`, `NonReadableSecondary`, `PointInTimeRestore`, `Recovery`, `Restore` or `RestoreLongTermRetentionBackup`. Must be `Default` to create a new database. Defaults to `Default`. Please see [Azure SQL Database REST API](https://docs.microsoft.com/rest/api/sql/databases/createorupdate#createmode)
     */
    @JvmName("bsxfccsxtayfsxiw")
    public suspend fun createMode(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.createMode = mapped
    }

    /**
     * @param value The edition of the database to be created. Applies only if `create_mode` is `Default`. Valid values are: `Basic`, `Standard`, `Premium`, `DataWarehouse`, `Business`, `BusinessCritical`, `Free`, `GeneralPurpose`, `Hyperscale`, `Premium`, `PremiumRS`, `Standard`, `Stretch`, `System`, `System2`, or `Web`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
     */
    @JvmName("cpjoljhlnklmrpby")
    public suspend fun edition(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.edition = mapped
    }

    /**
     * @param value The name of the elastic database pool.
     */
    @JvmName("iwsxkrejrkfunxgd")
    public suspend fun elasticPoolName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.elasticPoolName = mapped
    }

    /**
     * @param value A `import` block as documented below. `create_mode` must be set to `Default`.
     */
    @JvmName("cwefsufdbapykacq")
    public suspend fun `import`(`value`: DatabaseImportArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`import` = mapped
    }

    /**
     * @param argument A `import` block as documented below. `create_mode` must be set to `Default`.
     */
    @JvmName("emyxqnhlragolkey")
    public suspend fun `import`(argument: suspend DatabaseImportArgsBuilder.() -> Unit) {
        val toBeMapped = DatabaseImportArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.`import` = mapped
    }

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

    /**
     * @param value The maximum size that the database can grow to. Applies only if `create_mode` is `Default`. Please see [Azure SQL database models](https://docs.microsoft.com/azure/azure-sql/database/purchasing-models?view=azuresql).
     */
    @JvmName("cumyhhtsmrbbxoig")
    public suspend fun maxSizeBytes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.maxSizeBytes = mapped
    }

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

    /**
     * @param value The name of the database. Changing this forces a new resource to be created.
     */
    @JvmName("hxprpdonknqebgdp")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Read-only connections will be redirected to a high-available replica. Please see [Use read-only replicas to load-balance read-only query workloads](https://docs.microsoft.com/azure/sql-database/sql-database-read-scale-out).
     */
    @JvmName("ajofqwmnryoaqsgf")
    public suspend fun readScale(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.readScale = mapped
    }

    /**
     * @param value A GUID/UUID corresponding to a configured Service Level Objective for the Azure SQL database which can be used to configure a performance level.
     * .
     */
    @JvmName("muqqwlattnsgyhhh")
    public suspend fun requestedServiceObjectiveId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestedServiceObjectiveId = mapped
    }

    /**
     * @param value The service objective name for the database. Valid values depend on edition and location and may include `S0`, `S1`, `S2`, `S3`, `P1`, `P2`, `P4`, `P6`, `P11` and `ElasticPool`. You can list the available names with the CLI: `shell az sql db list-editions -l westus -o table`. For further information please see [Azure CLI - az sql db](https://docs.microsoft.com/cli/azure/sql/db?view=azure-cli-latest#az-sql-db-list-editions).
     */
    @JvmName("qxceqrdgitivbdsv")
    public suspend fun requestedServiceObjectiveName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestedServiceObjectiveName = mapped
    }

    /**
     * @param value The name of the resource group in which to create the database. This must be the same as Database Server resource group currently. Changing this forces a new resource to be created.
     */
    @JvmName("jjjeqkxysyuctpao")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value The point in time for the restore. Only applies if `create_mode` is `PointInTimeRestore`, it should be provided in [RFC3339](https://www.rfc-editor.org/rfc/rfc3339) format, e.g. `2013-11-08T22:00:40Z`.
     */
    @JvmName("lfsdeoalhscrpruw")
    public suspend fun restorePointInTime(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.restorePointInTime = mapped
    }

    /**
     * @param value The name of the SQL Server on which to create the database. Changing this forces a new resource to be created.
     */
    @JvmName("woamgqxikgxhwupw")
    public suspend fun serverName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverName = mapped
    }

    /**
     * @param value The deletion date time of the source database. Only applies to deleted databases where `create_mode` is `PointInTimeRestore`.
     */
    @JvmName("epajaecsykicjsuq")
    public suspend fun sourceDatabaseDeletionDate(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceDatabaseDeletionDate = mapped
    }

    /**
     * @param value The URI of the source database if `create_mode` value is not `Default`.
     */
    @JvmName("pnlkyrpnyopxjmro")
    public suspend fun sourceDatabaseId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sourceDatabaseId = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("asamdqywchwcmdwu")
    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("ubhglwkopgtcwkjw")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param value Threat detection policy configuration. The `threat_detection_policy` block supports fields documented below.
     */
    @JvmName("kpvnriddxwpliffj")
    public suspend fun threatDetectionPolicy(`value`: DatabaseThreatDetectionPolicyArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.threatDetectionPolicy = mapped
    }

    /**
     * @param argument Threat detection policy configuration. The `threat_detection_policy` block supports fields documented below.
     */
    @JvmName("rmkroairvfjxaait")
    public suspend fun threatDetectionPolicy(argument: suspend DatabaseThreatDetectionPolicyArgsBuilder.() -> Unit) {
        val toBeMapped = DatabaseThreatDetectionPolicyArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.threatDetectionPolicy = mapped
    }

    /**
     * @param value Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones.
     */
    @JvmName("rrqmqtgwxqybljea")
    public suspend fun zoneRedundant(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.zoneRedundant = mapped
    }

    internal fun build(): DatabaseArgs = DatabaseArgs(
        collation = collation,
        createMode = createMode,
        edition = edition,
        elasticPoolName = elasticPoolName,
        `import` = `import`,
        location = location,
        maxSizeBytes = maxSizeBytes,
        maxSizeGb = maxSizeGb,
        name = name,
        readScale = readScale,
        requestedServiceObjectiveId = requestedServiceObjectiveId,
        requestedServiceObjectiveName = requestedServiceObjectiveName,
        resourceGroupName = resourceGroupName,
        restorePointInTime = restorePointInTime,
        serverName = serverName,
        sourceDatabaseDeletionDate = sourceDatabaseDeletionDate,
        sourceDatabaseId = sourceDatabaseId,
        tags = tags,
        threatDetectionPolicy = threatDetectionPolicy,
        zoneRedundant = zoneRedundant,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy