Class Bucket.Cors (2.14.0)

public static final class Bucket.Cors extends GeneratedMessageV3 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 Fields

MAX_AGE_SECONDS_FIELD_NUMBER

public static final int MAX_AGE_SECONDS_FIELD_NUMBER
Field Value
Type Description
int

METHOD_FIELD_NUMBER

public static final int METHOD_FIELD_NUMBER
Field Value
Type Description
int

ORIGIN_FIELD_NUMBER

public static final int ORIGIN_FIELD_NUMBER
Field Value
Type Description
int

RESPONSE_HEADER_FIELD_NUMBER

public static final int RESPONSE_HEADER_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Bucket.Cors getDefaultInstance()
Returns
Type Description
Bucket.Cors

getDescriptor()

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

newBuilder()

public static Bucket.Cors.Builder newBuilder()
Returns
Type Description
Bucket.Cors.Builder

newBuilder(Bucket.Cors prototype)

public static Bucket.Cors.Builder newBuilder(Bucket.Cors prototype)
Parameter
Name Description
prototype Bucket.Cors
Returns
Type Description
Bucket.Cors.Builder

parseDelimitedFrom(InputStream input)

public static Bucket.Cors parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Bucket.Cors parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Bucket.Cors parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Bucket.Cors parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Bucket.Cors parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Bucket.Cors parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Bucket.Cors
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Bucket.Cors> parser()
Returns
Type Description
Parser<Cors>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

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

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.

getParserForType()

public Parser<Bucket.Cors> getParserForType()
Returns
Type Description
Parser<Cors>
Overrides

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.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
Type Description
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Bucket.Cors.Builder newBuilderForType()
Returns
Type Description
Bucket.Cors.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Bucket.Cors.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Bucket.Cors.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Bucket.Cors.Builder toBuilder()
Returns
Type Description
Bucket.Cors.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides Exceptions
Type Description
IOException