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

import com.pulumi.core.Output;
import com.pulumi.core.annotations.Import;
import java.lang.Boolean;
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 FhirServiceCorsArgs extends com.pulumi.resources.ResourceArgs {

    public static final FhirServiceCorsArgs Empty = new FhirServiceCorsArgs();

    /**
     * A set of headers to be allowed via CORS.
     * 
     */
    @Import(name="allowedHeaders", required=true)
    private Output<List<String>> allowedHeaders;

    /**
     * @return A set of headers to be allowed via CORS.
     * 
     */
    public Output<List<String>> allowedHeaders() {
        return this.allowedHeaders;
    }

    /**
     * The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
     * 
     */
    @Import(name="allowedMethods", required=true)
    private Output<List<String>> allowedMethods;

    /**
     * @return The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
     * 
     */
    public Output<List<String>> allowedMethods() {
        return this.allowedMethods;
    }

    /**
     * A set of origins to be allowed via CORS.
     * 
     */
    @Import(name="allowedOrigins", required=true)
    private Output<List<String>> allowedOrigins;

    /**
     * @return A set of origins to be allowed via CORS.
     * 
     */
    public Output<List<String>> allowedOrigins() {
        return this.allowedOrigins;
    }

    /**
     * If credentials are allowed via CORS.
     * 
     */
    @Import(name="credentialsAllowed")
    private @Nullable Output<Boolean> credentialsAllowed;

    /**
     * @return If credentials are allowed via CORS.
     * 
     */
    public Optional<Output<Boolean>> credentialsAllowed() {
        return Optional.ofNullable(this.credentialsAllowed);
    }

    /**
     * The max age to be allowed via CORS.
     * 
     */
    @Import(name="maxAgeInSeconds")
    private @Nullable Output<Integer> maxAgeInSeconds;

    /**
     * @return The max age to be allowed via CORS.
     * 
     */
    public Optional<Output<Integer>> maxAgeInSeconds() {
        return Optional.ofNullable(this.maxAgeInSeconds);
    }

    private FhirServiceCorsArgs() {}

    private FhirServiceCorsArgs(FhirServiceCorsArgs $) {
        this.allowedHeaders = $.allowedHeaders;
        this.allowedMethods = $.allowedMethods;
        this.allowedOrigins = $.allowedOrigins;
        this.credentialsAllowed = $.credentialsAllowed;
        this.maxAgeInSeconds = $.maxAgeInSeconds;
    }

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

    public static final class Builder {
        private FhirServiceCorsArgs $;

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

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

        /**
         * @param allowedHeaders A set of headers to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(Output<List<String>> allowedHeaders) {
            $.allowedHeaders = allowedHeaders;
            return this;
        }

        /**
         * @param allowedHeaders A set of headers to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(List<String> allowedHeaders) {
            return allowedHeaders(Output.of(allowedHeaders));
        }

        /**
         * @param allowedHeaders A set of headers to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedHeaders(String... allowedHeaders) {
            return allowedHeaders(List.of(allowedHeaders));
        }

        /**
         * @param allowedMethods The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(Output<List<String>> allowedMethods) {
            $.allowedMethods = allowedMethods;
            return this;
        }

        /**
         * @param allowedMethods The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(List<String> allowedMethods) {
            return allowedMethods(Output.of(allowedMethods));
        }

        /**
         * @param allowedMethods The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
         * 
         * @return builder
         * 
         */
        public Builder allowedMethods(String... allowedMethods) {
            return allowedMethods(List.of(allowedMethods));
        }

        /**
         * @param allowedOrigins A set of origins to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(Output<List<String>> allowedOrigins) {
            $.allowedOrigins = allowedOrigins;
            return this;
        }

        /**
         * @param allowedOrigins A set of origins to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(List<String> allowedOrigins) {
            return allowedOrigins(Output.of(allowedOrigins));
        }

        /**
         * @param allowedOrigins A set of origins to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder allowedOrigins(String... allowedOrigins) {
            return allowedOrigins(List.of(allowedOrigins));
        }

        /**
         * @param credentialsAllowed If credentials are allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder credentialsAllowed(@Nullable Output<Boolean> credentialsAllowed) {
            $.credentialsAllowed = credentialsAllowed;
            return this;
        }

        /**
         * @param credentialsAllowed If credentials are allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder credentialsAllowed(Boolean credentialsAllowed) {
            return credentialsAllowed(Output.of(credentialsAllowed));
        }

        /**
         * @param maxAgeInSeconds The max age to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder maxAgeInSeconds(@Nullable Output<Integer> maxAgeInSeconds) {
            $.maxAgeInSeconds = maxAgeInSeconds;
            return this;
        }

        /**
         * @param maxAgeInSeconds The max age to be allowed via CORS.
         * 
         * @return builder
         * 
         */
        public Builder maxAgeInSeconds(Integer maxAgeInSeconds) {
            return maxAgeInSeconds(Output.of(maxAgeInSeconds));
        }

        public FhirServiceCorsArgs build() {
            $.allowedHeaders = Objects.requireNonNull($.allowedHeaders, "expected parameter 'allowedHeaders' to be non-null");
            $.allowedMethods = Objects.requireNonNull($.allowedMethods, "expected parameter 'allowedMethods' to be non-null");
            $.allowedOrigins = Objects.requireNonNull($.allowedOrigins, "expected parameter 'allowedOrigins' to be non-null");
            return $;
        }
    }

}
