- 1.63.0 (latest)
- 1.62.0
- 1.61.0
- 1.59.0
- 1.58.0
- 1.57.0
- 1.56.0
- 1.55.0
- 1.54.0
- 1.53.0
- 1.52.0
- 1.51.0
- 1.50.0
- 1.49.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.38.0
- 1.37.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.26.0
- 1.25.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.1
- 1.11.0
- 1.9.1
- 1.8.1
- 1.7.2
- 1.6.0-beta
public static final class CorsPolicy.Builder extends GeneratedMessageV3.Builder<CorsPolicy.Builder> implements CorsPolicyOrBuilder
The specification for allowing client side cross-origin requests. Please see W3C Recommendation for Cross Origin Resource Sharing
Protobuf type google.cloud.compute.v1.CorsPolicy
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > CorsPolicy.BuilderImplements
CorsPolicyOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Type | Description |
Descriptor |
Methods
addAllAllowHeaders(Iterable<String> values)
public CorsPolicy.Builder addAllAllowHeaders(Iterable<String> values)
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Name | Description |
values | Iterable<String> The allowHeaders to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllAllowMethods(Iterable<String> values)
public CorsPolicy.Builder addAllAllowMethods(Iterable<String> values)
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Name | Description |
values | Iterable<String> The allowMethods to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllAllowOriginRegexes(Iterable<String> values)
public CorsPolicy.Builder addAllAllowOriginRegexes(Iterable<String> values)
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Name | Description |
values | Iterable<String> The allowOriginRegexes to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllAllowOrigins(Iterable<String> values)
public CorsPolicy.Builder addAllAllowOrigins(Iterable<String> values)
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Name | Description |
values | Iterable<String> The allowOrigins to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllExposeHeaders(Iterable<String> values)
public CorsPolicy.Builder addAllExposeHeaders(Iterable<String> values)
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Name | Description |
values | Iterable<String> The exposeHeaders to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowHeaders(String value)
public CorsPolicy.Builder addAllowHeaders(String value)
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Name | Description |
value | String The allowHeaders to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowHeadersBytes(ByteString value)
public CorsPolicy.Builder addAllowHeadersBytes(ByteString value)
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Name | Description |
value | ByteString The bytes of the allowHeaders to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowMethods(String value)
public CorsPolicy.Builder addAllowMethods(String value)
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Name | Description |
value | String The allowMethods to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowMethodsBytes(ByteString value)
public CorsPolicy.Builder addAllowMethodsBytes(ByteString value)
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Name | Description |
value | ByteString The bytes of the allowMethods to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowOriginRegexes(String value)
public CorsPolicy.Builder addAllowOriginRegexes(String value)
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Name | Description |
value | String The allowOriginRegexes to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowOriginRegexesBytes(ByteString value)
public CorsPolicy.Builder addAllowOriginRegexesBytes(ByteString value)
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Name | Description |
value | ByteString The bytes of the allowOriginRegexes to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowOrigins(String value)
public CorsPolicy.Builder addAllowOrigins(String value)
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Name | Description |
value | String The allowOrigins to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addAllowOriginsBytes(ByteString value)
public CorsPolicy.Builder addAllowOriginsBytes(ByteString value)
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Name | Description |
value | ByteString The bytes of the allowOrigins to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addExposeHeaders(String value)
public CorsPolicy.Builder addExposeHeaders(String value)
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Name | Description |
value | String The exposeHeaders to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addExposeHeadersBytes(ByteString value)
public CorsPolicy.Builder addExposeHeadersBytes(ByteString value)
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Name | Description |
value | ByteString The bytes of the exposeHeaders to add. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public CorsPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
CorsPolicy.Builder |
build()
public CorsPolicy build()
Type | Description |
CorsPolicy |
buildPartial()
public CorsPolicy buildPartial()
Type | Description |
CorsPolicy |
clear()
public CorsPolicy.Builder clear()
Type | Description |
CorsPolicy.Builder |
clearAllowCredentials()
public CorsPolicy.Builder clearAllowCredentials()
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. Default is false.
optional bool allow_credentials = 481263366;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearAllowHeaders()
public CorsPolicy.Builder clearAllowHeaders()
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearAllowMethods()
public CorsPolicy.Builder clearAllowMethods()
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearAllowOriginRegexes()
public CorsPolicy.Builder clearAllowOriginRegexes()
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearAllowOrigins()
public CorsPolicy.Builder clearAllowOrigins()
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearDisabled()
public CorsPolicy.Builder clearDisabled()
If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.
optional bool disabled = 270940796;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearExposeHeaders()
public CorsPolicy.Builder clearExposeHeaders()
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearField(Descriptors.FieldDescriptor field)
public CorsPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Name | Description |
field | FieldDescriptor |
Type | Description |
CorsPolicy.Builder |
clearMaxAge()
public CorsPolicy.Builder clearMaxAge()
Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
optional int32 max_age = 307559332;
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public CorsPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Name | Description |
oneof | OneofDescriptor |
Type | Description |
CorsPolicy.Builder |
clone()
public CorsPolicy.Builder clone()
Type | Description |
CorsPolicy.Builder |
getAllowCredentials()
public boolean getAllowCredentials()
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. Default is false.
optional bool allow_credentials = 481263366;
Type | Description |
boolean | The allowCredentials. |
getAllowHeaders(int index)
public String getAllowHeaders(int index)
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The allowHeaders at the given index. |
getAllowHeadersBytes(int index)
public ByteString getAllowHeadersBytes(int index)
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the allowHeaders at the given index. |
getAllowHeadersCount()
public int getAllowHeadersCount()
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Type | Description |
int | The count of allowHeaders. |
getAllowHeadersList()
public ProtocolStringList getAllowHeadersList()
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Type | Description |
ProtocolStringList | A list containing the allowHeaders. |
getAllowMethods(int index)
public String getAllowMethods(int index)
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The allowMethods at the given index. |
getAllowMethodsBytes(int index)
public ByteString getAllowMethodsBytes(int index)
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the allowMethods at the given index. |
getAllowMethodsCount()
public int getAllowMethodsCount()
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Type | Description |
int | The count of allowMethods. |
getAllowMethodsList()
public ProtocolStringList getAllowMethodsList()
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Type | Description |
ProtocolStringList | A list containing the allowMethods. |
getAllowOriginRegexes(int index)
public String getAllowOriginRegexes(int index)
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The allowOriginRegexes at the given index. |
getAllowOriginRegexesBytes(int index)
public ByteString getAllowOriginRegexesBytes(int index)
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the allowOriginRegexes at the given index. |
getAllowOriginRegexesCount()
public int getAllowOriginRegexesCount()
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Type | Description |
int | The count of allowOriginRegexes. |
getAllowOriginRegexesList()
public ProtocolStringList getAllowOriginRegexesList()
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Type | Description |
ProtocolStringList | A list containing the allowOriginRegexes. |
getAllowOrigins(int index)
public String getAllowOrigins(int index)
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The allowOrigins at the given index. |
getAllowOriginsBytes(int index)
public ByteString getAllowOriginsBytes(int index)
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the allowOrigins at the given index. |
getAllowOriginsCount()
public int getAllowOriginsCount()
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Type | Description |
int | The count of allowOrigins. |
getAllowOriginsList()
public ProtocolStringList getAllowOriginsList()
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Type | Description |
ProtocolStringList | A list containing the allowOrigins. |
getDefaultInstanceForType()
public CorsPolicy getDefaultInstanceForType()
Type | Description |
CorsPolicy |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Type | Description |
Descriptor |
getDisabled()
public boolean getDisabled()
If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.
optional bool disabled = 270940796;
Type | Description |
boolean | The disabled. |
getExposeHeaders(int index)
public String getExposeHeaders(int index)
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Name | Description |
index | int The index of the element to return. |
Type | Description |
String | The exposeHeaders at the given index. |
getExposeHeadersBytes(int index)
public ByteString getExposeHeadersBytes(int index)
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Name | Description |
index | int The index of the value to return. |
Type | Description |
ByteString | The bytes of the exposeHeaders at the given index. |
getExposeHeadersCount()
public int getExposeHeadersCount()
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Type | Description |
int | The count of exposeHeaders. |
getExposeHeadersList()
public ProtocolStringList getExposeHeadersList()
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Type | Description |
ProtocolStringList | A list containing the exposeHeaders. |
getMaxAge()
public int getMaxAge()
Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
optional int32 max_age = 307559332;
Type | Description |
int | The maxAge. |
hasAllowCredentials()
public boolean hasAllowCredentials()
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. Default is false.
optional bool allow_credentials = 481263366;
Type | Description |
boolean | Whether the allowCredentials field is set. |
hasDisabled()
public boolean hasDisabled()
If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.
optional bool disabled = 270940796;
Type | Description |
boolean | Whether the disabled field is set. |
hasMaxAge()
public boolean hasMaxAge()
Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
optional int32 max_age = 307559332;
Type | Description |
boolean | Whether the maxAge field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Type | Description |
boolean |
mergeFrom(CorsPolicy other)
public CorsPolicy.Builder mergeFrom(CorsPolicy other)
Name | Description |
other | CorsPolicy |
Type | Description |
CorsPolicy.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public CorsPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Name | Description |
input | CodedInputStream |
extensionRegistry | ExtensionRegistryLite |
Type | Description |
CorsPolicy.Builder |
Type | Description |
IOException |
mergeFrom(Message other)
public CorsPolicy.Builder mergeFrom(Message other)
Name | Description |
other | Message |
Type | Description |
CorsPolicy.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final CorsPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
CorsPolicy.Builder |
setAllowCredentials(boolean value)
public CorsPolicy.Builder setAllowCredentials(boolean value)
In response to a preflight request, setting this to true indicates that the actual request can include user credentials. This translates to the Access-Control-Allow-Credentials header. Default is false.
optional bool allow_credentials = 481263366;
Name | Description |
value | boolean The allowCredentials to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setAllowHeaders(int index, String value)
public CorsPolicy.Builder setAllowHeaders(int index, String value)
Specifies the content for the Access-Control-Allow-Headers header.
repeated string allow_headers = 45179024;
Name | Description |
index | int The index to set the value at. |
value | String The allowHeaders to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setAllowMethods(int index, String value)
public CorsPolicy.Builder setAllowMethods(int index, String value)
Specifies the content for the Access-Control-Allow-Methods header.
repeated string allow_methods = 205405372;
Name | Description |
index | int The index to set the value at. |
value | String The allowMethods to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setAllowOriginRegexes(int index, String value)
public CorsPolicy.Builder setAllowOriginRegexes(int index, String value)
Specifies the regualar expression patterns that match allowed origins. For regular expression grammar please see github.com/google/re2/wiki/Syntax An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origin_regexes = 215385810;
Name | Description |
index | int The index to set the value at. |
value | String The allowOriginRegexes to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setAllowOrigins(int index, String value)
public CorsPolicy.Builder setAllowOrigins(int index, String value)
Specifies the list of origins that will be allowed to do CORS requests. An origin is allowed if it matches either an item in allowOrigins or an item in allowOriginRegexes.
repeated string allow_origins = 194914071;
Name | Description |
index | int The index to set the value at. |
value | String The allowOrigins to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setDisabled(boolean value)
public CorsPolicy.Builder setDisabled(boolean value)
If true, specifies the CORS policy is disabled. The default value of false, which indicates that the CORS policy is in effect.
optional bool disabled = 270940796;
Name | Description |
value | boolean The disabled to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setExposeHeaders(int index, String value)
public CorsPolicy.Builder setExposeHeaders(int index, String value)
Specifies the content for the Access-Control-Expose-Headers header.
repeated string expose_headers = 247604747;
Name | Description |
index | int The index to set the value at. |
value | String The exposeHeaders to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public CorsPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Name | Description |
field | FieldDescriptor |
value | Object |
Type | Description |
CorsPolicy.Builder |
setMaxAge(int value)
public CorsPolicy.Builder setMaxAge(int value)
Specifies how long results of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.
optional int32 max_age = 307559332;
Name | Description |
value | int The maxAge to set. |
Type | Description |
CorsPolicy.Builder | This builder for chaining. |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public CorsPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Name | Description |
field | FieldDescriptor |
index | int |
value | Object |
Type | Description |
CorsPolicy.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final CorsPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Name | Description |
unknownFields | UnknownFieldSet |
Type | Description |
CorsPolicy.Builder |