Class Bucket.Cors.Builder (2.22.3)

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

The method to add.

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

The origin to add.

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

The responseHeader to add.

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

The method to add.

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

The bytes of the method to add.

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

The origin to add.

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

The bytes of the origin to add.

Returns
TypeDescription
Bucket.Cors.Builder

This builder for chaining.

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

The responseHeader to add.

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

The bytes of the responseHeader to add.

Returns
TypeDescription
Bucket.Cors.Builder

This builder for chaining.

build()

public Bucket.Cors build()
Returns
TypeDescription
Bucket.Cors

buildPartial()

public Bucket.Cors buildPartial()
Returns
TypeDescription
Bucket.Cors

clear()

public Bucket.Cors.Builder clear()
Returns
TypeDescription
Bucket.Cors.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

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

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Bucket.Cors.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
Bucket.Cors.Builder

This builder for chaining.

clone()

public Bucket.Cors.Builder clone()
Returns
TypeDescription
Bucket.Cors.Builder
Overrides

getDefaultInstanceForType()

public Bucket.Cors getDefaultInstanceForType()
Returns
TypeDescription
Bucket.Cors

getDescriptorForType()

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

The index of the element to return.

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

The index of the value to return.

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

The index of the element to return.

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

The index of the value to return.

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

The index of the element to return.

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

The index of the value to return.

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

A list containing the responseHeader.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

public Bucket.Cors.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Bucket.Cors.Builder
Overrides

mergeFrom(Bucket.Cors other)

public Bucket.Cors.Builder mergeFrom(Bucket.Cors other)
Parameter
NameDescription
otherBucket.Cors
Returns
TypeDescription
Bucket.Cors.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Bucket.Cors.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Bucket.Cors.Builder
Overrides

setField(Descriptors.FieldDescriptor field, Object value)

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

The maxAgeSeconds to set.

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

The index to set the value at.

valueString

The method to set.

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

The index to set the value at.

valueString

The origin to set.

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

The index to set the value at.

valueString

The responseHeader to set.

Returns
TypeDescription
Bucket.Cors.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final Bucket.Cors.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Bucket.Cors.Builder
Overrides