Class Bucket.Cors (2.22.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
TypeDescription
int

METHOD_FIELD_NUMBER

public static final int METHOD_FIELD_NUMBER
Field Value
TypeDescription
int

ORIGIN_FIELD_NUMBER

public static final int ORIGIN_FIELD_NUMBER
Field Value
TypeDescription
int

RESPONSE_HEADER_FIELD_NUMBER

public static final int RESPONSE_HEADER_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Bucket.Cors getDefaultInstance()
Returns
TypeDescription
Bucket.Cors

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Bucket.Cors.Builder newBuilder()
Returns
TypeDescription
Bucket.Cors.Builder

newBuilder(Bucket.Cors prototype)

public static Bucket.Cors.Builder newBuilder(Bucket.Cors prototype)
Parameter
NameDescription
prototypeBucket.Cors
Returns
TypeDescription
Bucket.Cors.Builder

parseDelimitedFrom(InputStream input)

public static Bucket.Cors parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Bucket.Cors parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Bucket.Cors parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Bucket.Cors parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Bucket.Cors parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Bucket.Cors parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Bucket.Cors parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Bucket.Cors
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Bucket.Cors getDefaultInstanceForType()
Returns
TypeDescription
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
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.

getParserForType()

public Parser<Bucket.Cors> getParserForType()
Returns
TypeDescription
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
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.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Bucket.Cors.Builder newBuilderForType()
Returns
TypeDescription
Bucket.Cors.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Bucket.Cors.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Bucket.Cors.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Bucket.Cors.Builder toBuilder()
Returns
TypeDescription
Bucket.Cors.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException