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

com.pulumi.gcp.projects.kotlin.inputs.ApiKeyRestrictionsArgs.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.12.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.projects.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property androidKeyRestrictions The Android apps that are allowed to use the key.
 * @property apiTargets A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
 * @property browserKeyRestrictions The HTTP referrers (websites) that are allowed to use the key.
 * @property iosKeyRestrictions The iOS apps that are allowed to use the key.
 * @property serverKeyRestrictions The IP addresses of callers that are allowed to use the key.
 */
public data class ApiKeyRestrictionsArgs(
    public val androidKeyRestrictions: Output? = null,
    public val apiTargets: Output>? = null,
    public val browserKeyRestrictions: Output? = null,
    public val iosKeyRestrictions: Output? = null,
    public val serverKeyRestrictions: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs =
        com.pulumi.gcp.projects.inputs.ApiKeyRestrictionsArgs.builder()
            .androidKeyRestrictions(
                androidKeyRestrictions?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .apiTargets(
                apiTargets?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .browserKeyRestrictions(
                browserKeyRestrictions?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .iosKeyRestrictions(
                iosKeyRestrictions?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .serverKeyRestrictions(
                serverKeyRestrictions?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [ApiKeyRestrictionsArgs].
 */
@PulumiTagMarker
public class ApiKeyRestrictionsArgsBuilder internal constructor() {
    private var androidKeyRestrictions: Output? = null

    private var apiTargets: Output>? = null

    private var browserKeyRestrictions: Output? = null

    private var iosKeyRestrictions: Output? = null

    private var serverKeyRestrictions: Output? = null

    /**
     * @param value The Android apps that are allowed to use the key.
     */
    @JvmName("cupkvhsqumkynoyi")
    public suspend fun androidKeyRestrictions(`value`: Output) {
        this.androidKeyRestrictions = value
    }

    /**
     * @param value A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("sdpveolodgaafton")
    public suspend fun apiTargets(`value`: Output>) {
        this.apiTargets = value
    }

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

    /**
     * @param values A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("paudqbrfygtabxyy")
    public suspend fun apiTargets(values: List>) {
        this.apiTargets = Output.all(values)
    }

    /**
     * @param value The HTTP referrers (websites) that are allowed to use the key.
     */
    @JvmName("gtyuogsyioirrhvc")
    public suspend fun browserKeyRestrictions(`value`: Output) {
        this.browserKeyRestrictions = value
    }

    /**
     * @param value The iOS apps that are allowed to use the key.
     */
    @JvmName("oasrgqiujrqoolet")
    public suspend fun iosKeyRestrictions(`value`: Output) {
        this.iosKeyRestrictions = value
    }

    /**
     * @param value The IP addresses of callers that are allowed to use the key.
     */
    @JvmName("iklmkkptrmfblpot")
    public suspend fun serverKeyRestrictions(`value`: Output) {
        this.serverKeyRestrictions = value
    }

    /**
     * @param value The Android apps that are allowed to use the key.
     */
    @JvmName("avttqxolsjefdhbb")
    public suspend fun androidKeyRestrictions(`value`: ApiKeyRestrictionsAndroidKeyRestrictionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.androidKeyRestrictions = mapped
    }

    /**
     * @param argument The Android apps that are allowed to use the key.
     */
    @JvmName("aupduilafofngqes")
    public suspend fun androidKeyRestrictions(argument: suspend ApiKeyRestrictionsAndroidKeyRestrictionsArgsBuilder.() -> Unit) {
        val toBeMapped = ApiKeyRestrictionsAndroidKeyRestrictionsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.androidKeyRestrictions = mapped
    }

    /**
     * @param value A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("ccrygrurfscdxiyd")
    public suspend fun apiTargets(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiTargets = mapped
    }

    /**
     * @param argument A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("xoroqxlvioxcmada")
    public suspend fun apiTargets(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiKeyRestrictionsApiTargetArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.apiTargets = mapped
    }

    /**
     * @param argument A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("fnwgartoejpwxycy")
    public suspend fun apiTargets(vararg argument: suspend ApiKeyRestrictionsApiTargetArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ApiKeyRestrictionsApiTargetArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.apiTargets = mapped
    }

    /**
     * @param argument A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("tsmowvjdyixaboqc")
    public suspend fun apiTargets(argument: suspend ApiKeyRestrictionsApiTargetArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApiKeyRestrictionsApiTargetArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.apiTargets = mapped
    }

    /**
     * @param values A restriction for a specific service and optionally one or more specific methods. Requests are allowed if they match any of these restrictions. If no restrictions are specified, all targets are allowed.
     */
    @JvmName("aigrusvomapdrtkd")
    public suspend fun apiTargets(vararg values: ApiKeyRestrictionsApiTargetArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.apiTargets = mapped
    }

    /**
     * @param value The HTTP referrers (websites) that are allowed to use the key.
     */
    @JvmName("rjhcukqgwqfmurlr")
    public suspend fun browserKeyRestrictions(`value`: ApiKeyRestrictionsBrowserKeyRestrictionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.browserKeyRestrictions = mapped
    }

    /**
     * @param argument The HTTP referrers (websites) that are allowed to use the key.
     */
    @JvmName("fufentsdtbttgvqq")
    public suspend fun browserKeyRestrictions(argument: suspend ApiKeyRestrictionsBrowserKeyRestrictionsArgsBuilder.() -> Unit) {
        val toBeMapped = ApiKeyRestrictionsBrowserKeyRestrictionsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.browserKeyRestrictions = mapped
    }

    /**
     * @param value The iOS apps that are allowed to use the key.
     */
    @JvmName("hithbqtoxwryugjv")
    public suspend fun iosKeyRestrictions(`value`: ApiKeyRestrictionsIosKeyRestrictionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.iosKeyRestrictions = mapped
    }

    /**
     * @param argument The iOS apps that are allowed to use the key.
     */
    @JvmName("xjcloppfpiequhdx")
    public suspend fun iosKeyRestrictions(argument: suspend ApiKeyRestrictionsIosKeyRestrictionsArgsBuilder.() -> Unit) {
        val toBeMapped = ApiKeyRestrictionsIosKeyRestrictionsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.iosKeyRestrictions = mapped
    }

    /**
     * @param value The IP addresses of callers that are allowed to use the key.
     */
    @JvmName("abiilwabbyebptuy")
    public suspend fun serverKeyRestrictions(`value`: ApiKeyRestrictionsServerKeyRestrictionsArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.serverKeyRestrictions = mapped
    }

    /**
     * @param argument The IP addresses of callers that are allowed to use the key.
     */
    @JvmName("sosxmmhpbgxmrylb")
    public suspend fun serverKeyRestrictions(argument: suspend ApiKeyRestrictionsServerKeyRestrictionsArgsBuilder.() -> Unit) {
        val toBeMapped = ApiKeyRestrictionsServerKeyRestrictionsArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.serverKeyRestrictions = mapped
    }

    internal fun build(): ApiKeyRestrictionsArgs = ApiKeyRestrictionsArgs(
        androidKeyRestrictions = androidKeyRestrictions,
        apiTargets = apiTargets,
        browserKeyRestrictions = browserKeyRestrictions,
        iosKeyRestrictions = iosKeyRestrictions,
        serverKeyRestrictions = serverKeyRestrictions,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy