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

com.pulumi.googlenative.cloudscheduler.v1.kotlin.inputs.HttpTargetArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.cloudscheduler.v1.kotlin.inputs

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.cloudscheduler.v1.inputs.HttpTargetArgs.builder
import com.pulumi.googlenative.cloudscheduler.v1.kotlin.enums.HttpTargetHttpMethod
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

/**
 * Http target. The job will be pushed to the job handler by means of an HTTP request via an http_method such as HTTP POST, HTTP GET, etc. The job is acknowledged by means of an HTTP response code in the range [200 - 299]. A failure to receive a response constitutes a failed execution. For a redirected request, the response returned by the redirected request is considered.
 * @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.
 * @property headers The user can specify HTTP request headers to send with the job's HTTP request. This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas. These headers represent a subset of the headers that will accompany the job's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is below: - Host: This will be computed by Cloud Scheduler and derived from uri. * `Content-Length`: This will be computed by Cloud Scheduler. * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. * `X-Google-*`: Google internal use only. * `X-AppEngine-*`: Google internal use only. * `X-CloudScheduler`: This header will be set to true. * `X-CloudScheduler-JobName`: This header will contain the job name. * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the unix-cron format, this header will contain the job schedule time in RFC3339 UTC "Zulu" format. The total size of headers must be less than 80KB.
 * @property httpMethod Which HTTP method to use for the request.
 * @property oauthToken If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.
 * @property oidcToken If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
 * @property uri The full URI path that the request will be sent to. This string must begin with either "http://" or "https://". Some examples of valid values for uri are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will encode some characters for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding.
 */
public data class HttpTargetArgs(
    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.googlenative.cloudscheduler.v1.inputs.HttpTargetArgs =
        com.pulumi.googlenative.cloudscheduler.v1.inputs.HttpTargetArgs.builder()
            .body(body?.applyValue({ args0 -> args0 }))
            .headers(headers?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .httpMethod(httpMethod?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .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 [HttpTargetArgs].
 */
@PulumiTagMarker
public class HttpTargetArgsBuilder 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.
     */
    @JvmName("ggmrvublaoussibk")
    public suspend fun body(`value`: Output) {
        this.body = value
    }

    /**
     * @param value The user can specify HTTP request headers to send with the job's HTTP request. This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas. These headers represent a subset of the headers that will accompany the job's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is below: - Host: This will be computed by Cloud Scheduler and derived from uri. * `Content-Length`: This will be computed by Cloud Scheduler. * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. * `X-Google-*`: Google internal use only. * `X-AppEngine-*`: Google internal use only. * `X-CloudScheduler`: This header will be set to true. * `X-CloudScheduler-JobName`: This header will contain the job name. * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the unix-cron format, this header will contain the job schedule time in RFC3339 UTC "Zulu" format. The total size of headers must be less than 80KB.
     */
    @JvmName("kbbnihqjmdecrgda")
    public suspend fun headers(`value`: Output>) {
        this.headers = value
    }

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

    /**
     * @param value If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.
     */
    @JvmName("osfcxwlqpptgefmg")
    public suspend fun oauthToken(`value`: Output) {
        this.oauthToken = value
    }

    /**
     * @param value If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
     */
    @JvmName("sfendbtfaosgenkv")
    public suspend fun oidcToken(`value`: Output) {
        this.oidcToken = value
    }

    /**
     * @param value The full URI path that the request will be sent to. This string must begin with either "http://" or "https://". Some examples of valid values for uri are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will encode some characters for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding.
     */
    @JvmName("bfnojlfbmygayrax")
    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.
     */
    @JvmName("savbsnlgkdspaubj")
    public suspend fun body(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.body = mapped
    }

    /**
     * @param value The user can specify HTTP request headers to send with the job's HTTP request. This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas. These headers represent a subset of the headers that will accompany the job's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is below: - Host: This will be computed by Cloud Scheduler and derived from uri. * `Content-Length`: This will be computed by Cloud Scheduler. * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. * `X-Google-*`: Google internal use only. * `X-AppEngine-*`: Google internal use only. * `X-CloudScheduler`: This header will be set to true. * `X-CloudScheduler-JobName`: This header will contain the job name. * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the unix-cron format, this header will contain the job schedule time in RFC3339 UTC "Zulu" format. The total size of headers must be less than 80KB.
     */
    @JvmName("vaacyrdvchrbhjgb")
    public suspend fun headers(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.headers = mapped
    }

    /**
     * @param values The user can specify HTTP request headers to send with the job's HTTP request. This map contains the header field names and values. Repeated headers are not supported, but a header value can contain commas. These headers represent a subset of the headers that will accompany the job's HTTP request. Some HTTP request headers will be ignored or replaced. A partial list of headers that will be ignored or replaced is below: - Host: This will be computed by Cloud Scheduler and derived from uri. * `Content-Length`: This will be computed by Cloud Scheduler. * `User-Agent`: This will be set to `"Google-Cloud-Scheduler"`. * `X-Google-*`: Google internal use only. * `X-AppEngine-*`: Google internal use only. * `X-CloudScheduler`: This header will be set to true. * `X-CloudScheduler-JobName`: This header will contain the job name. * `X-CloudScheduler-ScheduleTime`: For Cloud Scheduler jobs specified in the unix-cron format, this header will contain the job schedule time in RFC3339 UTC "Zulu" format. The total size of headers must be less than 80KB.
     */
    @JvmName("aeafbremobpaqtgl")
    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("esnidbbxayyhpxkr")
    public suspend fun httpMethod(`value`: HttpTargetHttpMethod?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.httpMethod = mapped
    }

    /**
     * @param value If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.
     */
    @JvmName("vhnerclobldpxgko")
    public suspend fun oauthToken(`value`: OAuthTokenArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.oauthToken = mapped
    }

    /**
     * @param argument If specified, an [OAuth token](https://developers.google.com/identity/protocols/OAuth2) will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization should generally only be used when calling Google APIs hosted on *.googleapis.com.
     */
    @JvmName("avifkpoyfwxtpbdq")
    public suspend fun oauthToken(argument: suspend OAuthTokenArgsBuilder.() -> Unit) {
        val toBeMapped = OAuthTokenArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.oauthToken = mapped
    }

    /**
     * @param value If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
     */
    @JvmName("vwdiymthestoxphs")
    public suspend fun oidcToken(`value`: OidcTokenArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.oidcToken = mapped
    }

    /**
     * @param argument If specified, an [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) token will be generated and attached as an `Authorization` header in the HTTP request. This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
     */
    @JvmName("oxrbwuxabvwijihp")
    public suspend fun oidcToken(argument: suspend OidcTokenArgsBuilder.() -> Unit) {
        val toBeMapped = OidcTokenArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.oidcToken = mapped
    }

    /**
     * @param value The full URI path that the request will be sent to. This string must begin with either "http://" or "https://". Some examples of valid values for uri are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Scheduler will encode some characters for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding.
     */
    @JvmName("fnlkkjpfgbgahkti")
    public suspend fun uri(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.uri = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy