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

com.pulumi.azure.apimanagement.kotlin.inputs.ApiOperationRequestRepresentationArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.apimanagement.kotlin.inputs

import com.pulumi.azure.apimanagement.inputs.ApiOperationRequestRepresentationArgs.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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 *
 * @property contentType The Content Type of this representation, such as `application/json`.
 * @property examples One or more `example` blocks as defined above.
 * @property formParameters One or more `form_parameter` block as defined above.
 * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
 * @property schemaId The ID of an API Management Schema which represents this Response.
 * > **NOTE:** This can only be specified when `content_type` is not set to `application/x-www-form-urlencoded` or `multipart/form-data`.
 * @property typeName The Type Name defined by the Schema.
 * > **NOTE:** This can only be specified when `content_type` is not set to `application/x-www-form-urlencoded` or `multipart/form-data`.
 */
public data class ApiOperationRequestRepresentationArgs(
    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.azure.apimanagement.inputs.ApiOperationRequestRepresentationArgs =
        com.pulumi.azure.apimanagement.inputs.ApiOperationRequestRepresentationArgs.builder()
            .contentType(contentType.applyValue({ args0 -> args0 }))
            .examples(
                examples?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .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 [ApiOperationRequestRepresentationArgs].
 */
@PulumiTagMarker
public class ApiOperationRequestRepresentationArgsBuilder 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 The Content Type of this representation, such as `application/json`.
     */
    @JvmName("ujnfbequpxifytsk")
    public suspend fun contentType(`value`: Output) {
        this.contentType = value
    }

    /**
     * @param value One or more `example` blocks as defined above.
     */
    @JvmName("pcgliyysqwcjxijb")
    public suspend fun examples(`value`: Output>) {
        this.examples = value
    }

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

    /**
     * @param values One or more `example` blocks as defined above.
     */
    @JvmName("djttiwwhttlbdqvt")
    public suspend fun examples(values: List>) {
        this.examples = Output.all(values)
    }

    /**
     * @param value One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("pxprdejadormwcjl")
    public suspend
    fun formParameters(`value`: Output>) {
        this.formParameters = value
    }

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

    /**
     * @param values One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("iuloihwntfntsixf")
    public suspend
    fun formParameters(values: List>) {
        this.formParameters = Output.all(values)
    }

    /**
     * @param value The ID of an API Management Schema which represents this Response.
     * > **NOTE:** This can only be specified when `content_type` is not set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("kydumdctqmfuksav")
    public suspend fun schemaId(`value`: Output) {
        this.schemaId = value
    }

    /**
     * @param value The Type Name defined by the Schema.
     * > **NOTE:** This can only be specified when `content_type` is not set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("bnoucwpqwbuuvavy")
    public suspend fun typeName(`value`: Output) {
        this.typeName = value
    }

    /**
     * @param value The Content Type of this representation, such as `application/json`.
     */
    @JvmName("ljsirgjknsxemgtf")
    public suspend fun contentType(`value`: String) {
        val toBeMapped = value
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.contentType = mapped
    }

    /**
     * @param value One or more `example` blocks as defined above.
     */
    @JvmName("ffoyrvqchsoimnph")
    public suspend fun examples(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.examples = mapped
    }

    /**
     * @param argument One or more `example` blocks as defined above.
     */
    @JvmName("uxqndbwvxpwbviom")
    public suspend
    fun examples(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiOperationRequestRepresentationExampleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.examples = mapped
    }

    /**
     * @param argument One or more `example` blocks as defined above.
     */
    @JvmName("acvnyoytfudhoqqc")
    public suspend fun examples(
        vararg
        argument: suspend ApiOperationRequestRepresentationExampleArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            ApiOperationRequestRepresentationExampleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.examples = mapped
    }

    /**
     * @param argument One or more `example` blocks as defined above.
     */
    @JvmName("fdhupthfikilxsga")
    public suspend
    fun examples(argument: suspend ApiOperationRequestRepresentationExampleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApiOperationRequestRepresentationExampleArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.examples = mapped
    }

    /**
     * @param values One or more `example` blocks as defined above.
     */
    @JvmName("pjwwtbyathkfsfem")
    public suspend fun examples(vararg values: ApiOperationRequestRepresentationExampleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.examples = mapped
    }

    /**
     * @param value One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("phvjjiguurpcwgbh")
    public suspend
    fun formParameters(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.formParameters = mapped
    }

    /**
     * @param argument One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("limxxhxqkuxgnbgx")
    public suspend
    fun formParameters(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            ApiOperationRequestRepresentationFormParameterArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.formParameters = mapped
    }

    /**
     * @param argument One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("jxpewlvgjcjpnanf")
    public suspend fun formParameters(
        vararg
        argument: suspend ApiOperationRequestRepresentationFormParameterArgsBuilder.() -> Unit,
    ) {
        val toBeMapped = argument.toList().map {
            ApiOperationRequestRepresentationFormParameterArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.formParameters = mapped
    }

    /**
     * @param argument One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("idcjkjfqcbgiqebi")
    public suspend
    fun formParameters(argument: suspend ApiOperationRequestRepresentationFormParameterArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            ApiOperationRequestRepresentationFormParameterArgsBuilder().applySuspend
                { argument() }.build(),
        )
        val mapped = of(toBeMapped)
        this.formParameters = mapped
    }

    /**
     * @param values One or more `form_parameter` block as defined above.
     * > **NOTE:** This is Required when `content_type` is set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("oghhikimubijdxjs")
    public suspend fun formParameters(
        vararg
        values: ApiOperationRequestRepresentationFormParameterArgs,
    ) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.formParameters = mapped
    }

    /**
     * @param value The ID of an API Management Schema which represents this Response.
     * > **NOTE:** This can only be specified when `content_type` is not set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("dviqjugfploamdmd")
    public suspend fun schemaId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schemaId = mapped
    }

    /**
     * @param value The Type Name defined by the Schema.
     * > **NOTE:** This can only be specified when `content_type` is not set to `application/x-www-form-urlencoded` or `multipart/form-data`.
     */
    @JvmName("qaxduopqekefaknn")
    public suspend fun typeName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.typeName = mapped
    }

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy