Class PortalConfigCspProperties

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

public final class PortalConfigCspProperties extends Object implements com.azure.json.JsonSerializable<PortalConfigCspProperties>
The developer portal Content Security Policy (CSP) settings.
  • Constructor Details

    • PortalConfigCspProperties

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

    • mode

      public PortalSettingsCspMode mode()
      Get the mode property: The mode of the developer portal Content Security Policy (CSP).
      Returns:
      the mode value.
    • withMode

      Set the mode property: The mode of the developer portal Content Security Policy (CSP).
      Parameters:
      mode - the mode value to set.
      Returns:
      the PortalConfigCspProperties object itself.
    • reportUri

      public List<String> reportUri()
      Get the reportUri property: The URLs used by the browser to report CSP violations.
      Returns:
      the reportUri value.
    • withReportUri

      public PortalConfigCspProperties withReportUri(List<String> reportUri)
      Set the reportUri property: The URLs used by the browser to report CSP violations.
      Parameters:
      reportUri - the reportUri value to set.
      Returns:
      the PortalConfigCspProperties object itself.
    • allowedSources

      public List<String> allowedSources()
      Get the allowedSources property: Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`.
      Returns:
      the allowedSources value.
    • withAllowedSources

      public PortalConfigCspProperties withAllowedSources(List<String> allowedSources)
      Set the allowedSources property: Allowed sources, e.g. `*.trusted.com`, `trusted.com`, `https://`.
      Parameters:
      allowedSources - the allowedSources value to set.
      Returns:
      the PortalConfigCspProperties 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<PortalConfigCspProperties>
      Throws:
      IOException
    • fromJson

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