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

com.pulumi.azurenative.documentdb.outputs.CorsPolicyResponse 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.outputs;

import com.pulumi.core.annotations.CustomType;
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;

@CustomType
public final class CorsPolicyResponse {
    /**
     * @return The request headers that the origin domain may specify on the CORS request.
     * 
     */
    private @Nullable String allowedHeaders;
    /**
     * @return The methods (HTTP request verbs) that the origin domain may use for a CORS request.
     * 
     */
    private @Nullable String allowedMethods;
    /**
     * @return The origin domains that are permitted to make a request against the service via CORS.
     * 
     */
    private String allowedOrigins;
    /**
     * @return The response headers that may be sent in the response to the CORS request and exposed by the browser to the request issuer.
     * 
     */
    private @Nullable String exposedHeaders;
    /**
     * @return The maximum amount time that a browser should cache the preflight OPTIONS request.
     * 
     */
    private @Nullable Double maxAgeInSeconds;

    private CorsPolicyResponse() {}
    /**
     * @return The request headers that the origin domain may specify on the CORS request.
     * 
     */
    public Optional allowedHeaders() {
        return Optional.ofNullable(this.allowedHeaders);
    }
    /**
     * @return The methods (HTTP request verbs) that the origin domain may use for a CORS request.
     * 
     */
    public Optional allowedMethods() {
        return Optional.ofNullable(this.allowedMethods);
    }
    /**
     * @return The origin domains that are permitted to make a request against the service via CORS.
     * 
     */
    public String allowedOrigins() {
        return this.allowedOrigins;
    }
    /**
     * @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);
    }
    /**
     * @return The maximum amount time that a browser should cache the preflight OPTIONS request.
     * 
     */
    public Optional maxAgeInSeconds() {
        return Optional.ofNullable(this.maxAgeInSeconds);
    }

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

    public static Builder builder(CorsPolicyResponse defaults) {
        return new Builder(defaults);
    }
    @CustomType.Builder
    public static final class Builder {
        private @Nullable String allowedHeaders;
        private @Nullable String allowedMethods;
        private String allowedOrigins;
        private @Nullable String exposedHeaders;
        private @Nullable Double maxAgeInSeconds;
        public Builder() {}
        public Builder(CorsPolicyResponse defaults) {
    	      Objects.requireNonNull(defaults);
    	      this.allowedHeaders = defaults.allowedHeaders;
    	      this.allowedMethods = defaults.allowedMethods;
    	      this.allowedOrigins = defaults.allowedOrigins;
    	      this.exposedHeaders = defaults.exposedHeaders;
    	      this.maxAgeInSeconds = defaults.maxAgeInSeconds;
        }

        @CustomType.Setter
        public Builder allowedHeaders(@Nullable String allowedHeaders) {

            this.allowedHeaders = allowedHeaders;
            return this;
        }
        @CustomType.Setter
        public Builder allowedMethods(@Nullable String allowedMethods) {

            this.allowedMethods = allowedMethods;
            return this;
        }
        @CustomType.Setter
        public Builder allowedOrigins(String allowedOrigins) {
            if (allowedOrigins == null) {
              throw new MissingRequiredPropertyException("CorsPolicyResponse", "allowedOrigins");
            }
            this.allowedOrigins = allowedOrigins;
            return this;
        }
        @CustomType.Setter
        public Builder exposedHeaders(@Nullable String exposedHeaders) {

            this.exposedHeaders = exposedHeaders;
            return this;
        }
        @CustomType.Setter
        public Builder maxAgeInSeconds(@Nullable Double maxAgeInSeconds) {

            this.maxAgeInSeconds = maxAgeInSeconds;
            return this;
        }
        public CorsPolicyResponse build() {
            final var _resultValue = new CorsPolicyResponse();
            _resultValue.allowedHeaders = allowedHeaders;
            _resultValue.allowedMethods = allowedMethods;
            _resultValue.allowedOrigins = allowedOrigins;
            _resultValue.exposedHeaders = exposedHeaders;
            _resultValue.maxAgeInSeconds = maxAgeInSeconds;
            return _resultValue;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy