Class CorsRule
java.lang.Object
com.azure.resourcemanager.storage.models.CorsRule
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CorsRule>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the allowedHeaders property: Required if CorsRule element is present.Get the allowedMethods property: Required if CorsRule element is present.Get the allowedOrigins property: Required if CorsRule element is present.Get the exposedHeaders property: Required if CorsRule element is present.static CorsRulefromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CorsRule from the JsonReader.intGet the maxAgeInSeconds property: Required if CorsRule element is present.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.withAllowedHeaders(List<String> allowedHeaders) Set the allowedHeaders property: Required if CorsRule element is present.withAllowedMethods(List<CorsRuleAllowedMethodsItem> allowedMethods) Set the allowedMethods property: Required if CorsRule element is present.withAllowedOrigins(List<String> allowedOrigins) Set the allowedOrigins property: Required if CorsRule element is present.withExposedHeaders(List<String> exposedHeaders) Set the exposedHeaders property: Required if CorsRule element is present.withMaxAgeInSeconds(int maxAgeInSeconds) Set the maxAgeInSeconds property: Required if CorsRule element is present.Methods inherited from class 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
-
CorsRule
public CorsRule()Creates an instance of CorsRule class.
-
-
Method Details
-
allowedOrigins
-
withAllowedOrigins
Set the allowedOrigins property: Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains.- Parameters:
allowedOrigins- the allowedOrigins value to set.- Returns:
- the CorsRule object itself.
-
allowedMethods
Get the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.- Returns:
- the allowedMethods value.
-
withAllowedMethods
Set the allowedMethods property: Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.- Parameters:
allowedMethods- the allowedMethods value to set.- Returns:
- the CorsRule object itself.
-
maxAgeInSeconds
public int maxAgeInSeconds()Get the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.- Returns:
- the maxAgeInSeconds value.
-
withMaxAgeInSeconds
Set the maxAgeInSeconds property: Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.- Parameters:
maxAgeInSeconds- the maxAgeInSeconds value to set.- Returns:
- the CorsRule object itself.
-
exposedHeaders
-
withExposedHeaders
-
allowedHeaders
-
withAllowedHeaders
Set the allowedHeaders property: Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.- Parameters:
allowedHeaders- the allowedHeaders value to set.- Returns:
- the CorsRule 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<CorsRule>- Throws:
IOException
-
fromJson
Reads an instance of CorsRule from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CorsRule 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 CorsRule.
-