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

com.pulumi.azurenative.documentdb.inputs.CorsPolicyArgs Maven / Gradle / Ivy

There is a newer version: 2.72.0
Show newest version
// *** 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.azurenative.documentdb.inputs;

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import com.pulumi.exceptions.MissingRequiredPropertyException;
import java.lang.Double;
import java.lang.String;
import java.util.Objects;
import java.util.Optional;
import javax.annotation.Nullable;


/**
 * The CORS policy for the Cosmos DB database account.
 * 
 */
public final class CorsPolicyArgs extends com.pulumi.resources.ResourceArgs {

    public static final CorsPolicyArgs Empty = new CorsPolicyArgs();

    /**
     * The request headers that the origin domain may specify on the CORS request.
     * 
     */
    @Import(name="allowedHeaders")
    private @Nullable Output allowedHeaders;

    /**
     * @return The request headers that the origin domain may specify on the CORS request.
     * 
     */
    public Optional> allowedHeaders() {
        return Optional.ofNullable(this.allowedHeaders);
    }

    /**
     * The methods (HTTP request verbs) that the origin domain may use for a CORS request.
     * 
     */
    @Import(name="allowedMethods")
    private @Nullable Output allowedMethods;

    /**
     * @return The methods (HTTP request verbs) that the origin domain may use for a CORS request.
     * 
     */
    public Optional> allowedMethods() {
        return Optional.ofNullable(this.allowedMethods);
    }

    /**
     * The origin domains that are permitted to make a request against the service via CORS.
     * 
     */
    @Import(name="allowedOrigins", required=true)
    private Output allowedOrigins;

    /**
     * @return The origin domains that are permitted to make a request against the service via CORS.
     * 
     */
    public Output allowedOrigins() {
        return this.allowedOrigins;
    }

    /**
     * The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
     * 
     */
    @Import(name="exposedHeaders")
    private @Nullable Output exposedHeaders;

    /**
     * @return The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
     * 
     */
    public Optional> exposedHeaders() {
        return Optional.ofNullable(this.exposedHeaders);
    }

    /**
     * The maximum amount time that a browser should cache the preflight OPTIONS request.
     * 
     */
    @Import(name="maxAgeInSeconds")
    private @Nullable Output maxAgeInSeconds;

    /**
     * @return The maximum amount time that a browser should cache the preflight OPTIONS request.
     * 
     */
    public Optional> maxAgeInSeconds() {
        return Optional.ofNullable(this.maxAgeInSeconds);
    }

    private CorsPolicyArgs() {}

    private CorsPolicyArgs(CorsPolicyArgs $) {
        this.allowedHeaders = $.allowedHeaders;
        this.allowedMethods = $.allowedMethods;
        this.allowedOrigins = $.allowedOrigins;
        this.exposedHeaders = $.exposedHeaders;
        this.maxAgeInSeconds = $.maxAgeInSeconds;
    }

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

    public static final class Builder {
        private CorsPolicyArgs $;

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

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

        /**
         * @param allowedHeaders The request headers that the origin domain may specify on the CORS request.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(@Nullable Output allowedHeaders) {
            $.allowedHeaders = allowedHeaders;
            return this;
        }

        /**
         * @param allowedHeaders The request headers that the origin domain may specify on the CORS request.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(String allowedHeaders) {
            return allowedHeaders(Output.of(allowedHeaders));
        }

        /**
         * @param allowedMethods The methods (HTTP request verbs) that the origin domain may use for a CORS request.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(@Nullable Output allowedMethods) {
            $.allowedMethods = allowedMethods;
            return this;
        }

        /**
         * @param allowedMethods The methods (HTTP request verbs) that the origin domain may use for a CORS request.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(String allowedMethods) {
            return allowedMethods(Output.of(allowedMethods));
        }

        /**
         * @param allowedOrigins The origin domains that are permitted to make a request against the service via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(Output allowedOrigins) {
            $.allowedOrigins = allowedOrigins;
            return this;
        }

        /**
         * @param allowedOrigins The origin domains that are permitted to make a request against the service via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(String allowedOrigins) {
            return allowedOrigins(Output.of(allowedOrigins));
        }

        /**
         * @param exposedHeaders The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
         * 
         * @return builder
         * 
         */
        public Builder exposedHeaders(@Nullable Output exposedHeaders) {
            $.exposedHeaders = exposedHeaders;
            return this;
        }

        /**
         * @param exposedHeaders The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
         * 
         * @return builder
         * 
         */
        public Builder exposedHeaders(String exposedHeaders) {
            return exposedHeaders(Output.of(exposedHeaders));
        }

        /**
         * @param maxAgeInSeconds The maximum amount time that a browser should cache the preflight OPTIONS request.
         * 
         * @return builder
         * 
         */
        public Builder maxAgeInSeconds(@Nullable Output maxAgeInSeconds) {
            $.maxAgeInSeconds = maxAgeInSeconds;
            return this;
        }

        /**
         * @param maxAgeInSeconds The maximum amount time that a browser should cache the preflight OPTIONS request.
         * 
         * @return builder
         * 
         */
        public Builder maxAgeInSeconds(Double maxAgeInSeconds) {
            return maxAgeInSeconds(Output.of(maxAgeInSeconds));
        }

        public CorsPolicyArgs build() {
            if ($.allowedOrigins == null) {
                throw new MissingRequiredPropertyException("CorsPolicyArgs", "allowedOrigins");
            }
            return $;
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy