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

com.pulumi.cloudflare.kotlin.inputs.GetLoadBalancerPoolsPoolOrigin.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: 5.47.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin.inputs

import com.pulumi.cloudflare.inputs.GetLoadBalancerPoolsPoolOrigin.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.Double
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property address The IP address (IPv4 or IPv6) of the origin, or the publicly addressable hostname.
 * @property enabled Whether this origin is enabled. Disabled origins will not receive traffic and are excluded from health checks.
 * @property headers HTTP request headers.
 * @property name A human-identifiable name for the origin.
 * @property virtualNetworkId The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.
 * @property weight The weight (0.01 - 1.00) of this origin, relative to other origins in the pool. Equal values mean equal weighting. A weight of 0 means traffic will not be sent to this origin, but health is still checked. When `origin_steering.policy="least_outstanding_requests"`, weight is used to scale the origin's outstanding requests. When `origin_steering.policy="least_connections"`, weight is used to scale the origin's open connections.
 */
public data class GetLoadBalancerPoolsPoolOrigin(
    public val address: String,
    public val enabled: Boolean? = null,
    public val headers: List? = null,
    public val name: String,
    public val virtualNetworkId: String? = null,
    public val weight: Double? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.inputs.GetLoadBalancerPoolsPoolOrigin =
        com.pulumi.cloudflare.inputs.GetLoadBalancerPoolsPoolOrigin.builder()
            .address(address.let({ args0 -> args0 }))
            .enabled(enabled?.let({ args0 -> args0 }))
            .headers(headers?.let({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .name(name.let({ args0 -> args0 }))
            .virtualNetworkId(virtualNetworkId?.let({ args0 -> args0 }))
            .weight(weight?.let({ args0 -> args0 })).build()
}

/**
 * Builder for [GetLoadBalancerPoolsPoolOrigin].
 */
@PulumiTagMarker
public class GetLoadBalancerPoolsPoolOriginBuilder internal constructor() {
    private var address: String? = null

    private var enabled: Boolean? = null

    private var headers: List? = null

    private var name: String? = null

    private var virtualNetworkId: String? = null

    private var weight: Double? = null

    /**
     * @param value The IP address (IPv4 or IPv6) of the origin, or the publicly addressable hostname.
     */
    @JvmName("ltwoahtabnrxhnnb")
    public suspend fun address(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.address = mapped
    }

    /**
     * @param value Whether this origin is enabled. Disabled origins will not receive traffic and are excluded from health checks.
     */
    @JvmName("uohoywnvetmkwbek")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.enabled = mapped
    }

    /**
     * @param value HTTP request headers.
     */
    @JvmName("gtbsrkshvhrwsdto")
    public suspend fun headers(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.headers = mapped
    }

    /**
     * @param argument HTTP request headers.
     */
    @JvmName("ianqvhxdmeqjpmwo")
    public suspend fun headers(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            GetLoadBalancerPoolsPoolOriginHeaderBuilder().applySuspend { it() }.build()
        }
        val mapped = toBeMapped
        this.headers = mapped
    }

    /**
     * @param argument HTTP request headers.
     */
    @JvmName("abmqbxsxhunlbpxl")
    public suspend fun headers(vararg argument: suspend GetLoadBalancerPoolsPoolOriginHeaderBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            GetLoadBalancerPoolsPoolOriginHeaderBuilder().applySuspend { it() }.build()
        }
        val mapped = toBeMapped
        this.headers = mapped
    }

    /**
     * @param argument HTTP request headers.
     */
    @JvmName("lunjumijmvlcpvre")
    public suspend fun headers(argument: suspend GetLoadBalancerPoolsPoolOriginHeaderBuilder.() -> Unit) {
        val toBeMapped = listOf(
            GetLoadBalancerPoolsPoolOriginHeaderBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = toBeMapped
        this.headers = mapped
    }

    /**
     * @param values HTTP request headers.
     */
    @JvmName("jmghnetjgxncdyqw")
    public suspend fun headers(vararg values: GetLoadBalancerPoolsPoolOriginHeader) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.headers = mapped
    }

    /**
     * @param value A human-identifiable name for the origin.
     */
    @JvmName("wbeyuaqnklrslbki")
    public suspend fun name(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> args0 })
        this.name = mapped
    }

    /**
     * @param value The virtual network subnet ID the origin belongs in. Virtual network must also belong to the account.
     */
    @JvmName("crdlrdnnwnmqbhfd")
    public suspend fun virtualNetworkId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.virtualNetworkId = mapped
    }

    /**
     * @param value The weight (0.01 - 1.00) of this origin, relative to other origins in the pool. Equal values mean equal weighting. A weight of 0 means traffic will not be sent to this origin, but health is still checked. When `origin_steering.policy="least_outstanding_requests"`, weight is used to scale the origin's outstanding requests. When `origin_steering.policy="least_connections"`, weight is used to scale the origin's open connections.
     */
    @JvmName("cneoajbvncbumeql")
    public suspend fun weight(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> args0 })
        this.weight = mapped
    }

    internal fun build(): GetLoadBalancerPoolsPoolOrigin = GetLoadBalancerPoolsPoolOrigin(
        address = address ?: throw PulumiNullFieldException("address"),
        enabled = enabled,
        headers = headers,
        name = name ?: throw PulumiNullFieldException("name"),
        virtualNetworkId = virtualNetworkId,
        weight = weight,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy