// *** 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.gcp.networkservices.inputs;

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


public final class EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs extends com.pulumi.resources.ResourceArgs {

    public static final EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs Empty = new EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs();

    /**
     * In response to a preflight request, setting this to true indicates that the actual request can include user credentials.
     * This translates to the Access-Control-Allow-Credentials response header.
     * 
     */
    @Import(name="allowCredentials")
    private @Nullable Output<Boolean> allowCredentials;

    /**
     * @return In response to a preflight request, setting this to true indicates that the actual request can include user credentials.
     * This translates to the Access-Control-Allow-Credentials response header.
     * 
     */
    public Optional<Output<Boolean>> allowCredentials() {
        return Optional.ofNullable(this.allowCredentials);
    }

    /**
     * Specifies the content for the Access-Control-Allow-Headers response header.
     * 
     */
    @Import(name="allowHeaders")
    private @Nullable Output<List<String>> allowHeaders;

    /**
     * @return Specifies the content for the Access-Control-Allow-Headers response header.
     * 
     */
    public Optional<Output<List<String>>> allowHeaders() {
        return Optional.ofNullable(this.allowHeaders);
    }

    /**
     * Specifies the content for the Access-Control-Allow-Methods response header.
     * 
     */
    @Import(name="allowMethods")
    private @Nullable Output<List<String>> allowMethods;

    /**
     * @return Specifies the content for the Access-Control-Allow-Methods response header.
     * 
     */
    public Optional<Output<List<String>>> allowMethods() {
        return Optional.ofNullable(this.allowMethods);
    }

    /**
     * Specifies the list of origins that will be allowed to do CORS requests.
     * This translates to the Access-Control-Allow-Origin response header.
     * 
     */
    @Import(name="allowOrigins")
    private @Nullable Output<List<String>> allowOrigins;

    /**
     * @return Specifies the list of origins that will be allowed to do CORS requests.
     * This translates to the Access-Control-Allow-Origin response header.
     * 
     */
    public Optional<Output<List<String>>> allowOrigins() {
        return Optional.ofNullable(this.allowOrigins);
    }

    /**
     * If true, specifies the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
     * 
     */
    @Import(name="disabled")
    private @Nullable Output<Boolean> disabled;

    /**
     * @return If true, specifies the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
     * 
     */
    public Optional<Output<Boolean>> disabled() {
        return Optional.ofNullable(this.disabled);
    }

    /**
     * Specifies the content for the Access-Control-Allow-Headers response header.
     * 
     */
    @Import(name="exposeHeaders")
    private @Nullable Output<List<String>> exposeHeaders;

    /**
     * @return Specifies the content for the Access-Control-Allow-Headers response header.
     * 
     */
    public Optional<Output<List<String>>> exposeHeaders() {
        return Optional.ofNullable(this.exposeHeaders);
    }

    /**
     * Specifies how long results of a preflight request can be cached by a client in seconds. Note that many browser clients enforce a maximum TTL of 600s (10 minutes).
     * - Setting the value to -1 forces a pre-flight check for all requests (not recommended)
     * - A maximum TTL of 86400s can be set, but note that (as above) some clients may force pre-flight checks at a more regular interval.
     * - This translates to the Access-Control-Max-Age header.
     *   A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
     * 
     */
    @Import(name="maxAge", required=true)
    private Output<String> maxAge;

    /**
     * @return Specifies how long results of a preflight request can be cached by a client in seconds. Note that many browser clients enforce a maximum TTL of 600s (10 minutes).
     * - Setting the value to -1 forces a pre-flight check for all requests (not recommended)
     * - A maximum TTL of 86400s can be set, but note that (as above) some clients may force pre-flight checks at a more regular interval.
     * - This translates to the Access-Control-Max-Age header.
     *   A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
     * 
     */
    public Output<String> maxAge() {
        return this.maxAge;
    }

    private EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs() {}

    private EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs(EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs $) {
        this.allowCredentials = $.allowCredentials;
        this.allowHeaders = $.allowHeaders;
        this.allowMethods = $.allowMethods;
        this.allowOrigins = $.allowOrigins;
        this.disabled = $.disabled;
        this.exposeHeaders = $.exposeHeaders;
        this.maxAge = $.maxAge;
    }

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

    public static final class Builder {
        private EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs $;

        public Builder() {
            $ = new EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs();
        }

        public Builder(EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs defaults) {
            $ = new EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs(Objects.requireNonNull(defaults));
        }

        /**
         * @param allowCredentials In response to a preflight request, setting this to true indicates that the actual request can include user credentials.
         * This translates to the Access-Control-Allow-Credentials response header.
         * 
         * @return builder
         * 
         */
        public Builder allowCredentials(@Nullable Output<Boolean> allowCredentials) {
            $.allowCredentials = allowCredentials;
            return this;
        }

        /**
         * @param allowCredentials In response to a preflight request, setting this to true indicates that the actual request can include user credentials.
         * This translates to the Access-Control-Allow-Credentials response header.
         * 
         * @return builder
         * 
         */
        public Builder allowCredentials(Boolean allowCredentials) {
            return allowCredentials(Output.of(allowCredentials));
        }

        /**
         * @param allowHeaders Specifies the content for the Access-Control-Allow-Headers response header.
         * 
         * @return builder
         * 
         */
        public Builder allowHeaders(@Nullable Output<List<String>> allowHeaders) {
            $.allowHeaders = allowHeaders;
            return this;
        }

        /**
         * @param allowHeaders Specifies the content for the Access-Control-Allow-Headers response header.
         * 
         * @return builder
         * 
         */
        public Builder allowHeaders(List<String> allowHeaders) {
            return allowHeaders(Output.of(allowHeaders));
        }

        /**
         * @param allowHeaders Specifies the content for the Access-Control-Allow-Headers response header.
         * 
         * @return builder
         * 
         */
        public Builder allowHeaders(String... allowHeaders) {
            return allowHeaders(List.of(allowHeaders));
        }

        /**
         * @param allowMethods Specifies the content for the Access-Control-Allow-Methods response header.
         * 
         * @return builder
         * 
         */
        public Builder allowMethods(@Nullable Output<List<String>> allowMethods) {
            $.allowMethods = allowMethods;
            return this;
        }

        /**
         * @param allowMethods Specifies the content for the Access-Control-Allow-Methods response header.
         * 
         * @return builder
         * 
         */
        public Builder allowMethods(List<String> allowMethods) {
            return allowMethods(Output.of(allowMethods));
        }

        /**
         * @param allowMethods Specifies the content for the Access-Control-Allow-Methods response header.
         * 
         * @return builder
         * 
         */
        public Builder allowMethods(String... allowMethods) {
            return allowMethods(List.of(allowMethods));
        }

        /**
         * @param allowOrigins Specifies the list of origins that will be allowed to do CORS requests.
         * This translates to the Access-Control-Allow-Origin response header.
         * 
         * @return builder
         * 
         */
        public Builder allowOrigins(@Nullable Output<List<String>> allowOrigins) {
            $.allowOrigins = allowOrigins;
            return this;
        }

        /**
         * @param allowOrigins Specifies the list of origins that will be allowed to do CORS requests.
         * This translates to the Access-Control-Allow-Origin response header.
         * 
         * @return builder
         * 
         */
        public Builder allowOrigins(List<String> allowOrigins) {
            return allowOrigins(Output.of(allowOrigins));
        }

        /**
         * @param allowOrigins Specifies the list of origins that will be allowed to do CORS requests.
         * This translates to the Access-Control-Allow-Origin response header.
         * 
         * @return builder
         * 
         */
        public Builder allowOrigins(String... allowOrigins) {
            return allowOrigins(List.of(allowOrigins));
        }

        /**
         * @param disabled If true, specifies the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
         * 
         * @return builder
         * 
         */
        public Builder disabled(@Nullable Output<Boolean> disabled) {
            $.disabled = disabled;
            return this;
        }

        /**
         * @param disabled If true, specifies the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.
         * 
         * @return builder
         * 
         */
        public Builder disabled(Boolean disabled) {
            return disabled(Output.of(disabled));
        }

        /**
         * @param exposeHeaders Specifies the content for the Access-Control-Allow-Headers response header.
         * 
         * @return builder
         * 
         */
        public Builder exposeHeaders(@Nullable Output<List<String>> exposeHeaders) {
            $.exposeHeaders = exposeHeaders;
            return this;
        }

        /**
         * @param exposeHeaders Specifies the content for the Access-Control-Allow-Headers response header.
         * 
         * @return builder
         * 
         */
        public Builder exposeHeaders(List<String> exposeHeaders) {
            return exposeHeaders(Output.of(exposeHeaders));
        }

        /**
         * @param exposeHeaders Specifies the content for the Access-Control-Allow-Headers response header.
         * 
         * @return builder
         * 
         */
        public Builder exposeHeaders(String... exposeHeaders) {
            return exposeHeaders(List.of(exposeHeaders));
        }

        /**
         * @param maxAge Specifies how long results of a preflight request can be cached by a client in seconds. Note that many browser clients enforce a maximum TTL of 600s (10 minutes).
         * - Setting the value to -1 forces a pre-flight check for all requests (not recommended)
         * - A maximum TTL of 86400s can be set, but note that (as above) some clients may force pre-flight checks at a more regular interval.
         * - This translates to the Access-Control-Max-Age header.
         *   A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
         * 
         * @return builder
         * 
         */
        public Builder maxAge(Output<String> maxAge) {
            $.maxAge = maxAge;
            return this;
        }

        /**
         * @param maxAge Specifies how long results of a preflight request can be cached by a client in seconds. Note that many browser clients enforce a maximum TTL of 600s (10 minutes).
         * - Setting the value to -1 forces a pre-flight check for all requests (not recommended)
         * - A maximum TTL of 86400s can be set, but note that (as above) some clients may force pre-flight checks at a more regular interval.
         * - This translates to the Access-Control-Max-Age header.
         *   A duration in seconds with up to nine fractional digits, terminated by &#39;s&#39;. Example: &#34;3.5s&#34;.
         * 
         * @return builder
         * 
         */
        public Builder maxAge(String maxAge) {
            return maxAge(Output.of(maxAge));
        }

        public EdgeCacheServiceRoutingPathMatcherRouteRuleRouteActionCorsPolicyArgs build() {
            $.maxAge = Objects.requireNonNull($.maxAge, "expected parameter 'maxAge' to be non-null");
            return $;
        }
    }

}
