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

com.pulumi.gcp.apigateway.kotlin.ApiArgs.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.apigateway.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.apigateway.ApiArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * A consumable API that can be used by multiple Gateways.
 * To get more information about Api, see:
 * * [API documentation](https://cloud.google.com/api-gateway/docs/reference/rest/v1beta/projects.locations.apis)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/api-gateway/docs/quickstart)
 * ## Example Usage
 * ### Apigateway Api Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const api = new gcp.apigateway.Api("api", {apiId: "my-api"});
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * api = gcp.apigateway.Api("api", api_id="my-api")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var api = new Gcp.ApiGateway.Api("api", new()
 *     {
 *         ApiId = "my-api",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apigateway"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := apigateway.NewApi(ctx, "api", &apigateway.ApiArgs{
 * 			ApiId: pulumi.String("my-api"),
 * 		})
 * 		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.apigateway.Api;
 * import com.pulumi.gcp.apigateway.ApiArgs;
 * 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 api = new Api("api", ApiArgs.builder()
 *             .apiId("my-api")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   api:
 *     type: gcp:apigateway:Api
 *     properties:
 *       apiId: my-api
 * ```
 * 
 * ## Import
 * Api can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/apis/{{api_id}}`
 * * `{{project}}/{{api_id}}`
 * * `{{api_id}}`
 * When using the `pulumi import` command, Api can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:apigateway/api:Api default projects/{{project}}/locations/global/apis/{{api_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:apigateway/api:Api default {{project}}/{{api_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:apigateway/api:Api default {{api_id}}
 * ```
 * @property apiId Identifier to assign to the API. Must be unique within scope of the parent resource(project)
 * - - -
 * @property displayName A user-visible name for the API.
 * @property labels Resource labels to represent user-provided metadata.
 * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
 * Please refer to the field `effective_labels` for all of the labels present on the resource.
 * @property managedService Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed).
 * If not specified, a new Service will automatically be created in the same project as this API.
 * @property project The ID of the project in which the resource belongs.
 * If it is not provided, the provider project is used.
 */
public data class ApiArgs(
    public val apiId: Output? = null,
    public val displayName: Output? = null,
    public val labels: Output>? = null,
    public val managedService: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.apigateway.ApiArgs =
        com.pulumi.gcp.apigateway.ApiArgs.builder()
            .apiId(apiId?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .managedService(managedService?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ApiArgs].
 */
@PulumiTagMarker
public class ApiArgsBuilder internal constructor() {
    private var apiId: Output? = null

    private var displayName: Output? = null

    private var labels: Output>? = null

    private var managedService: Output? = null

    private var project: Output? = null

    /**
     * @param value Identifier to assign to the API. Must be unique within scope of the parent resource(project)
     * - - -
     */
    @JvmName("bmpyenjnbmbiisdp")
    public suspend fun apiId(`value`: Output) {
        this.apiId = value
    }

    /**
     * @param value A user-visible name for the API.
     */
    @JvmName("iivogqunujnfbeki")
    public suspend fun displayName(`value`: Output) {
        this.displayName = value
    }

    /**
     * @param value Resource labels to represent user-provided metadata.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("smgayjteihyxvhxe")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed).
     * If not specified, a new Service will automatically be created in the same project as this API.
     */
    @JvmName("rohqybfxdvobphvc")
    public suspend fun managedService(`value`: Output) {
        this.managedService = value
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("lwdpslpbvuprowup")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value Identifier to assign to the API. Must be unique within scope of the parent resource(project)
     * - - -
     */
    @JvmName("lorvcjpsllqkidff")
    public suspend fun apiId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiId = mapped
    }

    /**
     * @param value A user-visible name for the API.
     */
    @JvmName("gnbdjienoiefvupm")
    public suspend fun displayName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.displayName = mapped
    }

    /**
     * @param value Resource labels to represent user-provided metadata.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("rvicurskegynmalp")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Resource labels to represent user-provided metadata.
     * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
     * Please refer to the field `effective_labels` for all of the labels present on the resource.
     */
    @JvmName("mcofxacfcjikaarm")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed).
     * If not specified, a new Service will automatically be created in the same project as this API.
     */
    @JvmName("xjgijtlcpnptvldq")
    public suspend fun managedService(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managedService = mapped
    }

    /**
     * @param value The ID of the project in which the resource belongs.
     * If it is not provided, the provider project is used.
     */
    @JvmName("kxlrkhxincsqrhfx")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    internal fun build(): ApiArgs = ApiArgs(
        apiId = apiId,
        displayName = displayName,
        labels = labels,
        managedService = managedService,
        project = project,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy