Class HttpRoute.CorsPolicy.Builder (0.15.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.events.cloud.networkservices.v1.HttpRoute.CorsPolicy

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The allowHeaders to add.

Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The allowMethods to add.

Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The allowOriginRegexes to add.

Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The allowOrigins to add.

Returns
TypeDescription
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
NameDescription
valuesIterable<String>

The exposeHeaders to add.

Returns
TypeDescription
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
NameDescription
valueString

The allowHeaders to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the allowHeaders to add.

Returns
TypeDescription
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
NameDescription
valueString

The allowMethods to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the allowMethods to add.

Returns
TypeDescription
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
NameDescription
valueString

The allowOriginRegexes to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the allowOriginRegexes to add.

Returns
TypeDescription
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
NameDescription
valueString

The allowOrigins to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the allowOrigins to add.

Returns
TypeDescription
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
NameDescription
valueString

The exposeHeaders to add.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes of the exposeHeaders to add.

Returns
TypeDescription
HttpRoute.CorsPolicy.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpRoute.CorsPolicy.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder
Overrides

build()

public HttpRoute.CorsPolicy build()
Returns
TypeDescription
HttpRoute.CorsPolicy

buildPartial()

public HttpRoute.CorsPolicy buildPartial()
Returns
TypeDescription
HttpRoute.CorsPolicy

clear()

public HttpRoute.CorsPolicy.Builder clear()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public HttpRoute.CorsPolicy.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
HttpRoute.CorsPolicy.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpRoute.CorsPolicy.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder
Overrides

clone()

public HttpRoute.CorsPolicy.Builder clone()
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
int

The count of allowHeaders.

getAllowHeadersList()

public ProtocolStringList getAllowHeadersList()

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

repeated string allow_headers = 4;

Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
int

The count of allowMethods.

getAllowMethodsList()

public ProtocolStringList getAllowMethodsList()

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

repeated string allow_methods = 3;

Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ProtocolStringList

A list containing the allowOrigins.

getDefaultInstanceForType()

public HttpRoute.CorsPolicy getDefaultInstanceForType()
Returns
TypeDescription
HttpRoute.CorsPolicy

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
int

The count of exposeHeaders.

getExposeHeadersList()

public ProtocolStringList getExposeHeadersList()

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

repeated string expose_headers = 5;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for maxAge.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(HttpRoute.CorsPolicy other)

public HttpRoute.CorsPolicy.Builder mergeFrom(HttpRoute.CorsPolicy other)
Parameter
NameDescription
otherHttpRoute.CorsPolicy
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpRoute.CorsPolicy.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public HttpRoute.CorsPolicy.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpRoute.CorsPolicy.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
valueboolean

The allowCredentials to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The allowHeaders to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The allowMethods to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The allowOriginRegexes to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The allowOrigins to set.

Returns
TypeDescription
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
NameDescription
valueboolean

The disabled to set.

Returns
TypeDescription
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
NameDescription
indexint

The index to set the value at.

valueString

The exposeHeaders to set.

Returns
TypeDescription
HttpRoute.CorsPolicy.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public HttpRoute.CorsPolicy.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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
NameDescription
valueString

The maxAge to set.

Returns
TypeDescription
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
NameDescription
valueByteString

The bytes for maxAge to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpRoute.CorsPolicy.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpRoute.CorsPolicy.Builder
Overrides