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

com.pulumi.azurenative.apimanagement.kotlin.GlobalSchemaArgs.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: 2.82.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azurenative.apimanagement.kotlin

import com.pulumi.azurenative.apimanagement.GlobalSchemaArgs.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.Any
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Global Schema Contract details.
 * Azure REST API version: 2022-08-01.
 * Other available API versions: 2022-09-01-preview, 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01.
 * ## Example Usage
 * ### ApiManagementCreateSchema1
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using AzureNative = Pulumi.AzureNative;
 * return await Deployment.RunAsync(() =>
 * {
 *     var globalSchema = new AzureNative.ApiManagement.GlobalSchema("globalSchema", 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.NewGlobalSchema(ctx, "globalSchema", &apimanagement.GlobalSchemaArgs{
 * 			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.Any(`
 *  
 *  
 *   
 *    
 *    
 *   
 *   
 *  
 *  
 *   
 *    
 *    
 *    
 *    
 *    
 *   
 *   
 *  
 * `),
 * 		})
 * 		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.GlobalSchema;
 * import com.pulumi.azurenative.apimanagement.GlobalSchemaArgs;
 * 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 globalSchema = new GlobalSchema("globalSchema", GlobalSchemaArgs.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 globalSchema = new AzureNative.ApiManagement.GlobalSchema("globalSchema", 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.NewGlobalSchema(ctx, "globalSchema", &apimanagement.GlobalSchemaArgs{
 * 			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.GlobalSchema;
 * import com.pulumi.azurenative.apimanagement.GlobalSchemaArgs;
 * 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 globalSchema = new GlobalSchema("globalSchema", GlobalSchemaArgs.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:GlobalSchema 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. The name is case insensitive.
 * @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 GlobalSchemaArgs(
    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.GlobalSchemaArgs =
        com.pulumi.azurenative.apimanagement.GlobalSchemaArgs.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 [GlobalSchemaArgs].
 */
@PulumiTagMarker
public class GlobalSchemaArgsBuilder 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("hhqhokelqahhdnwk")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The name of the resource group. The name is case insensitive.
     */
    @JvmName("nfjmikhxjoqhvjwn")
    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("kkkshlstvgfdctso")
    public suspend fun schemaId(`value`: Output) {
        this.schemaId = value
    }

    /**
     * @param value Schema Type. Immutable.
     */
    @JvmName("dlcejwuigcjtreoi")
    public suspend fun schemaType(`value`: Output>) {
        this.schemaType = value
    }

    /**
     * @param value The name of the API Management service.
     */
    @JvmName("hyolmpliwpyuirax")
    public suspend fun serviceName(`value`: Output) {
        this.serviceName = value
    }

    /**
     * @param value Json-encoded string for non json-based schema.
     */
    @JvmName("oiwwibmayjggdsap")
    public suspend fun `value`(`value`: Output) {
        this.`value` = value
    }

    /**
     * @param value Free-form schema entity description.
     */
    @JvmName("vmetfoameijgivdo")
    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. The name is case insensitive.
     */
    @JvmName("dvhgxujprwwmripy")
    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("vmmbsjumcbahxkit")
    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("pygxaocihpymmgmy")
    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("pgtuvxepyupnedqi")
    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("jydegrtcanjiyrij")
    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("csdtqggjhbtoreqn")
    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("xqpyxjekulffmsny")
    public suspend fun `value`(`value`: Any?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`value` = mapped
    }

    internal fun build(): GlobalSchemaArgs = GlobalSchemaArgs(
        description = description,
        resourceGroupName = resourceGroupName,
        schemaId = schemaId,
        schemaType = schemaType,
        serviceName = serviceName,
        `value` = `value`,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy