@Generated(value="com.amazonaws:aws-java-sdk-code-generator") public class Cors extends Object implements Serializable, Cloneable, StructuredPojo
The cross-origin resource sharing (CORS) settings for your Lambda function URL. Use CORS to grant access to your function URL from any origin. You can also use CORS to control access for specific HTTP headers and methods in requests to your function URL.
Constructor and Description |
---|
Cors() |
Modifier and Type | Method and Description |
---|---|
Cors |
clone() |
boolean |
equals(Object obj) |
Boolean |
getAllowCredentials()
Whether to allow cookies or other credentials in requests to your function URL.
|
List<String> |
getAllowHeaders()
The HTTP headers that origins can include in requests to your function URL.
|
List<String> |
getAllowMethods()
The HTTP methods that are allowed when calling your function URL.
|
List<String> |
getAllowOrigins()
The origins that can access your function URL.
|
List<String> |
getExposeHeaders()
The HTTP headers in your function response that you want to expose to origins that call your function URL.
|
Integer |
getMaxAge()
The maximum amount of time, in seconds, that web browsers can cache results of a preflight request.
|
int |
hashCode() |
Boolean |
isAllowCredentials()
Whether to allow cookies or other credentials in requests to your function URL.
|
void |
marshall(ProtocolMarshaller protocolMarshaller)
Marshalls this structured data using the given
ProtocolMarshaller . |
void |
setAllowCredentials(Boolean allowCredentials)
Whether to allow cookies or other credentials in requests to your function URL.
|
void |
setAllowHeaders(Collection<String> allowHeaders)
The HTTP headers that origins can include in requests to your function URL.
|
void |
setAllowMethods(Collection<String> allowMethods)
The HTTP methods that are allowed when calling your function URL.
|
void |
setAllowOrigins(Collection<String> allowOrigins)
The origins that can access your function URL.
|
void |
setExposeHeaders(Collection<String> exposeHeaders)
The HTTP headers in your function response that you want to expose to origins that call your function URL.
|
void |
setMaxAge(Integer maxAge)
The maximum amount of time, in seconds, that web browsers can cache results of a preflight request.
|
String |
toString()
Returns a string representation of this object.
|
Cors |
withAllowCredentials(Boolean allowCredentials)
Whether to allow cookies or other credentials in requests to your function URL.
|
Cors |
withAllowHeaders(Collection<String> allowHeaders)
The HTTP headers that origins can include in requests to your function URL.
|
Cors |
withAllowHeaders(String... allowHeaders)
The HTTP headers that origins can include in requests to your function URL.
|
Cors |
withAllowMethods(Collection<String> allowMethods)
The HTTP methods that are allowed when calling your function URL.
|
Cors |
withAllowMethods(String... allowMethods)
The HTTP methods that are allowed when calling your function URL.
|
Cors |
withAllowOrigins(Collection<String> allowOrigins)
The origins that can access your function URL.
|
Cors |
withAllowOrigins(String... allowOrigins)
The origins that can access your function URL.
|
Cors |
withExposeHeaders(Collection<String> exposeHeaders)
The HTTP headers in your function response that you want to expose to origins that call your function URL.
|
Cors |
withExposeHeaders(String... exposeHeaders)
The HTTP headers in your function response that you want to expose to origins that call your function URL.
|
Cors |
withMaxAge(Integer maxAge)
The maximum amount of time, in seconds, that web browsers can cache results of a preflight request.
|
public void setAllowCredentials(Boolean allowCredentials)
Whether to allow cookies or other credentials in requests to your function URL. The default is false
.
allowCredentials
- Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.public Boolean getAllowCredentials()
Whether to allow cookies or other credentials in requests to your function URL. The default is false
.
false
.public Cors withAllowCredentials(Boolean allowCredentials)
Whether to allow cookies or other credentials in requests to your function URL. The default is false
.
allowCredentials
- Whether to allow cookies or other credentials in requests to your function URL. The default is
false
.public Boolean isAllowCredentials()
Whether to allow cookies or other credentials in requests to your function URL. The default is false
.
false
.public List<String> getAllowHeaders()
The HTTP headers that origins can include in requests to your function URL. For example: Date
,
Keep-Alive
, X-Custom-Header
.
Date
, Keep-Alive
, X-Custom-Header
.public void setAllowHeaders(Collection<String> allowHeaders)
The HTTP headers that origins can include in requests to your function URL. For example: Date
,
Keep-Alive
, X-Custom-Header
.
allowHeaders
- The HTTP headers that origins can include in requests to your function URL. For example: Date
, Keep-Alive
, X-Custom-Header
.public Cors withAllowHeaders(String... allowHeaders)
The HTTP headers that origins can include in requests to your function URL. For example: Date
,
Keep-Alive
, X-Custom-Header
.
NOTE: This method appends the values to the existing list (if any). Use
setAllowHeaders(java.util.Collection)
or withAllowHeaders(java.util.Collection)
if you want to
override the existing values.
allowHeaders
- The HTTP headers that origins can include in requests to your function URL. For example: Date
, Keep-Alive
, X-Custom-Header
.public Cors withAllowHeaders(Collection<String> allowHeaders)
The HTTP headers that origins can include in requests to your function URL. For example: Date
,
Keep-Alive
, X-Custom-Header
.
allowHeaders
- The HTTP headers that origins can include in requests to your function URL. For example: Date
, Keep-Alive
, X-Custom-Header
.public List<String> getAllowMethods()
The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).
GET
,
POST
, DELETE
, or the wildcard character (*
).public void setAllowMethods(Collection<String> allowMethods)
The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).
allowMethods
- The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).public Cors withAllowMethods(String... allowMethods)
The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).
NOTE: This method appends the values to the existing list (if any). Use
setAllowMethods(java.util.Collection)
or withAllowMethods(java.util.Collection)
if you want to
override the existing values.
allowMethods
- The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).public Cors withAllowMethods(Collection<String> allowMethods)
The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).
allowMethods
- The HTTP methods that are allowed when calling your function URL. For example: GET
,
POST
, DELETE
, or the wildcard character (*
).public List<String> getAllowOrigins()
The origins that can access your function URL. You can list any number of specific origins, separated by a comma.
For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
public void setAllowOrigins(Collection<String> allowOrigins)
The origins that can access your function URL. You can list any number of specific origins, separated by a comma.
For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
allowOrigins
- The origins that can access your function URL. You can list any number of specific origins, separated by a
comma. For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
public Cors withAllowOrigins(String... allowOrigins)
The origins that can access your function URL. You can list any number of specific origins, separated by a comma.
For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
NOTE: This method appends the values to the existing list (if any). Use
setAllowOrigins(java.util.Collection)
or withAllowOrigins(java.util.Collection)
if you want to
override the existing values.
allowOrigins
- The origins that can access your function URL. You can list any number of specific origins, separated by a
comma. For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
public Cors withAllowOrigins(Collection<String> allowOrigins)
The origins that can access your function URL. You can list any number of specific origins, separated by a comma.
For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
allowOrigins
- The origins that can access your function URL. You can list any number of specific origins, separated by a
comma. For example: https://www.example.com
, http://localhost:60905
.
Alternatively, you can grant access to all origins using the wildcard character (*
).
public List<String> getExposeHeaders()
The HTTP headers in your function response that you want to expose to origins that call your function URL. For
example: Date
, Keep-Alive
, X-Custom-Header
.
Date
, Keep-Alive
, X-Custom-Header
.public void setExposeHeaders(Collection<String> exposeHeaders)
The HTTP headers in your function response that you want to expose to origins that call your function URL. For
example: Date
, Keep-Alive
, X-Custom-Header
.
exposeHeaders
- The HTTP headers in your function response that you want to expose to origins that call your function URL.
For example: Date
, Keep-Alive
, X-Custom-Header
.public Cors withExposeHeaders(String... exposeHeaders)
The HTTP headers in your function response that you want to expose to origins that call your function URL. For
example: Date
, Keep-Alive
, X-Custom-Header
.
NOTE: This method appends the values to the existing list (if any). Use
setExposeHeaders(java.util.Collection)
or withExposeHeaders(java.util.Collection)
if you want
to override the existing values.
exposeHeaders
- The HTTP headers in your function response that you want to expose to origins that call your function URL.
For example: Date
, Keep-Alive
, X-Custom-Header
.public Cors withExposeHeaders(Collection<String> exposeHeaders)
The HTTP headers in your function response that you want to expose to origins that call your function URL. For
example: Date
, Keep-Alive
, X-Custom-Header
.
exposeHeaders
- The HTTP headers in your function response that you want to expose to origins that call your function URL.
For example: Date
, Keep-Alive
, X-Custom-Header
.public void setMaxAge(Integer maxAge)
The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default,
this is set to 0
, which means that the browser doesn't cache results.
maxAge
- The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By
default, this is set to 0
, which means that the browser doesn't cache results.public Integer getMaxAge()
The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default,
this is set to 0
, which means that the browser doesn't cache results.
0
, which means that the browser doesn't cache results.public Cors withMaxAge(Integer maxAge)
The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By default,
this is set to 0
, which means that the browser doesn't cache results.
maxAge
- The maximum amount of time, in seconds, that web browsers can cache results of a preflight request. By
default, this is set to 0
, which means that the browser doesn't cache results.public String toString()
toString
in class Object
Object.toString()
public void marshall(ProtocolMarshaller protocolMarshaller)
StructuredPojo
ProtocolMarshaller
.marshall
in interface StructuredPojo
protocolMarshaller
- Implementation of ProtocolMarshaller
used to marshall this object's data.