
com.pulumi.azurenative.app.outputs.CorsPolicyResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** 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.app.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 CorsPolicyResponse {
/**
* @return allow credential or not
*
*/
private @Nullable Boolean allowCredentials;
/**
* @return allowed HTTP headers
*
*/
private @Nullable List allowedHeaders;
/**
* @return allowed HTTP methods
*
*/
private @Nullable List allowedMethods;
/**
* @return allowed origins
*
*/
private List allowedOrigins;
/**
* @return expose HTTP headers
*
*/
private @Nullable List exposeHeaders;
/**
* @return max time client can cache the result
*
*/
private @Nullable Integer maxAge;
private CorsPolicyResponse() {}
/**
* @return allow credential or not
*
*/
public Optional allowCredentials() {
return Optional.ofNullable(this.allowCredentials);
}
/**
* @return allowed HTTP headers
*
*/
public List allowedHeaders() {
return this.allowedHeaders == null ? List.of() : this.allowedHeaders;
}
/**
* @return allowed HTTP methods
*
*/
public List allowedMethods() {
return this.allowedMethods == null ? List.of() : this.allowedMethods;
}
/**
* @return allowed origins
*
*/
public List allowedOrigins() {
return this.allowedOrigins;
}
/**
* @return expose HTTP headers
*
*/
public List exposeHeaders() {
return this.exposeHeaders == null ? List.of() : this.exposeHeaders;
}
/**
* @return max time client can cache the result
*
*/
public Optional maxAge() {
return Optional.ofNullable(this.maxAge);
}
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 Boolean allowCredentials;
private @Nullable List allowedHeaders;
private @Nullable List allowedMethods;
private List allowedOrigins;
private @Nullable List exposeHeaders;
private @Nullable Integer maxAge;
public Builder() {}
public Builder(CorsPolicyResponse defaults) {
Objects.requireNonNull(defaults);
this.allowCredentials = defaults.allowCredentials;
this.allowedHeaders = defaults.allowedHeaders;
this.allowedMethods = defaults.allowedMethods;
this.allowedOrigins = defaults.allowedOrigins;
this.exposeHeaders = defaults.exposeHeaders;
this.maxAge = defaults.maxAge;
}
@CustomType.Setter
public Builder allowCredentials(@Nullable Boolean allowCredentials) {
this.allowCredentials = allowCredentials;
return this;
}
@CustomType.Setter
public Builder allowedHeaders(@Nullable List allowedHeaders) {
this.allowedHeaders = allowedHeaders;
return this;
}
public Builder allowedHeaders(String... allowedHeaders) {
return allowedHeaders(List.of(allowedHeaders));
}
@CustomType.Setter
public Builder allowedMethods(@Nullable List 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("CorsPolicyResponse", "allowedOrigins");
}
this.allowedOrigins = allowedOrigins;
return this;
}
public Builder allowedOrigins(String... allowedOrigins) {
return allowedOrigins(List.of(allowedOrigins));
}
@CustomType.Setter
public Builder exposeHeaders(@Nullable List exposeHeaders) {
this.exposeHeaders = exposeHeaders;
return this;
}
public Builder exposeHeaders(String... exposeHeaders) {
return exposeHeaders(List.of(exposeHeaders));
}
@CustomType.Setter
public Builder maxAge(@Nullable Integer maxAge) {
this.maxAge = maxAge;
return this;
}
public CorsPolicyResponse build() {
final var _resultValue = new CorsPolicyResponse();
_resultValue.allowCredentials = allowCredentials;
_resultValue.allowedHeaders = allowedHeaders;
_resultValue.allowedMethods = allowedMethods;
_resultValue.allowedOrigins = allowedOrigins;
_resultValue.exposeHeaders = exposeHeaders;
_resultValue.maxAge = maxAge;
return _resultValue;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy