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

com.pulumi.gcp.cloudquota.kotlin.SQuotaPreferenceArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.gcp.cloudquota.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudquota.SQuotaPreferenceArgs.builder
import com.pulumi.gcp.cloudquota.kotlin.inputs.SQuotaPreferenceQuotaConfigArgs
import com.pulumi.gcp.cloudquota.kotlin.inputs.SQuotaPreferenceQuotaConfigArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * QuotaPreference represents the preferred quota configuration specified for a project, folder or organization. There is only one QuotaPreference resource for a quota value targeting a unique set of dimensions.
 * To get more information about QuotaPreference, see:
 * * [API documentation](https://cloud.google.com/docs/quotas/reference/rest/v1/projects.locations.quotaPreferences)
 * * How-to Guides
 *     * [Cloud Quotas Overview](https://cloud.google.com/docs/quotas/overview)
 * ## Example Usage
 * ### Cloudquotas Quota Preference Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const preference = new gcp.cloudquota.SQuotaPreference("preference", {
 *     parent: "projects/my-project-name",
 *     name: "compute_googleapis_com-CPUS-per-project_us-east1",
 *     dimensions: {
 *         region: "us-east1",
 *     },
 *     service: "compute.googleapis.com",
 *     quotaId: "CPUS-per-project-region",
 *     contactEmail: "[email protected]",
 *     quotaConfig: {
 *         preferredValue: "200",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * preference = gcp.cloudquota.SQuotaPreference("preference",
 *     parent="projects/my-project-name",
 *     name="compute_googleapis_com-CPUS-per-project_us-east1",
 *     dimensions={
 *         "region": "us-east1",
 *     },
 *     service="compute.googleapis.com",
 *     quota_id="CPUS-per-project-region",
 *     contact_email="[email protected]",
 *     quota_config={
 *         "preferred_value": "200",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var preference = new Gcp.CloudQuota.SQuotaPreference("preference", new()
 *     {
 *         Parent = "projects/my-project-name",
 *         Name = "compute_googleapis_com-CPUS-per-project_us-east1",
 *         Dimensions =
 *         {
 *             { "region", "us-east1" },
 *         },
 *         Service = "compute.googleapis.com",
 *         QuotaId = "CPUS-per-project-region",
 *         ContactEmail = "[email protected]",
 *         QuotaConfig = new Gcp.CloudQuota.Inputs.SQuotaPreferenceQuotaConfigArgs
 *         {
 *             PreferredValue = "200",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/cloudquota"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudquota.NewSQuotaPreference(ctx, "preference", &cloudquota.SQuotaPreferenceArgs{
 * 			Parent: pulumi.String("projects/my-project-name"),
 * 			Name:   pulumi.String("compute_googleapis_com-CPUS-per-project_us-east1"),
 * 			Dimensions: pulumi.StringMap{
 * 				"region": pulumi.String("us-east1"),
 * 			},
 * 			Service:      pulumi.String("compute.googleapis.com"),
 * 			QuotaId:      pulumi.String("CPUS-per-project-region"),
 * 			ContactEmail: pulumi.String("[email protected]"),
 * 			QuotaConfig: &cloudquota.SQuotaPreferenceQuotaConfigArgs{
 * 				PreferredValue: pulumi.String("200"),
 * 			},
 * 		})
 * 		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.gcp.cloudquota.SQuotaPreference;
 * import com.pulumi.gcp.cloudquota.SQuotaPreferenceArgs;
 * import com.pulumi.gcp.cloudquota.inputs.SQuotaPreferenceQuotaConfigArgs;
 * 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 preference = new SQuotaPreference("preference", SQuotaPreferenceArgs.builder()
 *             .parent("projects/my-project-name")
 *             .name("compute_googleapis_com-CPUS-per-project_us-east1")
 *             .dimensions(Map.of("region", "us-east1"))
 *             .service("compute.googleapis.com")
 *             .quotaId("CPUS-per-project-region")
 *             .contactEmail("[email protected]")
 *             .quotaConfig(SQuotaPreferenceQuotaConfigArgs.builder()
 *                 .preferredValue(200)
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   preference:
 *     type: gcp:cloudquota:SQuotaPreference
 *     properties:
 *       parent: projects/my-project-name
 *       name: compute_googleapis_com-CPUS-per-project_us-east1
 *       dimensions:
 *         region: us-east1
 *       service: compute.googleapis.com
 *       quotaId: CPUS-per-project-region
 *       contactEmail: [email protected]
 *       quotaConfig:
 *         preferredValue: 200
 * ```
 * 
 * ## Import
 * QuotaPreference can be imported using any of these accepted formats:
 * * `{{parent}}/locations/global/quotaPreferences/{{name}}`
 * When using the `pulumi import` command, QuotaPreference can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:cloudquota/sQuotaPreference:SQuotaPreference default {{parent}}/locations/global/quotaPreferences/{{name}}
 * ```
 * @property contactEmail An email address that can be used for quota related communication between the Google Cloud and the user in case the
 * Google Cloud needs further information to make a decision on whether the user preferred quota can be granted. The Google
 * account for the email address must have quota update permission for the project, folder or organization this quota
 * preference is for.
 * @property dimensions The dimensions that this quota preference applies to. The key of the map entry is the name of a dimension, such as
 * "region", "zone", "network_id", and the value of the map entry is the dimension value. If a dimension is missing from
 * the map of dimensions, the quota preference applies to all the dimension values except for those that have other quota
 * preferences configured for the specific value. NOTE: QuotaPreferences can only be applied across all values of "user"
 * and "resource" dimension. Do not set values for "user" or "resource" in the dimension map. Example: '{"provider": "Foo
 * Inc"}' where "provider" is a service specific dimension.
 * @property ignoreSafetyChecks The list of quota safety checks to be ignored. Default value: "QUOTA_SAFETY_CHECK_UNSPECIFIED" Possible values:
 * ["QUOTA_SAFETY_CHECK_UNSPECIFIED", "QUOTA_DECREASE_BELOW_USAGE", "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH"]
 * @property justification The reason / justification for this quota preference.
 * @property name The resource name of the quota preference. Required except in the CREATE requests.
 * @property parent The parent of the quota preference. Allowed parents are "projects/[project-id / number]" or "folders/[folder-id / number]" or "organizations/[org-id / number]".
 * @property quotaConfig The preferred quota configuration.
 * Structure is documented below.
 * @property quotaId The id of the quota to which the quota preference is applied. A quota id is unique in the service.
 * Example: `CPUS-per-project-region`.
 * @property service The name of the service to which the quota preference is applied.
 */
public data class SQuotaPreferenceArgs(
    public val contactEmail: Output? = null,
    public val dimensions: Output>? = null,
    public val ignoreSafetyChecks: Output? = null,
    public val justification: Output? = null,
    public val name: Output? = null,
    public val parent: Output? = null,
    public val quotaConfig: Output? = null,
    public val quotaId: Output? = null,
    public val service: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudquota.SQuotaPreferenceArgs =
        com.pulumi.gcp.cloudquota.SQuotaPreferenceArgs.builder()
            .contactEmail(contactEmail?.applyValue({ args0 -> args0 }))
            .dimensions(
                dimensions?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            )
            .ignoreSafetyChecks(ignoreSafetyChecks?.applyValue({ args0 -> args0 }))
            .justification(justification?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .parent(parent?.applyValue({ args0 -> args0 }))
            .quotaConfig(quotaConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .quotaId(quotaId?.applyValue({ args0 -> args0 }))
            .service(service?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [SQuotaPreferenceArgs].
 */
@PulumiTagMarker
public class SQuotaPreferenceArgsBuilder internal constructor() {
    private var contactEmail: Output? = null

    private var dimensions: Output>? = null

    private var ignoreSafetyChecks: Output? = null

    private var justification: Output? = null

    private var name: Output? = null

    private var parent: Output? = null

    private var quotaConfig: Output? = null

    private var quotaId: Output? = null

    private var service: Output? = null

    /**
     * @param value An email address that can be used for quota related communication between the Google Cloud and the user in case the
     * Google Cloud needs further information to make a decision on whether the user preferred quota can be granted. The Google
     * account for the email address must have quota update permission for the project, folder or organization this quota
     * preference is for.
     */
    @JvmName("anryyvlojmtnjwol")
    public suspend fun contactEmail(`value`: Output) {
        this.contactEmail = value
    }

    /**
     * @param value The dimensions that this quota preference applies to. The key of the map entry is the name of a dimension, such as
     * "region", "zone", "network_id", and the value of the map entry is the dimension value. If a dimension is missing from
     * the map of dimensions, the quota preference applies to all the dimension values except for those that have other quota
     * preferences configured for the specific value. NOTE: QuotaPreferences can only be applied across all values of "user"
     * and "resource" dimension. Do not set values for "user" or "resource" in the dimension map. Example: '{"provider": "Foo
     * Inc"}' where "provider" is a service specific dimension.
     */
    @JvmName("swtdbsqcvnwosiyl")
    public suspend fun dimensions(`value`: Output>) {
        this.dimensions = value
    }

    /**
     * @param value The list of quota safety checks to be ignored. Default value: "QUOTA_SAFETY_CHECK_UNSPECIFIED" Possible values:
     * ["QUOTA_SAFETY_CHECK_UNSPECIFIED", "QUOTA_DECREASE_BELOW_USAGE", "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH"]
     */
    @JvmName("cemesynxbylvaifj")
    public suspend fun ignoreSafetyChecks(`value`: Output) {
        this.ignoreSafetyChecks = value
    }

    /**
     * @param value The reason / justification for this quota preference.
     */
    @JvmName("uqxapaaqiycuxqnk")
    public suspend fun justification(`value`: Output) {
        this.justification = value
    }

    /**
     * @param value The resource name of the quota preference. Required except in the CREATE requests.
     */
    @JvmName("yuxciaehtfckrreh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The parent of the quota preference. Allowed parents are "projects/[project-id / number]" or "folders/[folder-id / number]" or "organizations/[org-id / number]".
     */
    @JvmName("mwberncutcbipekq")
    public suspend fun parent(`value`: Output) {
        this.parent = value
    }

    /**
     * @param value The preferred quota configuration.
     * Structure is documented below.
     */
    @JvmName("utrtmetrwdnqppar")
    public suspend fun quotaConfig(`value`: Output) {
        this.quotaConfig = value
    }

    /**
     * @param value The id of the quota to which the quota preference is applied. A quota id is unique in the service.
     * Example: `CPUS-per-project-region`.
     */
    @JvmName("fgptyktdirerluas")
    public suspend fun quotaId(`value`: Output) {
        this.quotaId = value
    }

    /**
     * @param value The name of the service to which the quota preference is applied.
     */
    @JvmName("ioppehswerxxmcce")
    public suspend fun service(`value`: Output) {
        this.service = value
    }

    /**
     * @param value An email address that can be used for quota related communication between the Google Cloud and the user in case the
     * Google Cloud needs further information to make a decision on whether the user preferred quota can be granted. The Google
     * account for the email address must have quota update permission for the project, folder or organization this quota
     * preference is for.
     */
    @JvmName("vscyntjneypafuby")
    public suspend fun contactEmail(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contactEmail = mapped
    }

    /**
     * @param value The dimensions that this quota preference applies to. The key of the map entry is the name of a dimension, such as
     * "region", "zone", "network_id", and the value of the map entry is the dimension value. If a dimension is missing from
     * the map of dimensions, the quota preference applies to all the dimension values except for those that have other quota
     * preferences configured for the specific value. NOTE: QuotaPreferences can only be applied across all values of "user"
     * and "resource" dimension. Do not set values for "user" or "resource" in the dimension map. Example: '{"provider": "Foo
     * Inc"}' where "provider" is a service specific dimension.
     */
    @JvmName("evqcejfwltsgobre")
    public suspend fun dimensions(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param values The dimensions that this quota preference applies to. The key of the map entry is the name of a dimension, such as
     * "region", "zone", "network_id", and the value of the map entry is the dimension value. If a dimension is missing from
     * the map of dimensions, the quota preference applies to all the dimension values except for those that have other quota
     * preferences configured for the specific value. NOTE: QuotaPreferences can only be applied across all values of "user"
     * and "resource" dimension. Do not set values for "user" or "resource" in the dimension map. Example: '{"provider": "Foo
     * Inc"}' where "provider" is a service specific dimension.
     */
    @JvmName("qngyvtyrmpnkjumm")
    public fun dimensions(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.dimensions = mapped
    }

    /**
     * @param value The list of quota safety checks to be ignored. Default value: "QUOTA_SAFETY_CHECK_UNSPECIFIED" Possible values:
     * ["QUOTA_SAFETY_CHECK_UNSPECIFIED", "QUOTA_DECREASE_BELOW_USAGE", "QUOTA_DECREASE_PERCENTAGE_TOO_HIGH"]
     */
    @JvmName("qccsnyrlpcxngtth")
    public suspend fun ignoreSafetyChecks(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ignoreSafetyChecks = mapped
    }

    /**
     * @param value The reason / justification for this quota preference.
     */
    @JvmName("gercmqutalxpycto")
    public suspend fun justification(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.justification = mapped
    }

    /**
     * @param value The resource name of the quota preference. Required except in the CREATE requests.
     */
    @JvmName("oxiulicmrmcmdhvy")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The parent of the quota preference. Allowed parents are "projects/[project-id / number]" or "folders/[folder-id / number]" or "organizations/[org-id / number]".
     */
    @JvmName("xokxcajrleibxljl")
    public suspend fun parent(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.parent = mapped
    }

    /**
     * @param value The preferred quota configuration.
     * Structure is documented below.
     */
    @JvmName("wsqbpesxeddvejuh")
    public suspend fun quotaConfig(`value`: SQuotaPreferenceQuotaConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.quotaConfig = mapped
    }

    /**
     * @param argument The preferred quota configuration.
     * Structure is documented below.
     */
    @JvmName("idebavilcegxyilk")
    public suspend fun quotaConfig(argument: suspend SQuotaPreferenceQuotaConfigArgsBuilder.() -> Unit) {
        val toBeMapped = SQuotaPreferenceQuotaConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.quotaConfig = mapped
    }

    /**
     * @param value The id of the quota to which the quota preference is applied. A quota id is unique in the service.
     * Example: `CPUS-per-project-region`.
     */
    @JvmName("vjtpsyxxbkurydtq")
    public suspend fun quotaId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.quotaId = mapped
    }

    /**
     * @param value The name of the service to which the quota preference is applied.
     */
    @JvmName("cwquplyfounrkaty")
    public suspend fun service(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.service = mapped
    }

    internal fun build(): SQuotaPreferenceArgs = SQuotaPreferenceArgs(
        contactEmail = contactEmail,
        dimensions = dimensions,
        ignoreSafetyChecks = ignoreSafetyChecks,
        justification = justification,
        name = name,
        parent = parent,
        quotaConfig = quotaConfig,
        quotaId = quotaId,
        service = service,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy