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

com.pulumi.cloudflare.kotlin.ZoneCacheVariants.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: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List

/**
 * Builder for [ZoneCacheVariants].
 */
@PulumiTagMarker
public class ZoneCacheVariantsResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: ZoneCacheVariantsArgs = ZoneCacheVariantsArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend ZoneCacheVariantsArgsBuilder.() -> Unit) {
        val builder = ZoneCacheVariantsArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): ZoneCacheVariants {
        val builtJavaResource = com.pulumi.cloudflare.ZoneCacheVariants(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return ZoneCacheVariants(builtJavaResource)
    }
}

/**
 * Provides a resource which customizes Cloudflare zone cache variants.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.ZoneCacheVariants("example", {
 *     zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
 *     avifs: [
 *         "image/avif",
 *         "image/webp",
 *     ],
 *     bmps: [
 *         "image/bmp",
 *         "image/webp",
 *     ],
 *     gifs: [
 *         "image/gif",
 *         "image/webp",
 *     ],
 *     jpegs: [
 *         "image/jpeg",
 *         "image/webp",
 *     ],
 *     jpgs: [
 *         "image/jpg",
 *         "image/webp",
 *     ],
 *     jpg2s: [
 *         "image/jpg2",
 *         "image/webp",
 *     ],
 *     jp2s: [
 *         "image/jp2",
 *         "image/webp",
 *     ],
 *     pngs: [
 *         "image/png",
 *         "image/webp",
 *     ],
 *     tiffs: [
 *         "image/tiff",
 *         "image/webp",
 *     ],
 *     tifs: [
 *         "image/tif",
 *         "image/webp",
 *     ],
 *     webps: [
 *         "image/jpeg",
 *         "image/webp",
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.ZoneCacheVariants("example",
 *     zone_id="0da42c8d2132a9ddaf714f9e7c920711",
 *     avifs=[
 *         "image/avif",
 *         "image/webp",
 *     ],
 *     bmps=[
 *         "image/bmp",
 *         "image/webp",
 *     ],
 *     gifs=[
 *         "image/gif",
 *         "image/webp",
 *     ],
 *     jpegs=[
 *         "image/jpeg",
 *         "image/webp",
 *     ],
 *     jpgs=[
 *         "image/jpg",
 *         "image/webp",
 *     ],
 *     jpg2s=[
 *         "image/jpg2",
 *         "image/webp",
 *     ],
 *     jp2s=[
 *         "image/jp2",
 *         "image/webp",
 *     ],
 *     pngs=[
 *         "image/png",
 *         "image/webp",
 *     ],
 *     tiffs=[
 *         "image/tiff",
 *         "image/webp",
 *     ],
 *     tifs=[
 *         "image/tif",
 *         "image/webp",
 *     ],
 *     webps=[
 *         "image/jpeg",
 *         "image/webp",
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.ZoneCacheVariants("example", new()
 *     {
 *         ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
 *         Avifs = new[]
 *         {
 *             "image/avif",
 *             "image/webp",
 *         },
 *         Bmps = new[]
 *         {
 *             "image/bmp",
 *             "image/webp",
 *         },
 *         Gifs = new[]
 *         {
 *             "image/gif",
 *             "image/webp",
 *         },
 *         Jpegs = new[]
 *         {
 *             "image/jpeg",
 *             "image/webp",
 *         },
 *         Jpgs = new[]
 *         {
 *             "image/jpg",
 *             "image/webp",
 *         },
 *         Jpg2s = new[]
 *         {
 *             "image/jpg2",
 *             "image/webp",
 *         },
 *         Jp2s = new[]
 *         {
 *             "image/jp2",
 *             "image/webp",
 *         },
 *         Pngs = new[]
 *         {
 *             "image/png",
 *             "image/webp",
 *         },
 *         Tiffs = new[]
 *         {
 *             "image/tiff",
 *             "image/webp",
 *         },
 *         Tifs = new[]
 *         {
 *             "image/tif",
 *             "image/webp",
 *         },
 *         Webps = new[]
 *         {
 *             "image/jpeg",
 *             "image/webp",
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudflare.NewZoneCacheVariants(ctx, "example", &cloudflare.ZoneCacheVariantsArgs{
 * 			ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
 * 			Avifs: pulumi.StringArray{
 * 				pulumi.String("image/avif"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Bmps: pulumi.StringArray{
 * 				pulumi.String("image/bmp"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Gifs: pulumi.StringArray{
 * 				pulumi.String("image/gif"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Jpegs: pulumi.StringArray{
 * 				pulumi.String("image/jpeg"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Jpgs: pulumi.StringArray{
 * 				pulumi.String("image/jpg"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Jpg2s: pulumi.StringArray{
 * 				pulumi.String("image/jpg2"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Jp2s: pulumi.StringArray{
 * 				pulumi.String("image/jp2"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Pngs: pulumi.StringArray{
 * 				pulumi.String("image/png"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Tiffs: pulumi.StringArray{
 * 				pulumi.String("image/tiff"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Tifs: pulumi.StringArray{
 * 				pulumi.String("image/tif"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 			Webps: pulumi.StringArray{
 * 				pulumi.String("image/jpeg"),
 * 				pulumi.String("image/webp"),
 * 			},
 * 		})
 * 		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.ZoneCacheVariants;
 * import com.pulumi.cloudflare.ZoneCacheVariantsArgs;
 * 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 example = new ZoneCacheVariants("example", ZoneCacheVariantsArgs.builder()
 *             .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
 *             .avifs(
 *                 "image/avif",
 *                 "image/webp")
 *             .bmps(
 *                 "image/bmp",
 *                 "image/webp")
 *             .gifs(
 *                 "image/gif",
 *                 "image/webp")
 *             .jpegs(
 *                 "image/jpeg",
 *                 "image/webp")
 *             .jpgs(
 *                 "image/jpg",
 *                 "image/webp")
 *             .jpg2s(
 *                 "image/jpg2",
 *                 "image/webp")
 *             .jp2s(
 *                 "image/jp2",
 *                 "image/webp")
 *             .pngs(
 *                 "image/png",
 *                 "image/webp")
 *             .tiffs(
 *                 "image/tiff",
 *                 "image/webp")
 *             .tifs(
 *                 "image/tif",
 *                 "image/webp")
 *             .webps(
 *                 "image/jpeg",
 *                 "image/webp")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:ZoneCacheVariants
 *     properties:
 *       zoneId: 0da42c8d2132a9ddaf714f9e7c920711
 *       avifs:
 *         - image/avif
 *         - image/webp
 *       bmps:
 *         - image/bmp
 *         - image/webp
 *       gifs:
 *         - image/gif
 *         - image/webp
 *       jpegs:
 *         - image/jpeg
 *         - image/webp
 *       jpgs:
 *         - image/jpg
 *         - image/webp
 *       jpg2s:
 *         - image/jpg2
 *         - image/webp
 *       jp2s:
 *         - image/jp2
 *         - image/webp
 *       pngs:
 *         - image/png
 *         - image/webp
 *       tiffs:
 *         - image/tiff
 *         - image/webp
 *       tifs:
 *         - image/tif
 *         - image/webp
 *       webps:
 *         - image/jpeg
 *         - image/webp
 * ```
 * 
 */
public class ZoneCacheVariants internal constructor(
    override val javaResource: com.pulumi.cloudflare.ZoneCacheVariants,
) : KotlinCustomResource(javaResource, ZoneCacheVariantsMapper) {
    /**
     * List of strings with the MIME types of all the variants that should be served for avif.
     */
    public val avifs: Output>?
        get() = javaResource.avifs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for bmp.
     */
    public val bmps: Output>?
        get() = javaResource.bmps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for gif.
     */
    public val gifs: Output>?
        get() = javaResource.gifs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for jp2.
     */
    public val jp2s: Output>?
        get() = javaResource.jp2s().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for jpeg.
     */
    public val jpegs: Output>?
        get() = javaResource.jpegs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for jpg2.
     */
    public val jpg2s: Output>?
        get() = javaResource.jpg2s().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for jpg.
     */
    public val jpgs: Output>?
        get() = javaResource.jpgs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for png.
     */
    public val pngs: Output>?
        get() = javaResource.pngs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for tiff.
     */
    public val tiffs: Output>?
        get() = javaResource.tiffs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for tif.
     */
    public val tifs: Output>?
        get() = javaResource.tifs().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * List of strings with the MIME types of all the variants that should be served for webp.
     */
    public val webps: Output>?
        get() = javaResource.webps().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0
                })
            }).orElse(null)
        })

    /**
     * The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
     */
    public val zoneId: Output
        get() = javaResource.zoneId().applyValue({ args0 -> args0 })
}

public object ZoneCacheVariantsMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.cloudflare.ZoneCacheVariants::class == javaResource::class

    override fun map(javaResource: Resource): ZoneCacheVariants = ZoneCacheVariants(
        javaResource as
            com.pulumi.cloudflare.ZoneCacheVariants,
    )
}

/**
 * @see [ZoneCacheVariants].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [ZoneCacheVariants].
 */
public suspend fun zoneCacheVariants(
    name: String,
    block: suspend ZoneCacheVariantsResourceBuilder.() -> Unit,
): ZoneCacheVariants {
    val builder = ZoneCacheVariantsResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [ZoneCacheVariants].
 * @param name The _unique_ name of the resulting resource.
 */
public fun zoneCacheVariants(name: String): ZoneCacheVariants {
    val builder = ZoneCacheVariantsResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy