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

com.pulumi.gcp.apigateway.kotlin.ApiConfigArgs.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.13.1.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.ApiConfigArgs.builder
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigGatewayConfigArgs
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigGatewayConfigArgsBuilder
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigGrpcServiceArgs
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigGrpcServiceArgsBuilder
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigManagedServiceConfigArgs
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigManagedServiceConfigArgsBuilder
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigOpenapiDocumentArgs
import com.pulumi.gcp.apigateway.kotlin.inputs.ApiConfigOpenapiDocumentArgsBuilder
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.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * An API Configuration is an association of an API Controller Config and a Gateway Config
 * To get more information about ApiConfig, see:
 * * [API documentation](https://cloud.google.com/api-gateway/docs/reference/rest/v1beta/projects.locations.apis.configs)
 * * How-to Guides
 *     * [Official Documentation](https://cloud.google.com/api-gateway/docs/creating-api-config)
 * ## Example Usage
 * ## Import
 * ApiConfig can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/apis/{{api}}/configs/{{api_config_id}}`
 * * `{{project}}/{{api}}/{{api_config_id}}`
 * * `{{api}}/{{api_config_id}}`
 * When using the `pulumi import` command, ApiConfig can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:apigateway/apiConfig:ApiConfig default projects/{{project}}/locations/global/apis/{{api}}/configs/{{api_config_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:apigateway/apiConfig:ApiConfig default {{project}}/{{api}}/{{api_config_id}}
 * ```
 * ```sh
 * $ pulumi import gcp:apigateway/apiConfig:ApiConfig default {{api}}/{{api_config_id}}
 * ```
 * @property api The API to attach the config to.
 * - - -
 * @property apiConfigId Identifier to assign to the API Config. Must be unique within scope of the parent resource(api).
 * @property apiConfigIdPrefix Creates a unique name beginning with the
 * specified prefix. If this and api_config_id are unspecified, a random value is chosen for the name.
 * @property displayName A user-visible name for the API.
 * @property gatewayConfig Immutable. Gateway specific configuration.
 * If not specified, backend authentication will be set to use OIDC authentication using the default compute service account
 * Structure is documented below.
 * @property grpcServices gRPC service definition files. If specified, openapiDocuments must not be included.
 * Structure is documented below.
 * @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 managedServiceConfigs Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
 * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
 * Structure is documented below.
 * @property openapiDocuments OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
 * Structure is documented below.
 * @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 ApiConfigArgs(
    public val api: Output? = null,
    public val apiConfigId: Output? = null,
    public val apiConfigIdPrefix: Output? = null,
    public val displayName: Output? = null,
    public val gatewayConfig: Output? = null,
    public val grpcServices: Output>? = null,
    public val labels: Output>? = null,
    public val managedServiceConfigs: Output>? = null,
    public val openapiDocuments: Output>? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.apigateway.ApiConfigArgs =
        com.pulumi.gcp.apigateway.ApiConfigArgs.builder()
            .api(api?.applyValue({ args0 -> args0 }))
            .apiConfigId(apiConfigId?.applyValue({ args0 -> args0 }))
            .apiConfigIdPrefix(apiConfigIdPrefix?.applyValue({ args0 -> args0 }))
            .displayName(displayName?.applyValue({ args0 -> args0 }))
            .gatewayConfig(gatewayConfig?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .grpcServices(
                grpcServices?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .managedServiceConfigs(
                managedServiceConfigs?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 -> args0.toJava() })
                    })
                }),
            )
            .openapiDocuments(
                openapiDocuments?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ApiConfigArgs].
 */
@PulumiTagMarker
public class ApiConfigArgsBuilder internal constructor() {
    private var api: Output? = null

    private var apiConfigId: Output? = null

    private var apiConfigIdPrefix: Output? = null

    private var displayName: Output? = null

    private var gatewayConfig: Output? = null

    private var grpcServices: Output>? = null

    private var labels: Output>? = null

    private var managedServiceConfigs: Output>? = null

    private var openapiDocuments: Output>? = null

    private var project: Output? = null

    /**
     * @param value The API to attach the config to.
     * - - -
     */
    @JvmName("kaqvltnvpghswhel")
    public suspend fun api(`value`: Output) {
        this.api = value
    }

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

    /**
     * @param value Creates a unique name beginning with the
     * specified prefix. If this and api_config_id are unspecified, a random value is chosen for the name.
     */
    @JvmName("qngtymoladvskjqg")
    public suspend fun apiConfigIdPrefix(`value`: Output) {
        this.apiConfigIdPrefix = value
    }

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

    /**
     * @param value Immutable. Gateway specific configuration.
     * If not specified, backend authentication will be set to use OIDC authentication using the default compute service account
     * Structure is documented below.
     */
    @JvmName("wueofkskgutwsuwb")
    public suspend fun gatewayConfig(`value`: Output) {
        this.gatewayConfig = value
    }

    /**
     * @param value gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("kvmsagfqncsjignx")
    public suspend fun grpcServices(`value`: Output>) {
        this.grpcServices = value
    }

    @JvmName("vjpbfhkphfsneoix")
    public suspend fun grpcServices(vararg values: Output) {
        this.grpcServices = Output.all(values.asList())
    }

    /**
     * @param values gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("ljcssqsujsgmeycy")
    public suspend fun grpcServices(values: List>) {
        this.grpcServices = Output.all(values)
    }

    /**
     * @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("rtpirjejflfifhvl")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("relpjuqdasiujdmh")
    public suspend fun managedServiceConfigs(`value`: Output>) {
        this.managedServiceConfigs = value
    }

    @JvmName("payjlrtgknfruaoj")
    public suspend fun managedServiceConfigs(vararg values: Output) {
        this.managedServiceConfigs = Output.all(values.asList())
    }

    /**
     * @param values Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("solgqopovhvqfluk")
    public suspend fun managedServiceConfigs(values: List>) {
        this.managedServiceConfigs = Output.all(values)
    }

    /**
     * @param value OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("aswxnixqktwunyyh")
    public suspend fun openapiDocuments(`value`: Output>) {
        this.openapiDocuments = value
    }

    @JvmName("ppcrwrcnsmswvrxr")
    public suspend fun openapiDocuments(vararg values: Output) {
        this.openapiDocuments = Output.all(values.asList())
    }

    /**
     * @param values OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("wcadrsolwmdbettn")
    public suspend fun openapiDocuments(values: List>) {
        this.openapiDocuments = Output.all(values)
    }

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

    /**
     * @param value The API to attach the config to.
     * - - -
     */
    @JvmName("sdunkuykgowyhpln")
    public suspend fun api(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.api = mapped
    }

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

    /**
     * @param value Creates a unique name beginning with the
     * specified prefix. If this and api_config_id are unspecified, a random value is chosen for the name.
     */
    @JvmName("nroddsixdgwmvoxc")
    public suspend fun apiConfigIdPrefix(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiConfigIdPrefix = mapped
    }

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

    /**
     * @param value Immutable. Gateway specific configuration.
     * If not specified, backend authentication will be set to use OIDC authentication using the default compute service account
     * Structure is documented below.
     */
    @JvmName("otsycmaodnukjkii")
    public suspend fun gatewayConfig(`value`: ApiConfigGatewayConfigArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gatewayConfig = mapped
    }

    /**
     * @param argument Immutable. Gateway specific configuration.
     * If not specified, backend authentication will be set to use OIDC authentication using the default compute service account
     * Structure is documented below.
     */
    @JvmName("eypkxsrdtqoywyvl")
    public suspend fun gatewayConfig(argument: suspend ApiConfigGatewayConfigArgsBuilder.() -> Unit) {
        val toBeMapped = ApiConfigGatewayConfigArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.gatewayConfig = mapped
    }

    /**
     * @param value gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("jtpsrxpfxlsuesjp")
    public suspend fun grpcServices(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.grpcServices = mapped
    }

    /**
     * @param argument gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("eorsbuaryrkwsowm")
    public suspend fun grpcServices(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiConfigGrpcServiceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.grpcServices = mapped
    }

    /**
     * @param argument gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("ifjirnrrveolfeoo")
    public suspend fun grpcServices(vararg argument: suspend ApiConfigGrpcServiceArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApiConfigGrpcServiceArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.grpcServices = mapped
    }

    /**
     * @param argument gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("tfdatbrsjihdfhpc")
    public suspend fun grpcServices(argument: suspend ApiConfigGrpcServiceArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ApiConfigGrpcServiceArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.grpcServices = mapped
    }

    /**
     * @param values gRPC service definition files. If specified, openapiDocuments must not be included.
     * Structure is documented below.
     */
    @JvmName("jixhhbpvybpqdsik")
    public suspend fun grpcServices(vararg values: ApiConfigGrpcServiceArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.grpcServices = 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("qtaxrslbyioxbbfx")
    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("twnvcwjpimyvcjos")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("rkqmvxtdjwuuqbsj")
    public suspend fun managedServiceConfigs(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managedServiceConfigs = mapped
    }

    /**
     * @param argument Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("xtfnkyiyniocddtv")
    public suspend fun managedServiceConfigs(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiConfigManagedServiceConfigArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.managedServiceConfigs = mapped
    }

    /**
     * @param argument Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("nmhjprnoulpmdcqw")
    public suspend fun managedServiceConfigs(vararg argument: suspend ApiConfigManagedServiceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApiConfigManagedServiceConfigArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.managedServiceConfigs = mapped
    }

    /**
     * @param argument Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("rbmawwbpffpaerql")
    public suspend fun managedServiceConfigs(argument: suspend ApiConfigManagedServiceConfigArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApiConfigManagedServiceConfigArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.managedServiceConfigs = mapped
    }

    /**
     * @param values Optional. Service Configuration files. At least one must be included when using gRPC service definitions. See https://cloud.google.com/endpoints/docs/grpc/grpc-service-config#service_configuration_overview for the expected file contents.
     * If multiple files are specified, the files are merged with the following rules: * All singular scalar fields are merged using "last one wins" semantics in the order of the files uploaded. * Repeated fields are concatenated. * Singular embedded messages are merged using these rules for nested fields.
     * Structure is documented below.
     */
    @JvmName("pfkijatbvvrkmfyy")
    public suspend fun managedServiceConfigs(vararg values: ApiConfigManagedServiceConfigArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.managedServiceConfigs = mapped
    }

    /**
     * @param value OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("ihgeujkloufdncpp")
    public suspend fun openapiDocuments(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.openapiDocuments = mapped
    }

    /**
     * @param argument OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("evmgtkhshlbdttyi")
    public suspend fun openapiDocuments(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiConfigOpenapiDocumentArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.openapiDocuments = mapped
    }

    /**
     * @param argument OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("yogghjodsgxgwnqa")
    public suspend fun openapiDocuments(vararg argument: suspend ApiConfigOpenapiDocumentArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApiConfigOpenapiDocumentArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.openapiDocuments = mapped
    }

    /**
     * @param argument OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("nxrktgsffugrxgtp")
    public suspend fun openapiDocuments(argument: suspend ApiConfigOpenapiDocumentArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApiConfigOpenapiDocumentArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.openapiDocuments = mapped
    }

    /**
     * @param values OpenAPI specification documents. If specified, grpcServices and managedServiceConfigs must not be included.
     * Structure is documented below.
     */
    @JvmName("xtjkkiluvydxcgll")
    public suspend fun openapiDocuments(vararg values: ApiConfigOpenapiDocumentArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.openapiDocuments = mapped
    }

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

    internal fun build(): ApiConfigArgs = ApiConfigArgs(
        api = api,
        apiConfigId = apiConfigId,
        apiConfigIdPrefix = apiConfigIdPrefix,
        displayName = displayName,
        gatewayConfig = gatewayConfig,
        grpcServices = grpcServices,
        labels = labels,
        managedServiceConfigs = managedServiceConfigs,
        openapiDocuments = openapiDocuments,
        project = project,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy