SchemaArgs

data class SchemaArgs(val description: Output<String>? = null, val resourceGroupName: Output<String>? = null, val schemaId: Output<String>? = null, val schemaType: Output<Either<String, SchemaType>>? = null, val serviceName: Output<String>? = null, val value: Output<String>? = null) : ConvertibleToJava<SchemaArgs>

Schema Contract details. API Version: 2021-04-01-preview.

Example Usage

ApiManagementCreateSchema1

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 = "xml",
ServiceName = "apimService1",
Value = @"<xsd:schema xmlns:xsd=""http://www.w3.org/2001/XMLSchema""
xmlns:tns=""http://tempuri.org/PurchaseOrderSchema.xsd""
targetNamespace=""http://tempuri.org/PurchaseOrderSchema.xsd""
elementFormDefault=""qualified"">
<xsd:element name=""PurchaseOrder"" type=""tns:PurchaseOrderType""/>
<xsd:complexType name=""PurchaseOrderType"">
<xsd:sequence>
<xsd:element name=""ShipTo"" type=""tns:USAddress"" maxOccurs=""2""/>
<xsd:element name=""BillTo"" type=""tns:USAddress""/>
</xsd:sequence>
<xsd:attribute name=""OrderDate"" type=""xsd:date""/>
</xsd:complexType>
<xsd:complexType name=""USAddress"">
<xsd:sequence>
<xsd:element name=""name"" type=""xsd:string""/>
<xsd:element name=""street"" type=""xsd:string""/>
<xsd:element name=""city"" type=""xsd:string""/>
<xsd:element name=""state"" type=""xsd:string""/>
<xsd:element name=""zip"" type=""xsd:integer""/>
</xsd:sequence>
<xsd:attribute name=""country"" type=""xsd:NMTOKEN"" fixed=""US""/>
</xsd:complexType>
</xsd:schema>",
});
});
 package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement"
"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("xml"),
ServiceName: pulumi.String("apimService1"),
Value: pulumi.String("<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"
\n xmlns:tns=\"http://tempuri.org/PurchaseOrderSchema.xsd\"
\n targetNamespace=\"http://tempuri.org/PurchaseOrderSchema.xsd\"
\n elementFormDefault=\"qualified\">
\n <xsd:element name=\"PurchaseOrder\" type=\"tns:PurchaseOrderType\"/>
\n <xsd:complexType name=\"PurchaseOrderType\">
\n <xsd:sequence>
\n <xsd:element name=\"ShipTo\" type=\"tns:USAddress\" maxOccurs=\"2\"/>
\n <xsd:element name=\"BillTo\" type=\"tns:USAddress\"/>
\n </xsd:sequence>
\n <xsd:attribute name=\"OrderDate\" type=\"xsd:date\"/>
\n </xsd:complexType>
\n
\n <xsd:complexType name=\"USAddress\">
\n <xsd:sequence>
\n <xsd:element name=\"name\" type=\"xsd:string\"/>
\n <xsd:element name=\"street\" type=\"xsd:string\"/>
\n <xsd:element name=\"city\" type=\"xsd:string\"/>
\n <xsd:element name=\"state\" type=\"xsd:string\"/>
\n <xsd:element name=\"zip\" type=\"xsd:integer\"/>
\n </xsd:sequence>
\n <xsd:attribute name=\"country\" type=\"xsd:NMTOKEN\" fixed=\"US\"/>
\n </xsd:complexType>
\n</xsd:schema>"),
})
if err != nil {
return err
}
return nil
})
}
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("""
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://tempuri.org/PurchaseOrderSchema.xsd"
targetNamespace="http://tempuri.org/PurchaseOrderSchema.xsd"
elementFormDefault="qualified">
<xsd:element name="PurchaseOrder" type="tns:PurchaseOrderType"/>
<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="ShipTo" type="tns:USAddress" maxOccurs="2"/>
<xsd:element name="BillTo" type="tns:USAddress"/>
</xsd:sequence>
<xsd:attribute name="OrderDate" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:integer"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
</xsd:schema> """)
.build());
}
}

ApiManagementCreateSchema2

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 = "json",
ServiceName = "apimService1",
});
});
package main
import (
apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement"
"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("json"),
ServiceName: pulumi.String("apimService1"),
})
if err != nil {
return err
}
return nil
})
}
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.

$ pulumi import azure-native:apimanagement:Schema schema1 /subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/schemas/schema1

Constructors

Link copied to clipboard
constructor(description: Output<String>? = null, resourceGroupName: Output<String>? = null, schemaId: Output<String>? = null, schemaType: Output<Either<String, SchemaType>>? = null, serviceName: Output<String>? = null, value: Output<String>? = null)

Properties

Link copied to clipboard
val description: Output<String>? = null

Free-form schema entity description.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group.

Link copied to clipboard
val schemaId: Output<String>? = null

Schema id identifier. Must be unique in the current API Management service instance.

Link copied to clipboard
val schemaType: Output<Either<String, SchemaType>>? = null

Schema Type. Immutable.

Link copied to clipboard
val serviceName: Output<String>? = null

The name of the API Management service.

Link copied to clipboard
val value: Output<String>? = null

Json-encoded string for non json-based schema.

Functions

Link copied to clipboard
open override fun toJava(): SchemaArgs