Class Bucket.Cors.Builder (2.28.0)

public static final class Bucket.Cors.Builder extends GeneratedMessageV3.Builder<Bucket.Cors.Builder> implements Bucket.CorsOrBuilder

Cross-Origin Response sharing (CORS) properties for a bucket. For more on Cloud Storage and CORS, see https://cloud.google.com/storage/docs/cross-origin. For more on CORS in general, see https://tools.ietf.org/html/rfc6454.

Protobuf type google.storage.v2.Bucket.Cors

Static Methods

getDescriptor()

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

Methods

addAllMethod(Iterable<String> values)

public Bucket.Cors.Builder addAllMethod(Iterable<String> values)

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Parameter
Name Description
values Iterable<String>

The method to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addAllOrigin(Iterable<String> values)

public Bucket.Cors.Builder addAllOrigin(Iterable<String> values)

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Parameter
Name Description
values Iterable<String>

The origin to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addAllResponseHeader(Iterable<String> values)

public Bucket.Cors.Builder addAllResponseHeader(Iterable<String> values)

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Parameter
Name Description
values Iterable<String>

The responseHeader to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addMethod(String value)

public Bucket.Cors.Builder addMethod(String value)

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Parameter
Name Description
value String

The method to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addMethodBytes(ByteString value)

public Bucket.Cors.Builder addMethodBytes(ByteString value)

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Parameter
Name Description
value ByteString

The bytes of the method to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addOrigin(String value)

public Bucket.Cors.Builder addOrigin(String value)

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Parameter
Name Description
value String

The origin to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addOriginBytes(ByteString value)

public Bucket.Cors.Builder addOriginBytes(ByteString value)

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Parameter
Name Description
value ByteString

The bytes of the origin to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

addResponseHeader(String value)

public Bucket.Cors.Builder addResponseHeader(String value)

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Parameter
Name Description
value String

The responseHeader to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

addResponseHeaderBytes(ByteString value)

public Bucket.Cors.Builder addResponseHeaderBytes(ByteString value)

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Parameter
Name Description
value ByteString

The bytes of the responseHeader to add.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

build()

public Bucket.Cors build()
Returns
Type Description
Bucket.Cors

buildPartial()

public Bucket.Cors buildPartial()
Returns
Type Description
Bucket.Cors

clear()

public Bucket.Cors.Builder clear()
Returns
Type Description
Bucket.Cors.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Bucket.Cors.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Bucket.Cors.Builder
Overrides

clearMaxAgeSeconds()

public Bucket.Cors.Builder clearMaxAgeSeconds()

The value, in seconds, to return in the https://www.w3.org/TR/cors/#access-control-max-age-response-header used in preflight responses.

int32 max_age_seconds = 4;

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

clearMethod()

public Bucket.Cors.Builder clearMethod()

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Bucket.Cors.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Bucket.Cors.Builder
Overrides

clearOrigin()

public Bucket.Cors.Builder clearOrigin()

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

clearResponseHeader()

public Bucket.Cors.Builder clearResponseHeader()

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

clone()

public Bucket.Cors.Builder clone()
Returns
Type Description
Bucket.Cors.Builder
Overrides

getDefaultInstanceForType()

public Bucket.Cors getDefaultInstanceForType()
Returns
Type Description
Bucket.Cors

getDescriptorForType()

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

getMaxAgeSeconds()

public int getMaxAgeSeconds()

The value, in seconds, to return in the https://www.w3.org/TR/cors/#access-control-max-age-response-header used in preflight responses.

int32 max_age_seconds = 4;

Returns
Type Description
int

The maxAgeSeconds.

getMethod(int index)

public String getMethod(int index)

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The method at the given index.

getMethodBytes(int index)

public ByteString getMethodBytes(int index)

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the method at the given index.

getMethodCount()

public int getMethodCount()

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Returns
Type Description
int

The count of method.

getMethodList()

public ProtocolStringList getMethodList()

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Returns
Type Description
ProtocolStringList

A list containing the method.

getOrigin(int index)

public String getOrigin(int index)

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The origin at the given index.

getOriginBytes(int index)

public ByteString getOriginBytes(int index)

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the origin at the given index.

getOriginCount()

public int getOriginCount()

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Returns
Type Description
int

The count of origin.

getOriginList()

public ProtocolStringList getOriginList()

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Returns
Type Description
ProtocolStringList

A list containing the origin.

getResponseHeader(int index)

public String getResponseHeader(int index)

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
String

The responseHeader at the given index.

getResponseHeaderBytes(int index)

public ByteString getResponseHeaderBytes(int index)

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
ByteString

The bytes of the responseHeader at the given index.

getResponseHeaderCount()

public int getResponseHeaderCount()

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Returns
Type Description
int

The count of responseHeader.

getResponseHeaderList()

public ProtocolStringList getResponseHeaderList()

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Returns
Type Description
ProtocolStringList

A list containing the responseHeader.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Bucket.Cors.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Bucket.Cors.Builder
Overrides

mergeFrom(Bucket.Cors other)

public Bucket.Cors.Builder mergeFrom(Bucket.Cors other)
Parameter
Name Description
other Bucket.Cors
Returns
Type Description
Bucket.Cors.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Bucket.Cors.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Bucket.Cors.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

setMaxAgeSeconds(int value)

public Bucket.Cors.Builder setMaxAgeSeconds(int value)

The value, in seconds, to return in the https://www.w3.org/TR/cors/#access-control-max-age-response-header used in preflight responses.

int32 max_age_seconds = 4;

Parameter
Name Description
value int

The maxAgeSeconds to set.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

setMethod(int index, String value)

public Bucket.Cors.Builder setMethod(int index, String value)

The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method".

repeated string method = 2;

Parameters
Name Description
index int

The index to set the value at.

value String

The method to set.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

setOrigin(int index, String value)

public Bucket.Cors.Builder setOrigin(int index, String value)

The list of Origins eligible to receive CORS response headers. See https://tools.ietf.org/html/rfc6454 for more on origins. Note: "*" is permitted in the list of origins, and means "any Origin".

repeated string origin = 1;

Parameters
Name Description
index int

The index to set the value at.

value String

The origin to set.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

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

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

setResponseHeader(int index, String value)

public Bucket.Cors.Builder setResponseHeader(int index, String value)

The list of HTTP headers other than the https://www.w3.org/TR/cors/#simple-response-header to give permission for the user-agent to share across domains.

repeated string response_header = 3;

Parameters
Name Description
index int

The index to set the value at.

value String

The responseHeader to set.

Returns
Type Description
Bucket.Cors.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Bucket.Cors.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Bucket.Cors.Builder
Overrides