GatewayCorsProperties Class
- java.
lang. Object - com.
azure. resourcemanager. appplatform. models. GatewayCorsProperties
- com.
Implements
public final class GatewayCorsProperties
implements JsonSerializable<GatewayCorsProperties>
Cross-Origin Resource Sharing property.
Constructor Summary
Constructor | Description |
---|---|
GatewayCorsProperties() |
Creates an instance of Gateway |
Method Summary
Modifier and Type | Method and Description |
---|---|
Boolean |
allowCredentials()
Get the allow |
List<String> |
allowedHeaders()
Get the allowed |
List<String> |
allowedMethods()
Get the allowed |
List<String> |
allowedOriginPatterns()
Get the allowed |
List<String> |
allowedOrigins()
Get the allowed |
List<String> |
exposedHeaders()
Get the exposed |
static
Gateway |
fromJson(JsonReader jsonReader)
Reads an instance of Gateway |
Integer |
maxAge()
Get the max |
Json |
toJson(JsonWriter jsonWriter) |
void |
validate()
Validates the instance. |
Gateway |
withAllowCredentials(Boolean allowCredentials)
Set the allow |
Gateway |
withAllowedHeaders(List<String> allowedHeaders)
Set the allowed |
Gateway |
withAllowedMethods(List<String> allowedMethods)
Set the allowed |
Gateway |
withAllowedOriginPatterns(List<String> allowedOriginPatterns)
Set the allowed |
Gateway |
withAllowedOrigins(List<String> allowedOrigins)
Set the allowed |
Gateway |
withExposedHeaders(List<String> exposedHeaders)
Set the exposed |
Gateway |
withMaxAge(Integer maxAge)
Set the max |
Methods inherited from java.lang.Object
Constructor Details
GatewayCorsProperties
public GatewayCorsProperties()
Creates an instance of GatewayCorsProperties class.
Method Details
allowCredentials
public Boolean allowCredentials()
Get the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: `true`, `false`.
Returns:
allowedHeaders
public List
Get the allowedHeaders property: Allowed headers in cross-site requests. The special value `*` allows actual requests to send any header.
Returns:
allowedMethods
public List
Get the allowedMethods property: Allowed HTTP methods on cross-site requests. The special value `*` allows all methods. If not set, `GET` and `HEAD` are allowed by default.
Returns:
allowedOriginPatterns
public List
Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.
Returns:
allowedOrigins
public List
Get the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all domains.
Returns:
exposedHeaders
public List
Get the exposedHeaders property: HTTP response headers to expose for cross-site requests.
Returns:
fromJson
public static GatewayCorsProperties fromJson(JsonReader jsonReader)
Reads an instance of GatewayCorsProperties from the JsonReader.
Parameters:
Returns:
Throws:
maxAge
public Integer maxAge()
Get the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.
Returns:
toJson
validate
public void validate()
Validates the instance.
withAllowCredentials
public GatewayCorsProperties withAllowCredentials(Boolean allowCredentials)
Set the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: `true`, `false`.
Parameters:
Returns:
withAllowedHeaders
public GatewayCorsProperties withAllowedHeaders(List
Set the allowedHeaders property: Allowed headers in cross-site requests. The special value `*` allows actual requests to send any header.
Parameters:
Returns:
withAllowedMethods
public GatewayCorsProperties withAllowedMethods(List
Set the allowedMethods property: Allowed HTTP methods on cross-site requests. The special value `*` allows all methods. If not set, `GET` and `HEAD` are allowed by default.
Parameters:
Returns:
withAllowedOriginPatterns
public GatewayCorsProperties withAllowedOriginPatterns(List
Set the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.
Parameters:
Returns:
withAllowedOrigins
public GatewayCorsProperties withAllowedOrigins(List
Set the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all domains.
Parameters:
Returns:
withExposedHeaders
public GatewayCorsProperties withExposedHeaders(List
Set the exposedHeaders property: HTTP response headers to expose for cross-site requests.
Parameters:
Returns:
withMaxAge
public GatewayCorsProperties withMaxAge(Integer maxAge)
Set the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.
Parameters:
Returns:
Applies to
Azure SDK for Java