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

com.pulumi.gcp.cloudquota.kotlin.CloudquotaFunctions.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.cloudquota.kotlin

import com.pulumi.gcp.cloudquota.CloudquotaFunctions.getSQuotaInfoPlain
import com.pulumi.gcp.cloudquota.CloudquotaFunctions.getSQuotaInfosPlain
import com.pulumi.gcp.cloudquota.kotlin.inputs.GetSQuotaInfoPlainArgs
import com.pulumi.gcp.cloudquota.kotlin.inputs.GetSQuotaInfoPlainArgsBuilder
import com.pulumi.gcp.cloudquota.kotlin.inputs.GetSQuotaInfosPlainArgs
import com.pulumi.gcp.cloudquota.kotlin.inputs.GetSQuotaInfosPlainArgsBuilder
import com.pulumi.gcp.cloudquota.kotlin.outputs.GetSQuotaInfoResult
import com.pulumi.gcp.cloudquota.kotlin.outputs.GetSQuotaInfosResult
import kotlinx.coroutines.future.await
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import com.pulumi.gcp.cloudquota.kotlin.outputs.GetSQuotaInfoResult.Companion.toKotlin as getSQuotaInfoResultToKotlin
import com.pulumi.gcp.cloudquota.kotlin.outputs.GetSQuotaInfosResult.Companion.toKotlin as getSQuotaInfosResultToKotlin

public object CloudquotaFunctions {
    /**
     * Provides information about a particular quota for a given project, folder or organization.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const myQuotaInfo = gcp.cloudquota.getSQuotaInfo({
     *     parent: "projects/my-project",
     *     service: "compute.googleapis.com",
     *     quotaId: "CPUS-per-project-region",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * my_quota_info = gcp.cloudquota.get_s_quota_info(parent="projects/my-project",
     *     service="compute.googleapis.com",
     *     quota_id="CPUS-per-project-region")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var myQuotaInfo = Gcp.CloudQuota.GetSQuotaInfo.Invoke(new()
     *     {
     *         Parent = "projects/my-project",
     *         Service = "compute.googleapis.com",
     *         QuotaId = "CPUS-per-project-region",
     *     });
     * });
     * ```
     * ```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.GetSQuotaInfo(ctx, &cloudquota.GetSQuotaInfoArgs{
     * 			Parent:  "projects/my-project",
     * 			Service: "compute.googleapis.com",
     * 			QuotaId: "CPUS-per-project-region",
     * 		}, nil)
     * 		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.CloudquotaFunctions;
     * import com.pulumi.gcp.cloudquota.inputs.GetSQuotaInfoArgs;
     * 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) {
     *         final var myQuotaInfo = CloudquotaFunctions.getSQuotaInfo(GetSQuotaInfoArgs.builder()
     *             .parent("projects/my-project")
     *             .service("compute.googleapis.com")
     *             .quotaId("CPUS-per-project-region")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   myQuotaInfo:
     *     fn::invoke:
     *       Function: gcp:cloudquota:getSQuotaInfo
     *       Arguments:
     *         parent: projects/my-project
     *         service: compute.googleapis.com
     *         quotaId: CPUS-per-project-region
     * ```
     * 
     * @param argument A collection of arguments for invoking getSQuotaInfo.
     * @return A collection of values returned by getSQuotaInfo.
     */
    public suspend fun getSQuotaInfo(argument: GetSQuotaInfoPlainArgs): GetSQuotaInfoResult =
        getSQuotaInfoResultToKotlin(getSQuotaInfoPlain(argument.toJava()).await())

    /**
     * @see [getSQuotaInfo].
     * @param parent The parent of the quota info. Allowed parents are "projects/[project-id / number]" or "folders/[folder-id / number]" or "organizations/[org-id / number].
     * @param quotaId The id of the quota, which is unique within the service.
     * @param service The name of the service in which the quota is defined.
     * @return A collection of values returned by getSQuotaInfo.
     */
    public suspend fun getSQuotaInfo(
        parent: String,
        quotaId: String,
        service: String,
    ): GetSQuotaInfoResult {
        val argument = GetSQuotaInfoPlainArgs(
            parent = parent,
            quotaId = quotaId,
            service = service,
        )
        return getSQuotaInfoResultToKotlin(getSQuotaInfoPlain(argument.toJava()).await())
    }

    /**
     * @see [getSQuotaInfo].
     * @param argument Builder for [com.pulumi.gcp.cloudquota.kotlin.inputs.GetSQuotaInfoPlainArgs].
     * @return A collection of values returned by getSQuotaInfo.
     */
    public suspend fun getSQuotaInfo(argument: suspend GetSQuotaInfoPlainArgsBuilder.() -> Unit): GetSQuotaInfoResult {
        val builder = GetSQuotaInfoPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getSQuotaInfoResultToKotlin(getSQuotaInfoPlain(builtArgument.toJava()).await())
    }

    /**
     * Provides information about all quotas for a given project, folder or organization.
     * ## Example Usage
     * 
     * ```typescript
     * import * as pulumi from "@pulumi/pulumi";
     * import * as gcp from "@pulumi/gcp";
     * const myQuotaInfos = gcp.cloudquota.getSQuotaInfos({
     *     parent: "projects/my-project",
     *     service: "compute.googleapis.com",
     * });
     * ```
     * ```python
     * import pulumi
     * import pulumi_gcp as gcp
     * my_quota_infos = gcp.cloudquota.get_s_quota_infos(parent="projects/my-project",
     *     service="compute.googleapis.com")
     * ```
     * ```csharp
     * using System.Collections.Generic;
     * using System.Linq;
     * using Pulumi;
     * using Gcp = Pulumi.Gcp;
     * return await Deployment.RunAsync(() =>
     * {
     *     var myQuotaInfos = Gcp.CloudQuota.GetSQuotaInfos.Invoke(new()
     *     {
     *         Parent = "projects/my-project",
     *         Service = "compute.googleapis.com",
     *     });
     * });
     * ```
     * ```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.GetSQuotaInfos(ctx, &cloudquota.GetSQuotaInfosArgs{
     * 			Parent:  "projects/my-project",
     * 			Service: "compute.googleapis.com",
     * 		}, nil)
     * 		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.CloudquotaFunctions;
     * import com.pulumi.gcp.cloudquota.inputs.GetSQuotaInfosArgs;
     * 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) {
     *         final var myQuotaInfos = CloudquotaFunctions.getSQuotaInfos(GetSQuotaInfosArgs.builder()
     *             .parent("projects/my-project")
     *             .service("compute.googleapis.com")
     *             .build());
     *     }
     * }
     * ```
     * ```yaml
     * variables:
     *   myQuotaInfos:
     *     fn::invoke:
     *       Function: gcp:cloudquota:getSQuotaInfos
     *       Arguments:
     *         parent: projects/my-project
     *         service: compute.googleapis.com
     * ```
     * 
     * @param argument A collection of arguments for invoking getSQuotaInfos.
     * @return A collection of values returned by getSQuotaInfos.
     */
    public suspend fun getSQuotaInfos(argument: GetSQuotaInfosPlainArgs): GetSQuotaInfosResult =
        getSQuotaInfosResultToKotlin(getSQuotaInfosPlain(argument.toJava()).await())

    /**
     * @see [getSQuotaInfos].
     * @param parent Parent value of QuotaInfo resources. Listing across different resource containers (such as 'projects/-') is not allowed. Allowed parents are "projects/[project-id / number]" or "folders/[folder-id / number]" or "organizations/[org-id / number].
     * @param service The name of the service in which the quotas are defined.
     * @return A collection of values returned by getSQuotaInfos.
     */
    public suspend fun getSQuotaInfos(parent: String, service: String): GetSQuotaInfosResult {
        val argument = GetSQuotaInfosPlainArgs(
            parent = parent,
            service = service,
        )
        return getSQuotaInfosResultToKotlin(getSQuotaInfosPlain(argument.toJava()).await())
    }

    /**
     * @see [getSQuotaInfos].
     * @param argument Builder for [com.pulumi.gcp.cloudquota.kotlin.inputs.GetSQuotaInfosPlainArgs].
     * @return A collection of values returned by getSQuotaInfos.
     */
    public suspend fun getSQuotaInfos(argument: suspend GetSQuotaInfosPlainArgsBuilder.() -> Unit): GetSQuotaInfosResult {
        val builder = GetSQuotaInfosPlainArgsBuilder()
        builder.argument()
        val builtArgument = builder.build()
        return getSQuotaInfosResultToKotlin(getSQuotaInfosPlain(builtArgument.toJava()).await())
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy