Class GatewayCorsProperties
java.lang.Object
com.azure.resourcemanager.appplatform.models.GatewayCorsProperties
- All Implemented Interfaces:
com.azure.json.JsonSerializable<GatewayCorsProperties>
public final class GatewayCorsProperties
extends Object
implements com.azure.json.JsonSerializable<GatewayCorsProperties>
Cross-Origin Resource Sharing property.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the allowCredentials property: Whether user credentials are supported on cross-site requests.Get the allowedHeaders property: Allowed headers in cross-site requests.Get the allowedMethods property: Allowed HTTP methods on cross-site requests.Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.Get the allowedOrigins property: Allowed origins to make cross-site requests.Get the exposedHeaders property: HTTP response headers to expose for cross-site requests.static GatewayCorsPropertiesfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of GatewayCorsProperties from the JsonReader.maxAge()Get the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAllowCredentials(Boolean allowCredentials) Set the allowCredentials property: Whether user credentials are supported on cross-site requests.withAllowedHeaders(List<String> allowedHeaders) Set the allowedHeaders property: Allowed headers in cross-site requests.withAllowedMethods(List<String> allowedMethods) Set the allowedMethods property: Allowed HTTP methods on cross-site requests.withAllowedOriginPatterns(List<String> allowedOriginPatterns) Set the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.withAllowedOrigins(List<String> allowedOrigins) Set the allowedOrigins property: Allowed origins to make cross-site requests.withExposedHeaders(List<String> exposedHeaders) Set the exposedHeaders property: HTTP response headers to expose for cross-site requests.withMaxAge(Integer maxAge) Set the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
GatewayCorsProperties
public GatewayCorsProperties()Creates an instance of GatewayCorsProperties class.
-
-
Method Details
-
allowedOrigins
Get the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all domains.- Returns:
- the allowedOrigins value.
-
withAllowedOrigins
Set the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all domains.- Parameters:
allowedOrigins- the allowedOrigins value to set.- Returns:
- the GatewayCorsProperties object itself.
-
allowedOriginPatterns
Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.- Returns:
- the allowedOriginPatterns value.
-
withAllowedOriginPatterns
Set the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.- Parameters:
allowedOriginPatterns- the allowedOriginPatterns value to set.- Returns:
- the GatewayCorsProperties object itself.
-
allowedMethods
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:
- the allowedMethods value.
-
withAllowedMethods
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:
allowedMethods- the allowedMethods value to set.- Returns:
- the GatewayCorsProperties object itself.
-
allowedHeaders
Get the allowedHeaders property: Allowed headers in cross-site requests. The special value `*` allows actual requests to send any header.- Returns:
- the allowedHeaders value.
-
withAllowedHeaders
Set the allowedHeaders property: Allowed headers in cross-site requests. The special value `*` allows actual requests to send any header.- Parameters:
allowedHeaders- the allowedHeaders value to set.- Returns:
- the GatewayCorsProperties object itself.
-
maxAge
Get the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.- Returns:
- the maxAge value.
-
withMaxAge
Set the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.- Parameters:
maxAge- the maxAge value to set.- Returns:
- the GatewayCorsProperties object itself.
-
allowCredentials
Get the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: `true`, `false`.- Returns:
- the allowCredentials value.
-
withAllowCredentials
Set the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: `true`, `false`.- Parameters:
allowCredentials- the allowCredentials value to set.- Returns:
- the GatewayCorsProperties object itself.
-
exposedHeaders
Get the exposedHeaders property: HTTP response headers to expose for cross-site requests.- Returns:
- the exposedHeaders value.
-
withExposedHeaders
Set the exposedHeaders property: HTTP response headers to expose for cross-site requests.- Parameters:
exposedHeaders- the exposedHeaders value to set.- Returns:
- the GatewayCorsProperties object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<GatewayCorsProperties>- Throws:
IOException
-
fromJson
public static GatewayCorsProperties fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of GatewayCorsProperties from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of GatewayCorsProperties if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the GatewayCorsProperties.
-