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 Details

    • GatewayCorsProperties

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

    • allowedOrigins

      public List<String> allowedOrigins()
      Get the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all domains.
      Returns:
      the allowedOrigins value.
    • withAllowedOrigins

      public GatewayCorsProperties withAllowedOrigins(List<String> allowedOrigins)
      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

      public List<String> allowedOriginPatterns()
      Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.
      Returns:
      the allowedOriginPatterns value.
    • withAllowedOriginPatterns

      public GatewayCorsProperties withAllowedOriginPatterns(List<String> allowedOriginPatterns)
      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

      public List<String> 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

      public GatewayCorsProperties withAllowedMethods(List<String> allowedMethods)
      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

      public List<String> 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

      public GatewayCorsProperties withAllowedHeaders(List<String> allowedHeaders)
      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

      public Integer 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

      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:
      maxAge - the maxAge value to set.
      Returns:
      the GatewayCorsProperties object itself.
    • allowCredentials

      public Boolean allowCredentials()
      Get the allowCredentials property: Whether user credentials are supported on cross-site requests. Valid values: `true`, `false`.
      Returns:
      the allowCredentials value.
    • withAllowCredentials

      public GatewayCorsProperties withAllowCredentials(Boolean allowCredentials)
      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

      public List<String> exposedHeaders()
      Get the exposedHeaders property: HTTP response headers to expose for cross-site requests.
      Returns:
      the exposedHeaders value.
    • withExposedHeaders

      public GatewayCorsProperties withExposedHeaders(List<String> exposedHeaders)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.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.