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

com.pulumi.azurenative.apimanagement.kotlin.inputs.RepresentationContractArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azurenative.apimanagement.kotlin.inputs

import com.pulumi.azurenative.apimanagement.inputs.RepresentationContractArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
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.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Operation request/response representation details.
 * @property contentType Specifies a registered or custom content type for this representation, e.g. application/xml.
 * @property examples Exampled defined for the representation.
 * @property formParameters Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
 * @property schemaId Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
 * @property typeName Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
 */
public data class RepresentationContractArgs(
    public val contentType: Output,
    public val examples: Output>? = null,
    public val formParameters: Output>? = null,
    public val schemaId: Output? = null,
    public val typeName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azurenative.apimanagement.inputs.RepresentationContractArgs =
        com.pulumi.azurenative.apimanagement.inputs.RepresentationContractArgs.builder()
            .contentType(contentType.applyValue({ args0 -> args0 }))
            .examples(
                examples?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value.let({ args0 -> args0.toJava() }))
                    }).toMap()
                }),
            )
            .formParameters(
                formParameters?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .schemaId(schemaId?.applyValue({ args0 -> args0 }))
            .typeName(typeName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [RepresentationContractArgs].
 */
@PulumiTagMarker
public class RepresentationContractArgsBuilder internal constructor() {
    private var contentType: Output? = null

    private var examples: Output>? = null

    private var formParameters: Output>? = null

    private var schemaId: Output? = null

    private var typeName: Output? = null

    /**
     * @param value Specifies a registered or custom content type for this representation, e.g. application/xml.
     */
    @JvmName("ditpbcyrhmfrvsky")
    public suspend fun contentType(`value`: Output) {
        this.contentType = value
    }

    /**
     * @param value Exampled defined for the representation.
     */
    @JvmName("xaqpebkwbdycpuhp")
    public suspend fun examples(`value`: Output>) {
        this.examples = value
    }

    /**
     * @param value Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("rrfsmvayoymfjhfq")
    public suspend fun formParameters(`value`: Output>) {
        this.formParameters = value
    }

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

    /**
     * @param values Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("jlnbegjpqfeuedbg")
    public suspend fun formParameters(values: List>) {
        this.formParameters = Output.all(values)
    }

    /**
     * @param value Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
     */
    @JvmName("bdatulbwscecaqgj")
    public suspend fun schemaId(`value`: Output) {
        this.schemaId = value
    }

    /**
     * @param value Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
     */
    @JvmName("wfctvtjpoajpafnm")
    public suspend fun typeName(`value`: Output) {
        this.typeName = value
    }

    /**
     * @param value Specifies a registered or custom content type for this representation, e.g. application/xml.
     */
    @JvmName("okuxivcbjqmoettb")
    public suspend fun contentType(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.contentType = mapped
    }

    /**
     * @param value Exampled defined for the representation.
     */
    @JvmName("lgnrlyxosudjliyv")
    public suspend fun examples(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.examples = mapped
    }

    /**
     * @param argument Exampled defined for the representation.
     */
    @JvmName("kcrpuuwnjsfgvejb")
    public suspend fun examples(vararg argument: Pair Unit>) {
        val toBeMapped = argument.toList().map { (left, right) ->
            left to
                ParameterExampleContractArgsBuilder().applySuspend { right() }.build()
        }.toMap()
        val mapped = of(toBeMapped)
        this.examples = mapped
    }

    /**
     * @param values Exampled defined for the representation.
     */
    @JvmName("ewlrksjmoksgxqmu")
    public fun examples(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.examples = mapped
    }

    /**
     * @param value Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("ngoiqneocnmhnqtn")
    public suspend fun formParameters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.formParameters = mapped
    }

    /**
     * @param argument Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("ijhoxdkyirbgptdx")
    public suspend fun formParameters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ParameterContractArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.formParameters = mapped
    }

    /**
     * @param argument Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("wenxlcgtlorcbkpi")
    public suspend fun formParameters(vararg argument: suspend ParameterContractArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            ParameterContractArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.formParameters = mapped
    }

    /**
     * @param argument Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("gkspblgvpbolvxvu")
    public suspend fun formParameters(argument: suspend ParameterContractArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(ParameterContractArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.formParameters = mapped
    }

    /**
     * @param values Collection of form parameters. Required if 'contentType' value is either 'application/x-www-form-urlencoded' or 'multipart/form-data'..
     */
    @JvmName("dfywjrnncpoinssa")
    public suspend fun formParameters(vararg values: ParameterContractArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.formParameters = mapped
    }

    /**
     * @param value Schema identifier. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
     */
    @JvmName("tdnviopcsbtpmfee")
    public suspend fun schemaId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schemaId = mapped
    }

    /**
     * @param value Type name defined by the schema. Applicable only if 'contentType' value is neither 'application/x-www-form-urlencoded' nor 'multipart/form-data'.
     */
    @JvmName("yfppjutceeofmbkq")
    public suspend fun typeName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.typeName = mapped
    }

    internal fun build(): RepresentationContractArgs = RepresentationContractArgs(
        contentType = contentType ?: throw PulumiNullFieldException("contentType"),
        examples = examples,
        formParameters = formParameters,
        schemaId = schemaId,
        typeName = typeName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy