// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.gcp.serviceusage;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import com.pulumi.gcp.Utilities;
import com.pulumi.gcp.serviceusage.ConsumerQuotaOverrideArgs;
import com.pulumi.gcp.serviceusage.inputs.ConsumerQuotaOverrideState;
import java.lang.Boolean;
import java.lang.String;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * A consumer override is applied to the consumer on its own authority to limit its own quota usage.
 * Consumer overrides cannot be used to grant more quota than would be allowed by admin overrides,
 * producer overrides, or the default limit of the service.
 * 
 * To get more information about ConsumerQuotaOverride, see:
 * 
 * * How-to Guides
 *     * [Managing Service Quota](https://cloud.google.com/service-usage/docs/manage-quota)
 *     * [REST API documentation](https://cloud.google.com/service-usage/docs/reference/rest/v1beta1/services.consumerQuotaMetrics.limits.consumerOverrides)
 * 
 * ## Example Usage
 * 
 * ## Import
 * 
 * ConsumerQuotaOverride can be imported using any of these accepted formats
 * 
 * ```sh
 *  $ pulumi import gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride default projects/{{project}}/services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride default services/{{service}}/consumerQuotaMetrics/{{metric}}/limits/{{limit}}/consumerOverrides/{{name}}
 * ```
 * 
 * ```sh
 *  $ pulumi import gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride default {{service}}/{{metric}}/{{limit}}/{{name}}
 * ```
 * 
 */
@ResourceType(type="gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride")
public class ConsumerQuotaOverride extends com.pulumi.resources.CustomResource {
    /**
     * If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit.
     * 
     */
    @Export(name="dimensions", type=Map.class, parameters={String.class, String.class})
    private Output</* @Nullable */ Map<String,String>> dimensions;

    /**
     * @return If this map is nonempty, then this override applies only to specific values for dimensions defined in the limit unit.
     * 
     */
    public Output<Optional<Map<String,String>>> dimensions() {
        return Codegen.optional(this.dimensions);
    }
    /**
     * If the new quota would decrease the existing quota by more than 10%, the request is rejected.
     * If `force` is `true`, that safety check is ignored.
     * 
     */
    @Export(name="force", type=Boolean.class, parameters={})
    private Output</* @Nullable */ Boolean> force;

    /**
     * @return If the new quota would decrease the existing quota by more than 10%, the request is rejected.
     * If `force` is `true`, that safety check is ignored.
     * 
     */
    public Output<Optional<Boolean>> force() {
        return Codegen.optional(this.force);
    }
    /**
     * The limit on the metric, e.g. `/project/region`.
     * &gt; Make sure that `limit` is in a format that doesn&#39;t start with `1/` or contain curly braces.
     * E.g. use `/project/user` instead of `1/{project}/{user}`.
     * 
     * ***
     * 
     */
    @Export(name="limit", type=String.class, parameters={})
    private Output<String> limit;

    /**
     * @return The limit on the metric, e.g. `/project/region`.
     * &gt; Make sure that `limit` is in a format that doesn&#39;t start with `1/` or contain curly braces.
     * E.g. use `/project/user` instead of `1/{project}/{user}`.
     * 
     * ***
     * 
     */
    public Output<String> limit() {
        return this.limit;
    }
    /**
     * The metric that should be limited, e.g. `compute.googleapis.com/cpus`.
     * 
     */
    @Export(name="metric", type=String.class, parameters={})
    private Output<String> metric;

    /**
     * @return The metric that should be limited, e.g. `compute.googleapis.com/cpus`.
     * 
     */
    public Output<String> metric() {
        return this.metric;
    }
    /**
     * The server-generated name of the quota override.
     * 
     */
    @Export(name="name", type=String.class, parameters={})
    private Output<String> name;

    /**
     * @return The server-generated name of the quota override.
     * 
     */
    public Output<String> name() {
        return this.name;
    }
    /**
     * The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota).
     * 
     */
    @Export(name="overrideValue", type=String.class, parameters={})
    private Output<String> overrideValue;

    /**
     * @return The overriding quota limit value. Can be any nonnegative integer, or -1 (unlimited quota).
     * 
     */
    public Output<String> overrideValue() {
        return this.overrideValue;
    }
    /**
     * The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    @Export(name="project", type=String.class, parameters={})
    private Output<String> project;

    /**
     * @return The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     * 
     */
    public Output<String> project() {
        return this.project;
    }
    /**
     * The service that the metrics belong to, e.g. `compute.googleapis.com`.
     * 
     */
    @Export(name="service", type=String.class, parameters={})
    private Output<String> service;

    /**
     * @return The service that the metrics belong to, e.g. `compute.googleapis.com`.
     * 
     */
    public Output<String> service() {
        return this.service;
    }

    /**
     *
     * @param name The _unique_ name of the resulting resource.
     */
    public ConsumerQuotaOverride(String name) {
        this(name, ConsumerQuotaOverrideArgs.Empty);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     */
    public ConsumerQuotaOverride(String name, ConsumerQuotaOverrideArgs args) {
        this(name, args, null);
    }
    /**
     *
     * @param name The _unique_ name of the resulting resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param options A bag of options that control this resource's behavior.
     */
    public ConsumerQuotaOverride(String name, ConsumerQuotaOverrideArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride", name, args == null ? ConsumerQuotaOverrideArgs.Empty : args, makeResourceOptions(options, Codegen.empty()));
    }

    private ConsumerQuotaOverride(String name, Output<String> id, @Nullable ConsumerQuotaOverrideState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        super("gcp:serviceusage/consumerQuotaOverride:ConsumerQuotaOverride", name, state, makeResourceOptions(options, id));
    }

    private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output<String> id) {
        var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
            .version(Utilities.getVersion())
            .build();
        return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
    }

    /**
     * Get an existing Host resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state
     * @param options Optional settings to control the behavior of the CustomResource.
     */
    public static ConsumerQuotaOverride get(String name, Output<String> id, @Nullable ConsumerQuotaOverrideState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
        return new ConsumerQuotaOverride(name, id, state, options);
    }
}
