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

com.pulumi.gcp.cloudscheduler.kotlin.inputs.JobHttpTargetArgs.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.cloudscheduler.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
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.Map
import kotlin.jvm.JvmName

/**
 *
 * @property body HTTP request body.
 * A request body is allowed only if the HTTP method is POST, PUT, or PATCH.
 * It is an error to set body on a job with an incompatible HttpMethod.
 * A base64-encoded string.
 * @property headers This map contains the header field names and values.
 * Repeated headers are not supported, but a header value can contain commas.
 * @property httpMethod Which HTTP method to use for the request.
 * @property oauthToken Contains information needed for generating an OAuth token.
 * This type of authorization should be used when sending requests to a GCP endpoint.
 * Structure is documented below.
 * @property oidcToken Contains information needed for generating an OpenID Connect token.
 * This type of authorization should be used when sending requests to third party endpoints or Cloud Run.
 * Structure is documented below.
 * @property uri The full URI path that the request will be sent to.
 */
public data class JobHttpTargetArgs(
    public val body: Output? = null,
    public val headers: Output>? = null,
    public val httpMethod: Output? = null,
    public val oauthToken: Output? = null,
    public val oidcToken: Output? = null,
    public val uri: Output,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs =
        com.pulumi.gcp.cloudscheduler.inputs.JobHttpTargetArgs.builder()
            .body(body?.applyValue({ args0 -> args0 }))
            .headers(headers?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .httpMethod(httpMethod?.applyValue({ args0 -> args0 }))
            .oauthToken(oauthToken?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .oidcToken(oidcToken?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .uri(uri.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [JobHttpTargetArgs].
 */
@PulumiTagMarker
public class JobHttpTargetArgsBuilder internal constructor() {
    private var body: Output? = null

    private var headers: Output>? = null

    private var httpMethod: Output? = null

    private var oauthToken: Output? = null

    private var oidcToken: Output? = null

    private var uri: Output? = null

    /**
     * @param value HTTP request body.
     * A request body is allowed only if the HTTP method is POST, PUT, or PATCH.
     * It is an error to set body on a job with an incompatible HttpMethod.
     * A base64-encoded string.
     */
    @JvmName("qbhcktrwfmvigdtd")
    public suspend fun body(`value`: Output) {
        this.body = value
    }

    /**
     * @param value This map contains the header field names and values.
     * Repeated headers are not supported, but a header value can contain commas.
     */
    @JvmName("wghomfhkgwdycljf")
    public suspend fun headers(`value`: Output>) {
        this.headers = value
    }

    /**
     * @param value Which HTTP method to use for the request.
     */
    @JvmName("mbmhyyywngipwhtl")
    public suspend fun httpMethod(`value`: Output) {
        this.httpMethod = value
    }

    /**
     * @param value Contains information needed for generating an OAuth token.
     * This type of authorization should be used when sending requests to a GCP endpoint.
     * Structure is documented below.
     */
    @JvmName("dcmudddgyflsvgfy")
    public suspend fun oauthToken(`value`: Output) {
        this.oauthToken = value
    }

    /**
     * @param value Contains information needed for generating an OpenID Connect token.
     * This type of authorization should be used when sending requests to third party endpoints or Cloud Run.
     * Structure is documented below.
     */
    @JvmName("enhsffeamkipnhvf")
    public suspend fun oidcToken(`value`: Output) {
        this.oidcToken = value
    }

    /**
     * @param value The full URI path that the request will be sent to.
     */
    @JvmName("yphaiiagrycdegvq")
    public suspend fun uri(`value`: Output) {
        this.uri = value
    }

    /**
     * @param value HTTP request body.
     * A request body is allowed only if the HTTP method is POST, PUT, or PATCH.
     * It is an error to set body on a job with an incompatible HttpMethod.
     * A base64-encoded string.
     */
    @JvmName("jnqivwrsupbfoada")
    public suspend fun body(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.body = mapped
    }

    /**
     * @param value This map contains the header field names and values.
     * Repeated headers are not supported, but a header value can contain commas.
     */
    @JvmName("mlbfqpvaslpwrxke")
    public suspend fun headers(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param values This map contains the header field names and values.
     * Repeated headers are not supported, but a header value can contain commas.
     */
    @JvmName("pppjirlsufuswxtb")
    public fun headers(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param value Which HTTP method to use for the request.
     */
    @JvmName("vmxpkdpgaijlgjyw")
    public suspend fun httpMethod(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpMethod = mapped
    }

    /**
     * @param value Contains information needed for generating an OAuth token.
     * This type of authorization should be used when sending requests to a GCP endpoint.
     * Structure is documented below.
     */
    @JvmName("jovcpipnpmskqkyw")
    public suspend fun oauthToken(`value`: JobHttpTargetOauthTokenArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.oauthToken = mapped
    }

    /**
     * @param argument Contains information needed for generating an OAuth token.
     * This type of authorization should be used when sending requests to a GCP endpoint.
     * Structure is documented below.
     */
    @JvmName("gdduvvyaksqafncc")
    public suspend fun oauthToken(argument: suspend JobHttpTargetOauthTokenArgsBuilder.() -> Unit) {
        val toBeMapped = JobHttpTargetOauthTokenArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.oauthToken = mapped
    }

    /**
     * @param value Contains information needed for generating an OpenID Connect token.
     * This type of authorization should be used when sending requests to third party endpoints or Cloud Run.
     * Structure is documented below.
     */
    @JvmName("eomlmmijcbhbrvji")
    public suspend fun oidcToken(`value`: JobHttpTargetOidcTokenArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.oidcToken = mapped
    }

    /**
     * @param argument Contains information needed for generating an OpenID Connect token.
     * This type of authorization should be used when sending requests to third party endpoints or Cloud Run.
     * Structure is documented below.
     */
    @JvmName("hgwebyynegqilbsr")
    public suspend fun oidcToken(argument: suspend JobHttpTargetOidcTokenArgsBuilder.() -> Unit) {
        val toBeMapped = JobHttpTargetOidcTokenArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.oidcToken = mapped
    }

    /**
     * @param value The full URI path that the request will be sent to.
     */
    @JvmName("eliyptynlybayiyv")
    public suspend fun uri(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.uri = mapped
    }

    internal fun build(): JobHttpTargetArgs = JobHttpTargetArgs(
        body = body,
        headers = headers,
        httpMethod = httpMethod,
        oauthToken = oauthToken,
        oidcToken = oidcToken,
        uri = uri ?: throw PulumiNullFieldException("uri"),
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy