Class HttpRoute.CorsPolicy.Builder (0.11.0)

public static final class HttpRoute.CorsPolicy.Builder extends GeneratedMessageV3.Builder<HttpRoute.CorsPolicy.Builder> implements HttpRoute.CorsPolicyOrBuilder

The Specification for allowing client side cross-origin requests.

Protobuf type google.cloud.networkservices.v1.HttpRoute.CorsPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addAllAllowHeaders(Iterable<String> values)

public HttpRoute.CorsPolicy.Builder addAllAllowHeaders(Iterable<String> values)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
values Iterable<String>

The allowHeaders to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllAllowMethods(Iterable<String> values)

public HttpRoute.CorsPolicy.Builder addAllAllowMethods(Iterable<String> values)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
values Iterable<String>

The allowMethods to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllAllowOriginRegexes(Iterable<String> values)

public HttpRoute.CorsPolicy.Builder addAllAllowOriginRegexes(Iterable<String> values)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
values Iterable<String>

The allowOriginRegexes to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllAllowOrigins(Iterable<String> values)

public HttpRoute.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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
values Iterable<String>

The allowOrigins to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllExposeHeaders(Iterable<String> values)

public HttpRoute.CorsPolicy.Builder addAllExposeHeaders(Iterable<String> values)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
values Iterable<String>

The exposeHeaders to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowHeaders(String value)

public HttpRoute.CorsPolicy.Builder addAllowHeaders(String value)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
value String

The allowHeaders to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowHeadersBytes(ByteString value)

public HttpRoute.CorsPolicy.Builder addAllowHeadersBytes(ByteString value)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
value ByteString

The bytes of the allowHeaders to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowMethods(String value)

public HttpRoute.CorsPolicy.Builder addAllowMethods(String value)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
value String

The allowMethods to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowMethodsBytes(ByteString value)

public HttpRoute.CorsPolicy.Builder addAllowMethodsBytes(ByteString value)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
value ByteString

The bytes of the allowMethods to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowOriginRegexes(String value)

public HttpRoute.CorsPolicy.Builder addAllowOriginRegexes(String value)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
value String

The allowOriginRegexes to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowOriginRegexesBytes(ByteString value)

public HttpRoute.CorsPolicy.Builder addAllowOriginRegexesBytes(ByteString value)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
value ByteString

The bytes of the allowOriginRegexes to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowOrigins(String value)

public HttpRoute.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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
value String

The allowOrigins to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addAllowOriginsBytes(ByteString value)

public HttpRoute.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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
value ByteString

The bytes of the allowOrigins to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addExposeHeaders(String value)

public HttpRoute.CorsPolicy.Builder addExposeHeaders(String value)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
value String

The exposeHeaders to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addExposeHeadersBytes(ByteString value)

public HttpRoute.CorsPolicy.Builder addExposeHeadersBytes(ByteString value)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
value ByteString

The bytes of the exposeHeaders to add.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpRoute.CorsPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

build()

public HttpRoute.CorsPolicy build()
Returns
Type Description
HttpRoute.CorsPolicy

buildPartial()

public HttpRoute.CorsPolicy buildPartial()
Returns
Type Description
HttpRoute.CorsPolicy

clear()

public HttpRoute.CorsPolicy.Builder clear()
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

clearAllowCredentials()

public HttpRoute.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 value is false.

bool allow_credentials = 7;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearAllowHeaders()

public HttpRoute.CorsPolicy.Builder clearAllowHeaders()

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearAllowMethods()

public HttpRoute.CorsPolicy.Builder clearAllowMethods()

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearAllowOriginRegexes()

public HttpRoute.CorsPolicy.Builder clearAllowOriginRegexes()

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearAllowOrigins()

public HttpRoute.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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearDisabled()

public HttpRoute.CorsPolicy.Builder clearDisabled()

If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.

bool disabled = 8;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearExposeHeaders()

public HttpRoute.CorsPolicy.Builder clearExposeHeaders()

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public HttpRoute.CorsPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

clearMaxAge()

public HttpRoute.CorsPolicy.Builder clearMaxAge()

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpRoute.CorsPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

clone()

public HttpRoute.CorsPolicy.Builder clone()
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

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 value is false.

bool allow_credentials = 7;

Returns
Type Description
boolean

The allowCredentials.

getAllowHeaders(int index)

public String getAllowHeaders(int index)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowHeaders at the given index.

getAllowHeadersBytes(int index)

public ByteString getAllowHeadersBytes(int index)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowHeaders at the given index.

getAllowHeadersCount()

public int getAllowHeadersCount()

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Returns
Type Description
int

The count of allowHeaders.

getAllowHeadersList()

public ProtocolStringList getAllowHeadersList()

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Returns
Type Description
ProtocolStringList

A list containing the allowHeaders.

getAllowMethods(int index)

public String getAllowMethods(int index)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowMethods at the given index.

getAllowMethodsBytes(int index)

public ByteString getAllowMethodsBytes(int index)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowMethods at the given index.

getAllowMethodsCount()

public int getAllowMethodsCount()

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Returns
Type Description
int

The count of allowMethods.

getAllowMethodsList()

public ProtocolStringList getAllowMethodsList()

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Returns
Type Description
ProtocolStringList

A list containing the allowMethods.

getAllowOriginRegexes(int index)

public String getAllowOriginRegexes(int index)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The allowOriginRegexes at the given index.

getAllowOriginRegexesBytes(int index)

public ByteString getAllowOriginRegexesBytes(int index)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the allowOriginRegexes at the given index.

getAllowOriginRegexesCount()

public int getAllowOriginRegexesCount()

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Returns
Type Description
int

The count of allowOriginRegexes.

getAllowOriginRegexesList()

public ProtocolStringList getAllowOriginRegexesList()

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Returns
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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameter
Name Description
index int

The index of the value to return.

Returns
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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Returns
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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Returns
Type Description
ProtocolStringList

A list containing the allowOrigins.

getDefaultInstanceForType()

public HttpRoute.CorsPolicy getDefaultInstanceForType()
Returns
Type Description
HttpRoute.CorsPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

getDisabled()

public boolean getDisabled()

If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.

bool disabled = 8;

Returns
Type Description
boolean

The disabled.

getExposeHeaders(int index)

public String getExposeHeaders(int index)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The exposeHeaders at the given index.

getExposeHeadersBytes(int index)

public ByteString getExposeHeadersBytes(int index)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the exposeHeaders at the given index.

getExposeHeadersCount()

public int getExposeHeadersCount()

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Returns
Type Description
int

The count of exposeHeaders.

getExposeHeadersList()

public ProtocolStringList getExposeHeadersList()

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Returns
Type Description
ProtocolStringList

A list containing the exposeHeaders.

getMaxAge()

public String getMaxAge()

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Returns
Type Description
String

The maxAge.

getMaxAgeBytes()

public ByteString getMaxAgeBytes()

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Returns
Type Description
ByteString

The bytes for maxAge.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(HttpRoute.CorsPolicy other)

public HttpRoute.CorsPolicy.Builder mergeFrom(HttpRoute.CorsPolicy other)
Parameter
Name Description
other HttpRoute.CorsPolicy
Returns
Type Description
HttpRoute.CorsPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpRoute.CorsPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public HttpRoute.CorsPolicy.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpRoute.CorsPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

setAllowCredentials(boolean value)

public HttpRoute.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 value is false.

bool allow_credentials = 7;

Parameter
Name Description
value boolean

The allowCredentials to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setAllowHeaders(int index, String value)

public HttpRoute.CorsPolicy.Builder setAllowHeaders(int index, String value)

Specifies the content for Access-Control-Allow-Headers header.

repeated string allow_headers = 4;

Parameters
Name Description
index int

The index to set the value at.

value String

The allowHeaders to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setAllowMethods(int index, String value)

public HttpRoute.CorsPolicy.Builder setAllowMethods(int index, String value)

Specifies the content for Access-Control-Allow-Methods header.

repeated string allow_methods = 3;

Parameters
Name Description
index int

The index to set the value at.

value String

The allowMethods to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setAllowOriginRegexes(int index, String value)

public HttpRoute.CorsPolicy.Builder setAllowOriginRegexes(int index, String value)

Specifies the regular expression patterns that match allowed origins. For regular expression grammar, please see https://github.com/google/re2/wiki/Syntax.

repeated string allow_origin_regexes = 2;

Parameters
Name Description
index int

The index to set the value at.

value String

The allowOriginRegexes to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setAllowOrigins(int index, String value)

public HttpRoute.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 allow_origins or an item in allow_origin_regexes.

repeated string allow_origins = 1;

Parameters
Name Description
index int

The index to set the value at.

value String

The allowOrigins to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setDisabled(boolean value)

public HttpRoute.CorsPolicy.Builder setDisabled(boolean value)

If true, the CORS policy is disabled. The default value is false, which indicates that the CORS policy is in effect.

bool disabled = 8;

Parameter
Name Description
value boolean

The disabled to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setExposeHeaders(int index, String value)

public HttpRoute.CorsPolicy.Builder setExposeHeaders(int index, String value)

Specifies the content for Access-Control-Expose-Headers header.

repeated string expose_headers = 5;

Parameters
Name Description
index int

The index to set the value at.

value String

The exposeHeaders to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public HttpRoute.CorsPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

setMaxAge(String value)

public HttpRoute.CorsPolicy.Builder setMaxAge(String value)

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Parameter
Name Description
value String

The maxAge to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setMaxAgeBytes(ByteString value)

public HttpRoute.CorsPolicy.Builder setMaxAgeBytes(ByteString value)

Specifies how long result of a preflight request can be cached in seconds. This translates to the Access-Control-Max-Age header.

string max_age = 6;

Parameter
Name Description
value ByteString

The bytes for maxAge to set.

Returns
Type Description
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public HttpRoute.CorsPolicy.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpRoute.CorsPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
HttpRoute.CorsPolicy.Builder
Overrides