Class CorsPolicy
java.lang.Object
com.azure.resourcemanager.appcontainers.models.CorsPolicy
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CorsPolicy>
Cross-Origin-Resource-Sharing policy.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the allowCredentials property: Specifies whether the resource allows credentials.Get the allowedHeaders property: Specifies the content for the access-control-allow-headers header.Get the allowedMethods property: Specifies the content for the access-control-allow-methods header.Get the allowedOrigins property: Specifies the content for the access-control-allow-origins header.Get the exposeHeaders property: Specifies the content for the access-control-expose-headers header.static CorsPolicy
fromJson
(com.azure.json.JsonReader jsonReader) Reads an instance of CorsPolicy from the JsonReader.maxAge()
Get the maxAge property: Specifies the content for the access-control-max-age header.com.azure.json.JsonWriter
toJson
(com.azure.json.JsonWriter jsonWriter) void
validate()
Validates the instance.withAllowCredentials
(Boolean allowCredentials) Set the allowCredentials property: Specifies whether the resource allows credentials.withAllowedHeaders
(List<String> allowedHeaders) Set the allowedHeaders property: Specifies the content for the access-control-allow-headers header.withAllowedMethods
(List<String> allowedMethods) Set the allowedMethods property: Specifies the content for the access-control-allow-methods header.withAllowedOrigins
(List<String> allowedOrigins) Set the allowedOrigins property: Specifies the content for the access-control-allow-origins header.withExposeHeaders
(List<String> exposeHeaders) Set the exposeHeaders property: Specifies the content for the access-control-expose-headers header.withMaxAge
(Integer maxAge) Set the maxAge property: Specifies the content for the access-control-max-age header.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CorsPolicy
public CorsPolicy()Creates an instance of CorsPolicy class.
-
-
Method Details
-
allowedOrigins
Get the allowedOrigins property: Specifies the content for the access-control-allow-origins header.- Returns:
- the allowedOrigins value.
-
withAllowedOrigins
Set the allowedOrigins property: Specifies the content for the access-control-allow-origins header.- Parameters:
allowedOrigins
- the allowedOrigins value to set.- Returns:
- the CorsPolicy object itself.
-
allowedMethods
Get the allowedMethods property: Specifies the content for the access-control-allow-methods header.- Returns:
- the allowedMethods value.
-
withAllowedMethods
Set the allowedMethods property: Specifies the content for the access-control-allow-methods header.- Parameters:
allowedMethods
- the allowedMethods value to set.- Returns:
- the CorsPolicy object itself.
-
allowedHeaders
Get the allowedHeaders property: Specifies the content for the access-control-allow-headers header.- Returns:
- the allowedHeaders value.
-
withAllowedHeaders
Set the allowedHeaders property: Specifies the content for the access-control-allow-headers header.- Parameters:
allowedHeaders
- the allowedHeaders value to set.- Returns:
- the CorsPolicy object itself.
-
exposeHeaders
Get the exposeHeaders property: Specifies the content for the access-control-expose-headers header.- Returns:
- the exposeHeaders value.
-
withExposeHeaders
Set the exposeHeaders property: Specifies the content for the access-control-expose-headers header.- Parameters:
exposeHeaders
- the exposeHeaders value to set.- Returns:
- the CorsPolicy object itself.
-
maxAge
Get the maxAge property: Specifies the content for the access-control-max-age header.- Returns:
- the maxAge value.
-
withMaxAge
Set the maxAge property: Specifies the content for the access-control-max-age header.- Parameters:
maxAge
- the maxAge value to set.- Returns:
- the CorsPolicy object itself.
-
allowCredentials
Get the allowCredentials property: Specifies whether the resource allows credentials.- Returns:
- the allowCredentials value.
-
withAllowCredentials
Set the allowCredentials property: Specifies whether the resource allows credentials.- Parameters:
allowCredentials
- the allowCredentials value to set.- Returns:
- the CorsPolicy object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException
- thrown if the instance is not valid.
-
toJson
- Specified by:
toJson
in interfacecom.azure.json.JsonSerializable<CorsPolicy>
- Throws:
IOException
-
fromJson
Reads an instance of CorsPolicy from the JsonReader.- Parameters:
jsonReader
- The JsonReader being read.- Returns:
- An instance of CorsPolicy if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IllegalStateException
- If the deserialized JSON object was missing any required properties.IOException
- If an error occurs while reading the CorsPolicy.
-