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

com.pulumi.azure.apimanagement.kotlin.ApiSchemaArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.azure.apimanagement.kotlin

import com.pulumi.azure.apimanagement.ApiSchemaArgs.builder
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

/**
 * Manages an API Schema within an API Management Service.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * import * as std from "@pulumi/std";
 * const example = azure.apimanagement.getApi({
 *     name: "search-api",
 *     apiManagementName: "search-api-management",
 *     resourceGroupName: "search-service",
 *     revision: "2",
 * });
 * const exampleApiSchema = new azure.apimanagement.ApiSchema("example", {
 *     apiName: example.then(example => example.name),
 *     apiManagementName: example.then(example => example.apiManagementName),
 *     resourceGroupName: example.then(example => example.resourceGroupName),
 *     schemaId: "example-schema",
 *     contentType: "application/vnd.ms-azure-apim.xsd+xml",
 *     value: std.file({
 *         input: "api_management_api_schema.xml",
 *     }).then(invoke => invoke.result),
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * import pulumi_std as std
 * example = azure.apimanagement.get_api(name="search-api",
 *     api_management_name="search-api-management",
 *     resource_group_name="search-service",
 *     revision="2")
 * example_api_schema = azure.apimanagement.ApiSchema("example",
 *     api_name=example.name,
 *     api_management_name=example.api_management_name,
 *     resource_group_name=example.resource_group_name,
 *     schema_id="example-schema",
 *     content_type="application/vnd.ms-azure-apim.xsd+xml",
 *     value=std.file(input="api_management_api_schema.xml").result)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = Azure.ApiManagement.GetApi.Invoke(new()
 *     {
 *         Name = "search-api",
 *         ApiManagementName = "search-api-management",
 *         ResourceGroupName = "search-service",
 *         Revision = "2",
 *     });
 *     var exampleApiSchema = new Azure.ApiManagement.ApiSchema("example", new()
 *     {
 *         ApiName = example.Apply(getApiResult => getApiResult.Name),
 *         ApiManagementName = example.Apply(getApiResult => getApiResult.ApiManagementName),
 *         ResourceGroupName = example.Apply(getApiResult => getApiResult.ResourceGroupName),
 *         SchemaId = "example-schema",
 *         ContentType = "application/vnd.ms-azure-apim.xsd+xml",
 *         Value = Std.File.Invoke(new()
 *         {
 *             Input = "api_management_api_schema.xml",
 *         }).Apply(invoke => invoke.Result),
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
 * 			Name:              "search-api",
 * 			ApiManagementName: "search-api-management",
 * 			ResourceGroupName: "search-service",
 * 			Revision:          "2",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "api_management_api_schema.xml",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = apimanagement.NewApiSchema(ctx, "example", &apimanagement.ApiSchemaArgs{
 * 			ApiName:           pulumi.String(example.Name),
 * 			ApiManagementName: pulumi.String(example.ApiManagementName),
 * 			ResourceGroupName: pulumi.String(example.ResourceGroupName),
 * 			SchemaId:          pulumi.String("example-schema"),
 * 			ContentType:       pulumi.String("application/vnd.ms-azure-apim.xsd+xml"),
 * 			Value:             pulumi.String(invokeFile.Result),
 * 		})
 * 		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.azure.apimanagement.ApimanagementFunctions;
 * import com.pulumi.azure.apimanagement.inputs.GetApiArgs;
 * import com.pulumi.azure.apimanagement.ApiSchema;
 * import com.pulumi.azure.apimanagement.ApiSchemaArgs;
 * 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) {
 *         final var example = ApimanagementFunctions.getApi(GetApiArgs.builder()
 *             .name("search-api")
 *             .apiManagementName("search-api-management")
 *             .resourceGroupName("search-service")
 *             .revision("2")
 *             .build());
 *         var exampleApiSchema = new ApiSchema("exampleApiSchema", ApiSchemaArgs.builder()
 *             .apiName(example.applyValue(getApiResult -> getApiResult.name()))
 *             .apiManagementName(example.applyValue(getApiResult -> getApiResult.apiManagementName()))
 *             .resourceGroupName(example.applyValue(getApiResult -> getApiResult.resourceGroupName()))
 *             .schemaId("example-schema")
 *             .contentType("application/vnd.ms-azure-apim.xsd+xml")
 *             .value(StdFunctions.file(FileArgs.builder()
 *                 .input("api_management_api_schema.xml")
 *                 .build()).result())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   exampleApiSchema:
 *     type: azure:apimanagement:ApiSchema
 *     name: example
 *     properties:
 *       apiName: ${example.name}
 *       apiManagementName: ${example.apiManagementName}
 *       resourceGroupName: ${example.resourceGroupName}
 *       schemaId: example-schema
 *       contentType: application/vnd.ms-azure-apim.xsd+xml
 *       value:
 *         fn::invoke:
 *           Function: std:file
 *           Arguments:
 *             input: api_management_api_schema.xml
 *           Return: result
 * variables:
 *   example:
 *     fn::invoke:
 *       Function: azure:apimanagement:getApi
 *       Arguments:
 *         name: search-api
 *         apiManagementName: search-api-management
 *         resourceGroupName: search-service
 *         revision: '2'
 * ```
 * 
 * ## Import
 * API Management API Schema's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:apimanagement/apiSchema:ApiSchema example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.ApiManagement/service/instance1/apis/api1/schemas/schema1
 * ```
 * @property apiManagementName The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
 * @property apiName The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
 * @property components Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
 * @property contentType The content type of the API Schema.
 * @property definitions Types definitions. Used for Swagger/OpenAPI v1 schemas only.
 * @property resourceGroupName The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
 * @property schemaId A unique identifier for this API Schema. Changing this forces a new resource to be created.
 * @property value The JSON escaped string defining the document representing the Schema.
 */
public data class ApiSchemaArgs(
    public val apiManagementName: Output? = null,
    public val apiName: Output? = null,
    public val components: Output? = null,
    public val contentType: Output? = null,
    public val definitions: Output? = null,
    public val resourceGroupName: Output? = null,
    public val schemaId: Output? = null,
    public val `value`: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.apimanagement.ApiSchemaArgs =
        com.pulumi.azure.apimanagement.ApiSchemaArgs.builder()
            .apiManagementName(apiManagementName?.applyValue({ args0 -> args0 }))
            .apiName(apiName?.applyValue({ args0 -> args0 }))
            .components(components?.applyValue({ args0 -> args0 }))
            .contentType(contentType?.applyValue({ args0 -> args0 }))
            .definitions(definitions?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .schemaId(schemaId?.applyValue({ args0 -> args0 }))
            .`value`(`value`?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ApiSchemaArgs].
 */
@PulumiTagMarker
public class ApiSchemaArgsBuilder internal constructor() {
    private var apiManagementName: Output? = null

    private var apiName: Output? = null

    private var components: Output? = null

    private var contentType: Output? = null

    private var definitions: Output? = null

    private var resourceGroupName: Output? = null

    private var schemaId: Output? = null

    private var `value`: Output? = null

    /**
     * @param value The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
     */
    @JvmName("uebrmpdatuaghnyu")
    public suspend fun apiManagementName(`value`: Output) {
        this.apiManagementName = value
    }

    /**
     * @param value The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
     */
    @JvmName("fjyqyaytwaykvxqt")
    public suspend fun apiName(`value`: Output) {
        this.apiName = value
    }

    /**
     * @param value Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
     */
    @JvmName("nbnerxesjpotnutm")
    public suspend fun components(`value`: Output) {
        this.components = value
    }

    /**
     * @param value The content type of the API Schema.
     */
    @JvmName("mepvpwbjfpgiopqe")
    public suspend fun contentType(`value`: Output) {
        this.contentType = value
    }

    /**
     * @param value Types definitions. Used for Swagger/OpenAPI v1 schemas only.
     */
    @JvmName("uaaavkqlndowojgh")
    public suspend fun definitions(`value`: Output) {
        this.definitions = value
    }

    /**
     * @param value The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     */
    @JvmName("lmqyhkpsnrfirglh")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A unique identifier for this API Schema. Changing this forces a new resource to be created.
     */
    @JvmName("yhluisjpdooeappj")
    public suspend fun schemaId(`value`: Output) {
        this.schemaId = value
    }

    /**
     * @param value The JSON escaped string defining the document representing the Schema.
     */
    @JvmName("oufgnyqmuvrvvaaa")
    public suspend fun `value`(`value`: Output) {
        this.`value` = value
    }

    /**
     * @param value The Name of the API Management Service where the API exists. Changing this forces a new resource to be created.
     */
    @JvmName("fgpchyjtsaxmvnyp")
    public suspend fun apiManagementName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiManagementName = mapped
    }

    /**
     * @param value The name of the API within the API Management Service where this API Schema should be created. Changing this forces a new resource to be created.
     */
    @JvmName("hryagmhlehuhwoaa")
    public suspend fun apiName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.apiName = mapped
    }

    /**
     * @param value Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only.
     */
    @JvmName("qmicahlvtiqrglop")
    public suspend fun components(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.components = mapped
    }

    /**
     * @param value The content type of the API Schema.
     */
    @JvmName("djkwccxcbhscaoos")
    public suspend fun contentType(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.contentType = mapped
    }

    /**
     * @param value Types definitions. Used for Swagger/OpenAPI v1 schemas only.
     */
    @JvmName("wgbakgoadttmjcxb")
    public suspend fun definitions(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.definitions = mapped
    }

    /**
     * @param value The Name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
     */
    @JvmName("xjxuqfbpuixiedaf")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A unique identifier for this API Schema. Changing this forces a new resource to be created.
     */
    @JvmName("acobpyrfhwntbyjs")
    public suspend fun schemaId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.schemaId = mapped
    }

    /**
     * @param value The JSON escaped string defining the document representing the Schema.
     */
    @JvmName("shjirhpilrgybwfu")
    public suspend fun `value`(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.`value` = mapped
    }

    internal fun build(): ApiSchemaArgs = ApiSchemaArgs(
        apiManagementName = apiManagementName,
        apiName = apiName,
        components = components,
        contentType = contentType,
        definitions = definitions,
        resourceGroupName = resourceGroupName,
        schemaId = schemaId,
        `value` = `value`,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy