Class CorsSettings

java.lang.Object
com.azure.resourcemanager.appservice.models.CorsSettings
All Implemented Interfaces:
com.azure.json.JsonSerializable<CorsSettings>

public final class CorsSettings extends Object implements com.azure.json.JsonSerializable<CorsSettings>
Cross-Origin Resource Sharing (CORS) settings for the app.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of CorsSettings class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345).
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of CorsSettings from the JsonReader.
    Get the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withAllowedOrigins(List<String> allowedOrigins)
    Set the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345).
    withSupportCredentials(Boolean supportCredentials)
    Set the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed.

    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

    • CorsSettings

      public CorsSettings()
      Creates an instance of CorsSettings class.
  • Method Details

    • allowedOrigins

      public List<String> allowedOrigins()
      Get the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all.
      Returns:
      the allowedOrigins value.
    • withAllowedOrigins

      public CorsSettings withAllowedOrigins(List<String> allowedOrigins)
      Set the allowedOrigins property: Gets or sets the list of origins that should be allowed to make cross-origin calls (for example: http://example.com:12345). Use "*" to allow all.
      Parameters:
      allowedOrigins - the allowedOrigins value to set.
      Returns:
      the CorsSettings object itself.
    • supportCredentials

      public Boolean supportCredentials()
      Get the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials for more details.
      Returns:
      the supportCredentials value.
    • withSupportCredentials

      public CorsSettings withSupportCredentials(Boolean supportCredentials)
      Set the supportCredentials property: Gets or sets whether CORS requests with credentials are allowed. See https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials for more details.
      Parameters:
      supportCredentials - the supportCredentials value to set.
      Returns:
      the CorsSettings object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<CorsSettings>
      Throws:
      IOException
    • fromJson

      public static CorsSettings fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of CorsSettings from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of CorsSettings 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 CorsSettings.