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

com.pulumi.aws.s3.inputs.BucketV2CorsRuleArgs Maven / Gradle / Ivy

// *** 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.aws.s3.inputs;

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


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

    public static final BucketV2CorsRuleArgs Empty = new BucketV2CorsRuleArgs();

    /**
     * List of headers allowed.
     * 
     */
    @Import(name="allowedHeaders")
    private @Nullable Output> allowedHeaders;

    /**
     * @return List of headers allowed.
     * 
     */
    public Optional>> allowedHeaders() {
        return Optional.ofNullable(this.allowedHeaders);
    }

    /**
     * One or more HTTP methods that you allow the origin to execute. Can be `GET`, `PUT`, `POST`, `DELETE` or `HEAD`.
     * 
     */
    @Import(name="allowedMethods", required=true)
    private Output> allowedMethods;

    /**
     * @return One or more HTTP methods that you allow the origin to execute. Can be `GET`, `PUT`, `POST`, `DELETE` or `HEAD`.
     * 
     */
    public Output> allowedMethods() {
        return this.allowedMethods;
    }

    /**
     * One or more origins you want customers to be able to access the bucket from.
     * 
     */
    @Import(name="allowedOrigins", required=true)
    private Output> allowedOrigins;

    /**
     * @return One or more origins you want customers to be able to access the bucket from.
     * 
     */
    public Output> allowedOrigins() {
        return this.allowedOrigins;
    }

    /**
     * One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript `XMLHttpRequest` object).
     * 
     */
    @Import(name="exposeHeaders")
    private @Nullable Output> exposeHeaders;

    /**
     * @return One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript `XMLHttpRequest` object).
     * 
     */
    public Optional>> exposeHeaders() {
        return Optional.ofNullable(this.exposeHeaders);
    }

    /**
     * Specifies time in seconds that browser can cache the response for a preflight request.
     * 
     */
    @Import(name="maxAgeSeconds")
    private @Nullable Output maxAgeSeconds;

    /**
     * @return Specifies time in seconds that browser can cache the response for a preflight request.
     * 
     */
    public Optional> maxAgeSeconds() {
        return Optional.ofNullable(this.maxAgeSeconds);
    }

    private BucketV2CorsRuleArgs() {}

    private BucketV2CorsRuleArgs(BucketV2CorsRuleArgs $) {
        this.allowedHeaders = $.allowedHeaders;
        this.allowedMethods = $.allowedMethods;
        this.allowedOrigins = $.allowedOrigins;
        this.exposeHeaders = $.exposeHeaders;
        this.maxAgeSeconds = $.maxAgeSeconds;
    }

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

    public static final class Builder {
        private BucketV2CorsRuleArgs $;

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

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

        /**
         * @param allowedHeaders List of headers allowed.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(@Nullable Output> allowedHeaders) {
            $.allowedHeaders = allowedHeaders;
            return this;
        }

        /**
         * @param allowedHeaders List of headers allowed.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(List allowedHeaders) {
            return allowedHeaders(Output.of(allowedHeaders));
        }

        /**
         * @param allowedHeaders List of headers allowed.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(String... allowedHeaders) {
            return allowedHeaders(List.of(allowedHeaders));
        }

        /**
         * @param allowedMethods One or more HTTP methods that you allow the origin to execute. Can be `GET`, `PUT`, `POST`, `DELETE` or `HEAD`.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(Output> allowedMethods) {
            $.allowedMethods = allowedMethods;
            return this;
        }

        /**
         * @param allowedMethods One or more HTTP methods that you allow the origin to execute. Can be `GET`, `PUT`, `POST`, `DELETE` or `HEAD`.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(List allowedMethods) {
            return allowedMethods(Output.of(allowedMethods));
        }

        /**
         * @param allowedMethods One or more HTTP methods that you allow the origin to execute. Can be `GET`, `PUT`, `POST`, `DELETE` or `HEAD`.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(String... allowedMethods) {
            return allowedMethods(List.of(allowedMethods));
        }

        /**
         * @param allowedOrigins One or more origins you want customers to be able to access the bucket from.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(Output> allowedOrigins) {
            $.allowedOrigins = allowedOrigins;
            return this;
        }

        /**
         * @param allowedOrigins One or more origins you want customers to be able to access the bucket from.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(List allowedOrigins) {
            return allowedOrigins(Output.of(allowedOrigins));
        }

        /**
         * @param allowedOrigins One or more origins you want customers to be able to access the bucket from.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(String... allowedOrigins) {
            return allowedOrigins(List.of(allowedOrigins));
        }

        /**
         * @param exposeHeaders One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript `XMLHttpRequest` object).
         * 
         * @return builder
         * 
         */
        public Builder exposeHeaders(@Nullable Output> exposeHeaders) {
            $.exposeHeaders = exposeHeaders;
            return this;
        }

        /**
         * @param exposeHeaders One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript `XMLHttpRequest` object).
         * 
         * @return builder
         * 
         */
        public Builder exposeHeaders(List exposeHeaders) {
            return exposeHeaders(Output.of(exposeHeaders));
        }

        /**
         * @param exposeHeaders One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScript `XMLHttpRequest` object).
         * 
         * @return builder
         * 
         */
        public Builder exposeHeaders(String... exposeHeaders) {
            return exposeHeaders(List.of(exposeHeaders));
        }

        /**
         * @param maxAgeSeconds Specifies time in seconds that browser can cache the response for a preflight request.
         * 
         * @return builder
         * 
         */
        public Builder maxAgeSeconds(@Nullable Output maxAgeSeconds) {
            $.maxAgeSeconds = maxAgeSeconds;
            return this;
        }

        /**
         * @param maxAgeSeconds Specifies time in seconds that browser can cache the response for a preflight request.
         * 
         * @return builder
         * 
         */
        public Builder maxAgeSeconds(Integer maxAgeSeconds) {
            return maxAgeSeconds(Output.of(maxAgeSeconds));
        }

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

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy