com.pulumi.azure.healthcare.outputs.FhirServiceCors 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.azure.healthcare.outputs;
import com.pulumi.core.annotations.CustomType;
import com.pulumi.exceptions.MissingRequiredPropertyException;
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;
@CustomType
public final class FhirServiceCors {
/**
* @return A set of headers to be allowed via CORS.
*
*/
private List allowedHeaders;
/**
* @return The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
*
*/
private List allowedMethods;
/**
* @return A set of origins to be allowed via CORS.
*
*/
private List allowedOrigins;
/**
* @return If credentials are allowed via CORS.
*
*/
private @Nullable Boolean credentialsAllowed;
/**
* @return The max age to be allowed via CORS.
*
*/
private @Nullable Integer maxAgeInSeconds;
private FhirServiceCors() {}
/**
* @return A set of headers to be allowed via CORS.
*
*/
public List allowedHeaders() {
return this.allowedHeaders;
}
/**
* @return The methods to be allowed via CORS. Possible values are `DELETE`, `GET`, `HEAD`, `MERGE`, `POST`, `OPTIONS`, `PATCH` and `PUT`.
*
*/
public List allowedMethods() {
return this.allowedMethods;
}
/**
* @return A set of origins to be allowed via CORS.
*
*/
public List allowedOrigins() {
return this.allowedOrigins;
}
/**
* @return If credentials are allowed via CORS.
*
*/
public Optional credentialsAllowed() {
return Optional.ofNullable(this.credentialsAllowed);
}
/**
* @return The max age to be allowed via CORS.
*
*/
public Optional maxAgeInSeconds() {
return Optional.ofNullable(this.maxAgeInSeconds);
}
public static Builder builder() {
return new Builder();
}
public static Builder builder(FhirServiceCors defaults) {
return new Builder(defaults);
}
@CustomType.Builder
public static final class Builder {
private List allowedHeaders;
private List allowedMethods;
private List allowedOrigins;
private @Nullable Boolean credentialsAllowed;
private @Nullable Integer maxAgeInSeconds;
public Builder() {}
public Builder(FhirServiceCors defaults) {
Objects.requireNonNull(defaults);
this.allowedHeaders = defaults.allowedHeaders;
this.allowedMethods = defaults.allowedMethods;
this.allowedOrigins = defaults.allowedOrigins;
this.credentialsAllowed = defaults.credentialsAllowed;
this.maxAgeInSeconds = defaults.maxAgeInSeconds;
}
@CustomType.Setter
public Builder allowedHeaders(List allowedHeaders) {
if (allowedHeaders == null) {
throw new MissingRequiredPropertyException("FhirServiceCors", "allowedHeaders");
}
this.allowedHeaders = allowedHeaders;
return this;
}
public Builder allowedHeaders(String... allowedHeaders) {
return allowedHeaders(List.of(allowedHeaders));
}
@CustomType.Setter
public Builder allowedMethods(List allowedMethods) {
if (allowedMethods == null) {
throw new MissingRequiredPropertyException("FhirServiceCors", "allowedMethods");
}
this.allowedMethods = allowedMethods;
return this;
}
public Builder allowedMethods(String... allowedMethods) {
return allowedMethods(List.of(allowedMethods));
}
@CustomType.Setter
public Builder allowedOrigins(List allowedOrigins) {
if (allowedOrigins == null) {
throw new MissingRequiredPropertyException("FhirServiceCors", "allowedOrigins");
}
this.allowedOrigins = allowedOrigins;
return this;
}
public Builder allowedOrigins(String... allowedOrigins) {
return allowedOrigins(List.of(allowedOrigins));
}
@CustomType.Setter
public Builder credentialsAllowed(@Nullable Boolean credentialsAllowed) {
this.credentialsAllowed = credentialsAllowed;
return this;
}
@CustomType.Setter
public Builder maxAgeInSeconds(@Nullable Integer maxAgeInSeconds) {
this.maxAgeInSeconds = maxAgeInSeconds;
return this;
}
public FhirServiceCors build() {
final var _resultValue = new FhirServiceCors();
_resultValue.allowedHeaders = allowedHeaders;
_resultValue.allowedMethods = allowedMethods;
_resultValue.allowedOrigins = allowedOrigins;
_resultValue.credentialsAllowed = credentialsAllowed;
_resultValue.maxAgeInSeconds = maxAgeInSeconds;
return _resultValue;
}
}
}