다음을 통해 공유


GatewayCorsProperties Class

  • java.lang.Object
    • com.azure.resourcemanager.appplatform.models.GatewayCorsProperties

Implements

public final class GatewayCorsProperties
implements JsonSerializable<GatewayCorsProperties>

Cross-Origin Resource Sharing property.

Constructor Summary

Constructor Description
GatewayCorsProperties()

Creates an instance of GatewayCorsProperties class.

Method Summary

Modifier and Type Method and Description
Boolean allowCredentials()

Get the allowCredentials property: Whether user credentials are supported on cross-site requests.

List<String> allowedHeaders()

Get the allowedHeaders property: Allowed headers in cross-site requests.

List<String> allowedMethods()

Get the allowedMethods property: Allowed HTTP methods on cross-site requests.

List<String> allowedOriginPatterns()

Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.

List<String> allowedOrigins()

Get the allowedOrigins property: Allowed origins to make cross-site requests.

List<String> exposedHeaders()

Get the exposedHeaders property: HTTP response headers to expose for cross-site requests.

static GatewayCorsProperties fromJson(JsonReader jsonReader)

Reads an instance of GatewayCorsProperties from the JsonReader.

Integer maxAge()

Get the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.

JsonWriter toJson(JsonWriter jsonWriter)
void validate()

Validates the instance.

GatewayCorsProperties withAllowCredentials(Boolean allowCredentials)

Set the allowCredentials property: Whether user credentials are supported on cross-site requests.

GatewayCorsProperties withAllowedHeaders(List<String> allowedHeaders)

Set the allowedHeaders property: Allowed headers in cross-site requests.

GatewayCorsProperties withAllowedMethods(List<String> allowedMethods)

Set the allowedMethods property: Allowed HTTP methods on cross-site requests.

GatewayCorsProperties withAllowedOriginPatterns(List<String> allowedOriginPatterns)

Set the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.

GatewayCorsProperties withAllowedOrigins(List<String> allowedOrigins)

Set the allowedOrigins property: Allowed origins to make cross-site requests.

GatewayCorsProperties withExposedHeaders(List<String> exposedHeaders)

Set the exposedHeaders property: HTTP response headers to expose for cross-site requests.

GatewayCorsProperties withMaxAge(Integer maxAge)

Set the maxAge property: How long, in seconds, the response from a pre-flight request can be cached by clients.

Methods inherited from java.lang.Object

Constructor Details

GatewayCorsProperties

public GatewayCorsProperties()

Creates an instance of GatewayCorsProperties class.

Method Details

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.

allowedHeaders

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

allowedMethods

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

allowedOriginPatterns

public List allowedOriginPatterns()

Get the allowedOriginPatterns property: Allowed origin patterns to make cross-site requests.

Returns:

the allowedOriginPatterns value.

allowedOrigins

public List allowedOrigins()

Get the allowedOrigins property: Allowed origins to make cross-site requests. The special value `*` allows all domains.

Returns:

the allowedOrigins value.

exposedHeaders

public List exposedHeaders()

Get the exposedHeaders property: HTTP response headers to expose for cross-site requests.

Returns:

the exposedHeaders value.

fromJson

public static GatewayCorsProperties fromJson(JsonReader jsonReader)

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.

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.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

validate

public void validate()

Validates the instance.

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.

withAllowedHeaders

public GatewayCorsProperties withAllowedHeaders(List 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.

withAllowedMethods

public GatewayCorsProperties withAllowedMethods(List 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.

withAllowedOriginPatterns

public GatewayCorsProperties withAllowedOriginPatterns(List 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.

withAllowedOrigins

public GatewayCorsProperties withAllowedOrigins(List 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.

withExposedHeaders

public GatewayCorsProperties withExposedHeaders(List 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.

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.

Applies to