Package com.oracle.bmc.apigateway.model
Class CorsPolicy
- java.lang.Object
-
- com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
- com.oracle.bmc.apigateway.model.CorsPolicy
-
@Generated(value="OracleSDKGenerator", comments="API Version: 20190501") public final class CorsPolicy extends com.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
Enable CORS (Cross-Origin-Resource-Sharing) request handling.
Note: Objects should always be created or deserialized using theCorsPolicy.Builder
. This model distinguishes fields that are null because they are unset from fields that are explicitly set to null. This is done in the setter methods of theCorsPolicy.Builder
, which maintain a set of all explicitly set fields calledCorsPolicy.Builder.__explicitlySet__
. ThehashCode()
andequals(Object)
methods are implemented to take the explicitly set fields into account. The constructor, on the other hand, does not take the explicitly set fields into account (since the constructor cannot distinguish explicit null from unset null).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CorsPolicy.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CorsPolicy.Builder
builder()
Create a new builder.boolean
equals(Object o)
List<String>
getAllowedHeaders()
The list of headers that will be allowed from the client via the Access-Control-Allow-Headers header.List<String>
getAllowedMethods()
The list of allowed HTTP methods that will be returned for the preflight OPTIONS request in the Access-Control-Allow-Methods header.List<String>
getAllowedOrigins()
The list of allowed origins that the CORS handler will use to respond to CORS requests.List<String>
getExposedHeaders()
The list of headers that the client will be allowed to see from the response as indicated by the Access-Control-Expose-Headers header.Boolean
getIsAllowCredentialsEnabled()
Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies.Integer
getMaxAgeInSeconds()
The time in seconds for the client to cache preflight responses.int
hashCode()
CorsPolicy.Builder
toBuilder()
String
toString()
String
toString(boolean includeByteArrayContents)
Return a string representation of the object.
-
-
-
Constructor Detail
-
CorsPolicy
@Deprecated @ConstructorProperties({"allowedOrigins","allowedMethods","allowedHeaders","exposedHeaders","isAllowCredentialsEnabled","maxAgeInSeconds"}) public CorsPolicy(List<String> allowedOrigins, List<String> allowedMethods, List<String> allowedHeaders, List<String> exposedHeaders, Boolean isAllowCredentialsEnabled, Integer maxAgeInSeconds)
Deprecated.
-
-
Method Detail
-
builder
public static CorsPolicy.Builder builder()
Create a new builder.
-
toBuilder
public CorsPolicy.Builder toBuilder()
-
getAllowedOrigins
public List<String> getAllowedOrigins()
The list of allowed origins that the CORS handler will use to respond to CORS requests.The gateway will send the Access-Control-Allow-Origin header with the best origin match for the circumstances. ‘*’ will match any origins, and ‘null’ will match queries from ‘file:’ origins. All other origins must be qualified with the scheme, full hostname, and port if necessary.
- Returns:
- the value
-
getAllowedMethods
public List<String> getAllowedMethods()
The list of allowed HTTP methods that will be returned for the preflight OPTIONS request in the Access-Control-Allow-Methods header.‘*’ will allow all methods.
- Returns:
- the value
-
getAllowedHeaders
public List<String> getAllowedHeaders()
The list of headers that will be allowed from the client via the Access-Control-Allow-Headers header.‘*’ will allow all headers.
- Returns:
- the value
-
getExposedHeaders
public List<String> getExposedHeaders()
The list of headers that the client will be allowed to see from the response as indicated by the Access-Control-Expose-Headers header.‘*’ will expose all headers.
- Returns:
- the value
-
getIsAllowCredentialsEnabled
public Boolean getIsAllowCredentialsEnabled()
Whether to send the Access-Control-Allow-Credentials header to allow CORS requests with cookies.- Returns:
- the value
-
getMaxAgeInSeconds
public Integer getMaxAgeInSeconds()
The time in seconds for the client to cache preflight responses.This is sent as the Access-Control-Max-Age if greater than 0.
- Returns:
- the value
-
toString
public String toString()
- Overrides:
toString
in classcom.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
toString
public String toString(boolean includeByteArrayContents)
Return a string representation of the object.- Parameters:
includeByteArrayContents
- true to include the full contents of byte arrays- Returns:
- string representation
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classcom.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classcom.oracle.bmc.http.client.internal.ExplicitlySetBmcModel
-
-