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

com.pulumi.gcp.compute.kotlin.outputs.BackendServiceCdnPolicy.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: 8.10.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.compute.kotlin.outputs

import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List

/**
 *
 * @property bypassCacheOnRequestHeaders Bypass the cache when the specified request headers are matched - e.g. Pragma or Authorization headers. Up to 5 headers can be specified.
 * The cache is bypassed for all cdnPolicy.cacheMode settings.
 * Structure is documented below.
 * @property cacheKeyPolicy The CacheKeyPolicy for this CdnPolicy.
 * Structure is documented below.
 * @property cacheMode Specifies the cache setting for all responses from this backend.
 * The possible values are: USE_ORIGIN_HEADERS, FORCE_CACHE_ALL and CACHE_ALL_STATIC
 * Possible values are: `USE_ORIGIN_HEADERS`, `FORCE_CACHE_ALL`, `CACHE_ALL_STATIC`.
 * @property clientTtl Specifies the maximum allowed TTL for cached content served by this origin.
 * @property defaultTtl Specifies the default TTL for cached content served by this origin for responses
 * that do not have an existing valid TTL (max-age or s-max-age).
 * @property maxTtl Specifies the maximum allowed TTL for cached content served by this origin.
 * @property negativeCaching Negative caching allows per-status code TTLs to be set, in order to apply fine-grained caching for common errors or redirects.
 * @property negativeCachingPolicies Sets a cache TTL for the specified HTTP status code. negativeCaching must be enabled to configure negativeCachingPolicy.
 * Omitting the policy and leaving negativeCaching enabled will use Cloud CDN's default cache TTLs.
 * Structure is documented below.
 * @property serveWhileStale Serve existing content from the cache (if available) when revalidating content with the origin, or when an error is encountered when refreshing the cache.
 * @property signedUrlCacheMaxAgeSec Maximum number of seconds the response to a signed URL request
 * will be considered fresh, defaults to 1hr (3600s). After this
 * time period, the response will be revalidated before
 * being served.
 * When serving responses to signed URL requests, Cloud CDN will
 * internally behave as though all responses from this backend had a
 * "Cache-Control: public, max-age=[TTL]" header, regardless of any
 * existing Cache-Control header. The actual headers served in
 * responses will not be altered.
 */
public data class BackendServiceCdnPolicy(
    public val bypassCacheOnRequestHeaders: List? =
        null,
    public val cacheKeyPolicy: BackendServiceCdnPolicyCacheKeyPolicy? = null,
    public val cacheMode: String? = null,
    public val clientTtl: Int? = null,
    public val defaultTtl: Int? = null,
    public val maxTtl: Int? = null,
    public val negativeCaching: Boolean? = null,
    public val negativeCachingPolicies: List? = null,
    public val serveWhileStale: Int? = null,
    public val signedUrlCacheMaxAgeSec: Int? = null,
) {
    public companion object {
        public fun toKotlin(javaType: com.pulumi.gcp.compute.outputs.BackendServiceCdnPolicy): BackendServiceCdnPolicy = BackendServiceCdnPolicy(
            bypassCacheOnRequestHeaders = javaType.bypassCacheOnRequestHeaders().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.gcp.compute.kotlin.outputs.BackendServiceCdnPolicyBypassCacheOnRequestHeader.Companion.toKotlin(args0)
                })
            }),
            cacheKeyPolicy = javaType.cacheKeyPolicy().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.gcp.compute.kotlin.outputs.BackendServiceCdnPolicyCacheKeyPolicy.Companion.toKotlin(args0)
                })
            }).orElse(null),
            cacheMode = javaType.cacheMode().map({ args0 -> args0 }).orElse(null),
            clientTtl = javaType.clientTtl().map({ args0 -> args0 }).orElse(null),
            defaultTtl = javaType.defaultTtl().map({ args0 -> args0 }).orElse(null),
            maxTtl = javaType.maxTtl().map({ args0 -> args0 }).orElse(null),
            negativeCaching = javaType.negativeCaching().map({ args0 -> args0 }).orElse(null),
            negativeCachingPolicies = javaType.negativeCachingPolicies().map({ args0 ->
                args0.let({ args0 ->
                    com.pulumi.gcp.compute.kotlin.outputs.BackendServiceCdnPolicyNegativeCachingPolicy.Companion.toKotlin(args0)
                })
            }),
            serveWhileStale = javaType.serveWhileStale().map({ args0 -> args0 }).orElse(null),
            signedUrlCacheMaxAgeSec = javaType.signedUrlCacheMaxAgeSec().map({ args0 -> args0 }).orElse(null),
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy