### YamlMime:JavaType
uid: "com.azure.search.documents.indexes.models.CorsOptions"
fullName: "com.azure.search.documents.indexes.models.CorsOptions"
name: "CorsOptions"
nameWithType: "CorsOptions"
summary: "Defines options to control Cross-Origin Resource Sharing (CORS) for an index."
inheritances:
- ""
inheritedClassMethods:
- classRef: "java.lang.Object"
methodsRef:
- "clone"
- "equals"
- "finalize"
- "getClass"
- "hashCode"
- "notify"
- "notifyAll"
- "toString"
- "wait"
- "wait"
- "wait"
syntax: "public final class **CorsOptions** implements <>"
constructors:
- uid: "com.azure.search.documents.indexes.models.CorsOptions.CorsOptions(java.util.List)"
fullName: "com.azure.search.documents.indexes.models.CorsOptions.CorsOptions(List allowedOrigins)"
name: "CorsOptions(List allowedOrigins)"
nameWithType: "CorsOptions.CorsOptions(List allowedOrigins)"
summary: "Creates an instance of CorsOptions class."
parameters:
- description: "the allowedOrigins value to set."
name: "allowedOrigins"
type: "List<String>"
syntax: "public CorsOptions(List allowedOrigins)"
desc: "Creates an instance of CorsOptions class."
methods:
- uid: "com.azure.search.documents.indexes.models.CorsOptions.fromJson(com.azure.json.JsonReader)"
fullName: "com.azure.search.documents.indexes.models.CorsOptions.fromJson(JsonReader jsonReader)"
name: "fromJson(JsonReader jsonReader)"
nameWithType: "CorsOptions.fromJson(JsonReader jsonReader)"
summary: "Reads an instance of CorsOptions from the JsonReader."
modifiers:
- "static"
parameters:
- description: "The JsonReader being read."
name: "jsonReader"
type: ""
syntax: "public static CorsOptions fromJson(JsonReader jsonReader)"
exceptions:
- description: "If the deserialized JSON object was missing any required properties."
type: "IOException"
desc: "Reads an instance of CorsOptions from the JsonReader."
returns:
description: "An instance of CorsOptions if the JsonReader was pointing to an instance of it, or null if it was\n pointing to JSON null."
type: ""
- uid: "com.azure.search.documents.indexes.models.CorsOptions.getAllowedOrigins()"
fullName: "com.azure.search.documents.indexes.models.CorsOptions.getAllowedOrigins()"
name: "getAllowedOrigins()"
nameWithType: "CorsOptions.getAllowedOrigins()"
summary: "Get the allowedOrigins property: The list of origins from which JavaScript code will be granted access to your index."
syntax: "public List getAllowedOrigins()"
desc: "Get the allowedOrigins property: The list of origins from which JavaScript code will be granted access to your index. Can contain a list of hosts of the form \\{protocol\\}://\\{fully-qualified-domain-name\\}\\[:\\{port\\#\\}\\], or a single '\\*' to allow all origins (not recommended)."
returns:
description: "the allowedOrigins value."
type: "List<String>"
- uid: "com.azure.search.documents.indexes.models.CorsOptions.getMaxAgeInSeconds()"
fullName: "com.azure.search.documents.indexes.models.CorsOptions.getMaxAgeInSeconds()"
name: "getMaxAgeInSeconds()"
nameWithType: "CorsOptions.getMaxAgeInSeconds()"
summary: "Get the maxAgeInSeconds property: The duration for which browsers should cache CORS preflight responses."
syntax: "public Long getMaxAgeInSeconds()"
desc: "Get the maxAgeInSeconds property: The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes."
returns:
description: "the maxAgeInSeconds value."
type: "Long"
- uid: "com.azure.search.documents.indexes.models.CorsOptions.setMaxAgeInSeconds(java.lang.Long)"
fullName: "com.azure.search.documents.indexes.models.CorsOptions.setMaxAgeInSeconds(Long maxAgeInSeconds)"
name: "setMaxAgeInSeconds(Long maxAgeInSeconds)"
nameWithType: "CorsOptions.setMaxAgeInSeconds(Long maxAgeInSeconds)"
summary: "Set the maxAgeInSeconds property: The duration for which browsers should cache CORS preflight responses."
parameters:
- description: "the maxAgeInSeconds value to set."
name: "maxAgeInSeconds"
type: "Long"
syntax: "public CorsOptions setMaxAgeInSeconds(Long maxAgeInSeconds)"
desc: "Set the maxAgeInSeconds property: The duration for which browsers should cache CORS preflight responses. Defaults to 5 minutes."
returns:
description: "the CorsOptions object itself."
type: ""
- uid: "com.azure.search.documents.indexes.models.CorsOptions.toJson(com.azure.json.JsonWriter)"
fullName: "com.azure.search.documents.indexes.models.CorsOptions.toJson(JsonWriter jsonWriter)"
name: "toJson(JsonWriter jsonWriter)"
nameWithType: "CorsOptions.toJson(JsonWriter jsonWriter)"
parameters:
- name: "jsonWriter"
type: ""
syntax: "public JsonWriter toJson(JsonWriter jsonWriter)"
exceptions:
- type: "IOException"
returns:
type: ""
type: "class"
desc: "Defines options to control Cross-Origin Resource Sharing (CORS) for an index."
implements:
- "<>"
metadata: {}
package: "com.azure.search.documents.indexes.models"
artifact: com.azure:azure-search-documents:11.7.3