// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

package com.pulumi.azure.cdn.outputs;

import com.pulumi.core.annotations.CustomType;
import java.lang.Boolean;
import java.lang.String;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;

@CustomType
public final class FrontdoorRuleActionsRouteConfigurationOverrideAction {
    /**
     * @return `HonorOrigin` the Front Door will always honor origin response header directive. If the origin directive is missing, Front Door will cache contents anywhere from `1` to `3` days. `OverrideAlways` the TTL value returned from your Front Door Origin is overwritten with the value specified in the action. This behavior will only be applied if the response is cacheable. `OverrideIfOriginMissing` if no TTL value gets returned from your Front Door Origin, the rule sets the TTL to the value specified in the action. This behavior will only be applied if the response is cacheable. `Disabled` the Front Door will not cache the response contents, irrespective of Front Door Origin response directives. Possible values include `HonorOrigin`, `OverrideAlways`, `OverrideIfOriginMissing` or `Disabled`.
     * 
     */
    private @Nullable String cacheBehavior;
    /**
     * @return When Cache behavior is set to `Override` or `SetIfMissing`, this field specifies the cache duration to use. The maximum duration is 366 days specified in the `d.HH:MM:SS` format(e.g. `365.23:59:59`). If the desired maximum cache duration is less than 1 day then the maximum cache duration should be specified in the `HH:MM:SS` format(e.g. `23:59:59`).
     * 
     */
    private @Nullable String cacheDuration;
    /**
     * @return The Front Door Origin Group resource ID that the request should be routed to. This overrides the configuration specified in the Front Door Endpoint route.
     * 
     */
    private @Nullable String cdnFrontdoorOriginGroupId;
    /**
     * @return Should the Front Door dynamically compress the content? Possible values include `true` or `false`.
     * 
     * -&gt;**NOTE:** Content won&#39;t be compressed on AzureFrontDoor when requested content is smaller than `1 byte` or larger than `1 MB`.
     * 
     */
    private @Nullable Boolean compressionEnabled;
    /**
     * @return The forwarding protocol the request will be redirected as. This overrides the configuration specified in the route to be associated with. Possible values include `MatchRequest`, `HttpOnly` or `HttpsOnly`.
     * 
     * -&gt;**NOTE:** If the `cdn_frontdoor_origin_group_id` is not defined you cannot set the `forwarding_protocol`.
     * 
     */
    private @Nullable String forwardingProtocol;
    /**
     * @return `IncludeSpecifiedQueryStrings` query strings specified in the `query_string_parameters` field get included when the cache key gets generated. `UseQueryString` cache every unique URL, each unique URL will have its own cache key. `IgnoreSpecifiedQueryStrings` query strings specified in the `query_string_parameters` field get excluded when the cache key gets generated. `IgnoreQueryString` query strings aren&#39;t considered when the cache key gets generated. Possible values include `IgnoreQueryString`, `UseQueryString`, `IgnoreSpecifiedQueryStrings` or `IncludeSpecifiedQueryStrings`.
     * 
     */
    private @Nullable String queryStringCachingBehavior;
    /**
     * @return A list of query string parameter names.
     * 
     * -&gt;**NOTE:** `query_string_parameters` is a required field when the `query_string_caching_behavior` is set to `IncludeSpecifiedQueryStrings` or `IgnoreSpecifiedQueryStrings`.
     * 
     */
    private @Nullable List<String> queryStringParameters;

    private FrontdoorRuleActionsRouteConfigurationOverrideAction() {}
    /**
     * @return `HonorOrigin` the Front Door will always honor origin response header directive. If the origin directive is missing, Front Door will cache contents anywhere from `1` to `3` days. `OverrideAlways` the TTL value returned from your Front Door Origin is overwritten with the value specified in the action. This behavior will only be applied if the response is cacheable. `OverrideIfOriginMissing` if no TTL value gets returned from your Front Door Origin, the rule sets the TTL to the value specified in the action. This behavior will only be applied if the response is cacheable. `Disabled` the Front Door will not cache the response contents, irrespective of Front Door Origin response directives. Possible values include `HonorOrigin`, `OverrideAlways`, `OverrideIfOriginMissing` or `Disabled`.
     * 
     */
    public Optional<String> cacheBehavior() {
        return Optional.ofNullable(this.cacheBehavior);
    }
    /**
     * @return When Cache behavior is set to `Override` or `SetIfMissing`, this field specifies the cache duration to use. The maximum duration is 366 days specified in the `d.HH:MM:SS` format(e.g. `365.23:59:59`). If the desired maximum cache duration is less than 1 day then the maximum cache duration should be specified in the `HH:MM:SS` format(e.g. `23:59:59`).
     * 
     */
    public Optional<String> cacheDuration() {
        return Optional.ofNullable(this.cacheDuration);
    }
    /**
     * @return The Front Door Origin Group resource ID that the request should be routed to. This overrides the configuration specified in the Front Door Endpoint route.
     * 
     */
    public Optional<String> cdnFrontdoorOriginGroupId() {
        return Optional.ofNullable(this.cdnFrontdoorOriginGroupId);
    }
    /**
     * @return Should the Front Door dynamically compress the content? Possible values include `true` or `false`.
     * 
     * -&gt;**NOTE:** Content won&#39;t be compressed on AzureFrontDoor when requested content is smaller than `1 byte` or larger than `1 MB`.
     * 
     */
    public Optional<Boolean> compressionEnabled() {
        return Optional.ofNullable(this.compressionEnabled);
    }
    /**
     * @return The forwarding protocol the request will be redirected as. This overrides the configuration specified in the route to be associated with. Possible values include `MatchRequest`, `HttpOnly` or `HttpsOnly`.
     * 
     * -&gt;**NOTE:** If the `cdn_frontdoor_origin_group_id` is not defined you cannot set the `forwarding_protocol`.
     * 
     */
    public Optional<String> forwardingProtocol() {
        return Optional.ofNullable(this.forwardingProtocol);
    }
    /**
     * @return `IncludeSpecifiedQueryStrings` query strings specified in the `query_string_parameters` field get included when the cache key gets generated. `UseQueryString` cache every unique URL, each unique URL will have its own cache key. `IgnoreSpecifiedQueryStrings` query strings specified in the `query_string_parameters` field get excluded when the cache key gets generated. `IgnoreQueryString` query strings aren&#39;t considered when the cache key gets generated. Possible values include `IgnoreQueryString`, `UseQueryString`, `IgnoreSpecifiedQueryStrings` or `IncludeSpecifiedQueryStrings`.
     * 
     */
    public Optional<String> queryStringCachingBehavior() {
        return Optional.ofNullable(this.queryStringCachingBehavior);
    }
    /**
     * @return A list of query string parameter names.
     * 
     * -&gt;**NOTE:** `query_string_parameters` is a required field when the `query_string_caching_behavior` is set to `IncludeSpecifiedQueryStrings` or `IgnoreSpecifiedQueryStrings`.
     * 
     */
    public List<String> queryStringParameters() {
        return this.queryStringParameters == null ? List.of() : this.queryStringParameters;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static Builder builder(FrontdoorRuleActionsRouteConfigurationOverrideAction defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String cacheBehavior;
        private @Nullable String cacheDuration;
        private @Nullable String cdnFrontdoorOriginGroupId;
        private @Nullable Boolean compressionEnabled;
        private @Nullable String forwardingProtocol;
        private @Nullable String queryStringCachingBehavior;
        private @Nullable List<String> queryStringParameters;
        public Builder() {}
        public Builder(FrontdoorRuleActionsRouteConfigurationOverrideAction defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.cacheBehavior = defaults.cacheBehavior;
    	      this.cacheDuration = defaults.cacheDuration;
    	      this.cdnFrontdoorOriginGroupId = defaults.cdnFrontdoorOriginGroupId;
    	      this.compressionEnabled = defaults.compressionEnabled;
    	      this.forwardingProtocol = defaults.forwardingProtocol;
    	      this.queryStringCachingBehavior = defaults.queryStringCachingBehavior;
    	      this.queryStringParameters = defaults.queryStringParameters;
        }

        @CustomType.Setter
        public Builder cacheBehavior(@Nullable String cacheBehavior) {
            this.cacheBehavior = cacheBehavior;
            return this;
        }
        @CustomType.Setter
        public Builder cacheDuration(@Nullable String cacheDuration) {
            this.cacheDuration = cacheDuration;
            return this;
        }
        @CustomType.Setter
        public Builder cdnFrontdoorOriginGroupId(@Nullable String cdnFrontdoorOriginGroupId) {
            this.cdnFrontdoorOriginGroupId = cdnFrontdoorOriginGroupId;
            return this;
        }
        @CustomType.Setter
        public Builder compressionEnabled(@Nullable Boolean compressionEnabled) {
            this.compressionEnabled = compressionEnabled;
            return this;
        }
        @CustomType.Setter
        public Builder forwardingProtocol(@Nullable String forwardingProtocol) {
            this.forwardingProtocol = forwardingProtocol;
            return this;
        }
        @CustomType.Setter
        public Builder queryStringCachingBehavior(@Nullable String queryStringCachingBehavior) {
            this.queryStringCachingBehavior = queryStringCachingBehavior;
            return this;
        }
        @CustomType.Setter
        public Builder queryStringParameters(@Nullable List<String> queryStringParameters) {
            this.queryStringParameters = queryStringParameters;
            return this;
        }
        public Builder queryStringParameters(String... queryStringParameters) {
            return queryStringParameters(List.of(queryStringParameters));
        }
        public FrontdoorRuleActionsRouteConfigurationOverrideAction build() {
            final var o = new FrontdoorRuleActionsRouteConfigurationOverrideAction();
            o.cacheBehavior = cacheBehavior;
            o.cacheDuration = cacheDuration;
            o.cdnFrontdoorOriginGroupId = cdnFrontdoorOriginGroupId;
            o.compressionEnabled = compressionEnabled;
            o.forwardingProtocol = forwardingProtocol;
            o.queryStringCachingBehavior = queryStringCachingBehavior;
            o.queryStringParameters = queryStringParameters;
            return o;
        }
    }
}
