### YamlMime:JavaType
uid: "com.azure.search.models.CorsOptions"
fullName: "com.azure.search.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**"
constructors:
- uid: "com.azure.search.models.CorsOptions.CorsOptions()"
fullName: "com.azure.search.models.CorsOptions.CorsOptions()"
name: "CorsOptions()"
nameWithType: "CorsOptions.CorsOptions()"
syntax: "public CorsOptions()"
methods:
- uid: "com.azure.search.models.CorsOptions.getAllowedOrigins()"
fullName: "com.azure.search.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.models.CorsOptions.getMaxAgeInSeconds()"
fullName: "com.azure.search.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.models.CorsOptions.setAllowedOrigins(java.lang.String...)"
fullName: "com.azure.search.models.CorsOptions.setAllowedOrigins(String[] allowedOrigins)"
name: "setAllowedOrigins(String[] allowedOrigins)"
nameWithType: "CorsOptions.setAllowedOrigins(String[] allowedOrigins)"
summary: "Set the allowedOrigins property: The list of origins from which JavaScript code will be granted access to your index."
parameters:
- description: "the allowedOrigins value to set."
name: "allowedOrigins"
type: "String[]"
syntax: "public CorsOptions setAllowedOrigins(String[] allowedOrigins)"
desc: "Set 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 CorsOptions object itself."
type: ""
- uid: "com.azure.search.models.CorsOptions.setMaxAgeInSeconds(java.lang.Long)"
fullName: "com.azure.search.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: ""
type: "class"
desc: "Defines options to control Cross-Origin Resource Sharing (CORS) for an index."
metadata: {}
package: "com.azure.search.models"
artifact: com.azure:azure-search:11.0.0-beta.1