
com.pulumi.azurenative.apimanagement.kotlin.SchemaArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.apimanagement.kotlin
import com.pulumi.azurenative.apimanagement.SchemaArgs.builder
import com.pulumi.azurenative.apimanagement.kotlin.enums.SchemaType
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Schema Contract details.
* Azure REST API version: 2021-04-01-preview. Prior API version in Azure Native 1.x: 2021-04-01-preview.
* ## Example Usage
* ### ApiManagementCreateSchema1
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var schema = new AzureNative.ApiManagement.Schema("schema", new()
* {
* Description = "sample schema description",
* ResourceGroupName = "rg1",
* SchemaId = "schema1",
* SchemaType = AzureNative.ApiManagement.SchemaType.Xml,
* ServiceName = "apimService1",
* Value = @"
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* ",
* });
* });
* ```
* ```go
* package main
* import (
* apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := apimanagement.NewSchema(ctx, "schema", &apimanagement.SchemaArgs{
* Description: pulumi.String("sample schema description"),
* ResourceGroupName: pulumi.String("rg1"),
* SchemaId: pulumi.String("schema1"),
* SchemaType: pulumi.String(apimanagement.SchemaTypeXml),
* ServiceName: pulumi.String("apimService1"),
* Value: pulumi.String(`
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* `),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.apimanagement.Schema;
* import com.pulumi.azurenative.apimanagement.SchemaArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var schema = new Schema("schema", SchemaArgs.builder()
* .description("sample schema description")
* .resourceGroupName("rg1")
* .schemaId("schema1")
* .schemaType("xml")
* .serviceName("apimService1")
* .value("""
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
* """)
* .build());
* }
* }
* ```
* ### ApiManagementCreateSchema2
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var schema = new AzureNative.ApiManagement.Schema("schema", new()
* {
* Description = "sample schema description",
* ResourceGroupName = "rg1",
* SchemaId = "schema1",
* SchemaType = AzureNative.ApiManagement.SchemaType.Json,
* ServiceName = "apimService1",
* });
* });
* ```
* ```go
* package main
* import (
* apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := apimanagement.NewSchema(ctx, "schema", &apimanagement.SchemaArgs{
* Description: pulumi.String("sample schema description"),
* ResourceGroupName: pulumi.String("rg1"),
* SchemaId: pulumi.String("schema1"),
* SchemaType: pulumi.String(apimanagement.SchemaTypeJson),
* ServiceName: pulumi.String("apimService1"),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.apimanagement.Schema;
* import com.pulumi.azurenative.apimanagement.SchemaArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var schema = new Schema("schema", SchemaArgs.builder()
* .description("sample schema description")
* .resourceGroupName("rg1")
* .schemaId("schema1")
* .schemaType("json")
* .serviceName("apimService1")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:apimanagement:Schema schema1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/schemas/{schemaId}
* ```
* @property description Free-form schema entity description.
* @property resourceGroupName The name of the resource group.
* @property schemaId Schema id identifier. Must be unique in the current API Management service instance.
* @property schemaType Schema Type. Immutable.
* @property serviceName The name of the API Management service.
* @property value Json-encoded string for non json-based schema.
*/
public data class SchemaArgs(
public val description: Output? = null,
public val resourceGroupName: Output? = null,
public val schemaId: Output? = null,
public val schemaType: Output>? = null,
public val serviceName: Output? = null,
public val `value`: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.apimanagement.SchemaArgs =
com.pulumi.azurenative.apimanagement.SchemaArgs.builder()
.description(description?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.schemaId(schemaId?.applyValue({ args0 -> args0 }))
.schemaType(
schemaType?.applyValue({ args0 ->
args0.transform({ args0 -> args0 }, { args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.serviceName(serviceName?.applyValue({ args0 -> args0 }))
.`value`(`value`?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [SchemaArgs].
*/
@PulumiTagMarker
public class SchemaArgsBuilder internal constructor() {
private var description: Output? = null
private var resourceGroupName: Output? = null
private var schemaId: Output? = null
private var schemaType: Output>? = null
private var serviceName: Output? = null
private var `value`: Output? = null
/**
* @param value Free-form schema entity description.
*/
@JvmName("brfrowsmsqugacfw")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value The name of the resource group.
*/
@JvmName("rbhupogekuvtnhyp")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value Schema id identifier. Must be unique in the current API Management service instance.
*/
@JvmName("igldkhsqckoqijcf")
public suspend fun schemaId(`value`: Output) {
this.schemaId = value
}
/**
* @param value Schema Type. Immutable.
*/
@JvmName("ivnelgatmdccfnnw")
public suspend fun schemaType(`value`: Output>) {
this.schemaType = value
}
/**
* @param value The name of the API Management service.
*/
@JvmName("olxmmtfqurroxwnf")
public suspend fun serviceName(`value`: Output) {
this.serviceName = value
}
/**
* @param value Json-encoded string for non json-based schema.
*/
@JvmName("siisgqxuhuvtxrgg")
public suspend fun `value`(`value`: Output) {
this.`value` = value
}
/**
* @param value Free-form schema entity description.
*/
@JvmName("acpabgwjeacddmex")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value The name of the resource group.
*/
@JvmName("sabsiuisotuamnrw")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
/**
* @param value Schema id identifier. Must be unique in the current API Management service instance.
*/
@JvmName("irdnyxutinjucpmt")
public suspend fun schemaId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.schemaId = mapped
}
/**
* @param value Schema Type. Immutable.
*/
@JvmName("dcyeavoggbaygaoc")
public suspend fun schemaType(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.schemaType = mapped
}
/**
* @param value Schema Type. Immutable.
*/
@JvmName("roxheikckwrtmamo")
public fun schemaType(`value`: String) {
val toBeMapped = Either.ofLeft(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.schemaType = mapped
}
/**
* @param value Schema Type. Immutable.
*/
@JvmName("nijllfprngradwng")
public fun schemaType(`value`: SchemaType) {
val toBeMapped = Either.ofRight(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.schemaType = mapped
}
/**
* @param value The name of the API Management service.
*/
@JvmName("goioirkqafikhcuo")
public suspend fun serviceName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.serviceName = mapped
}
/**
* @param value Json-encoded string for non json-based schema.
*/
@JvmName("ymfbkeneovflsyla")
public suspend fun `value`(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.`value` = mapped
}
internal fun build(): SchemaArgs = SchemaArgs(
description = description,
resourceGroupName = resourceGroupName,
schemaId = schemaId,
schemaType = schemaType,
serviceName = serviceName,
`value` = `value`,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy