com.pulumi.cloudflare.kotlin.ApiShieldSchemaArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.ApiShieldSchemaArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Provides a resource to manage a schema in API Shield Schema Validation 2.0.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* import * as std from "@pulumi/std";
* const petstoreSchema = new cloudflare.ApiShieldSchema("petstore_schema", {
* zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
* name: "myschema",
* kind: "openapi_v3",
* validationEnabled: true,
* source: std.file({
* input: "./schemas/petstore.json",
* }).then(invoke => invoke.result),
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* import pulumi_std as std
* petstore_schema = cloudflare.ApiShieldSchema("petstore_schema",
* zone_id="0da42c8d2132a9ddaf714f9e7c920711",
* name="myschema",
* kind="openapi_v3",
* validation_enabled=True,
* source=std.file(input="./schemas/petstore.json").result)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* using Std = Pulumi.Std;
* return await Deployment.RunAsync(() =>
* {
* var petstoreSchema = new Cloudflare.ApiShieldSchema("petstore_schema", new()
* {
* ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
* Name = "myschema",
* Kind = "openapi_v3",
* ValidationEnabled = true,
* Source = Std.File.Invoke(new()
* {
* Input = "./schemas/petstore.json",
* }).Apply(invoke => invoke.Result),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
* "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 {
* invokeFile, err := std.File(ctx, &std.FileArgs{
* Input: "./schemas/petstore.json",
* }, nil)
* if err != nil {
* return err
* }
* _, err = cloudflare.NewApiShieldSchema(ctx, "petstore_schema", &cloudflare.ApiShieldSchemaArgs{
* ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
* Name: pulumi.String("myschema"),
* Kind: pulumi.String("openapi_v3"),
* ValidationEnabled: pulumi.Bool(true),
* Source: 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.cloudflare.ApiShieldSchema;
* import com.pulumi.cloudflare.ApiShieldSchemaArgs;
* 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 petstoreSchema = new ApiShieldSchema("petstoreSchema", ApiShieldSchemaArgs.builder()
* .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
* .name("myschema")
* .kind("openapi_v3")
* .validationEnabled(true)
* .source(StdFunctions.file(FileArgs.builder()
* .input("./schemas/petstore.json")
* .build()).result())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* petstoreSchema:
* type: cloudflare:ApiShieldSchema
* name: petstore_schema
* properties:
* zoneId: 0da42c8d2132a9ddaf714f9e7c920711
* name: myschema
* kind: openapi_v3
* validationEnabled: true # optional, default false
* source:
* fn::invoke:
* Function: std:file
* Arguments:
* input: ./schemas/petstore.json
* Return: result
* ```
*
* @property kind Kind of schema. Defaults to `openapi_v3`. **Modifying this attribute will force creation of a new resource.**
* @property name Name of the schema. **Modifying this attribute will force creation of a new resource.**
* @property source Schema file bytes. **Modifying this attribute will force creation of a new resource.**
* @property validationEnabled Flag whether schema is enabled for validation.
* @property zoneId The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
public data class ApiShieldSchemaArgs(
public val kind: Output? = null,
public val name: Output? = null,
public val source: Output? = null,
public val validationEnabled: Output? = null,
public val zoneId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.ApiShieldSchemaArgs =
com.pulumi.cloudflare.ApiShieldSchemaArgs.builder()
.kind(kind?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.source(source?.applyValue({ args0 -> args0 }))
.validationEnabled(validationEnabled?.applyValue({ args0 -> args0 }))
.zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ApiShieldSchemaArgs].
*/
@PulumiTagMarker
public class ApiShieldSchemaArgsBuilder internal constructor() {
private var kind: Output? = null
private var name: Output? = null
private var source: Output? = null
private var validationEnabled: Output? = null
private var zoneId: Output? = null
/**
* @param value Kind of schema. Defaults to `openapi_v3`. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("gaivyfvfwllpipcc")
public suspend fun kind(`value`: Output) {
this.kind = value
}
/**
* @param value Name of the schema. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("ighlookjujkvucrk")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value Schema file bytes. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("mmajujmvqjjpynfu")
public suspend fun source(`value`: Output) {
this.source = value
}
/**
* @param value Flag whether schema is enabled for validation.
*/
@JvmName("urcjggyvoeyhwsap")
public suspend fun validationEnabled(`value`: Output) {
this.validationEnabled = value
}
/**
* @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("bxqrhhhinrovxnjh")
public suspend fun zoneId(`value`: Output) {
this.zoneId = value
}
/**
* @param value Kind of schema. Defaults to `openapi_v3`. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("tfsyyyuqswmokkej")
public suspend fun kind(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.kind = mapped
}
/**
* @param value Name of the schema. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("vlwobqmapjqwqlbl")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value Schema file bytes. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("hnhyvwbdjaedgiky")
public suspend fun source(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.source = mapped
}
/**
* @param value Flag whether schema is enabled for validation.
*/
@JvmName("umhvafbetnfuaxqp")
public suspend fun validationEnabled(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.validationEnabled = mapped
}
/**
* @param value The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
@JvmName("ibcklsbcbcdipgss")
public suspend fun zoneId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.zoneId = mapped
}
internal fun build(): ApiShieldSchemaArgs = ApiShieldSchemaArgs(
kind = kind,
name = name,
source = source,
validationEnabled = validationEnabled,
zoneId = zoneId,
)
}