Class Object.Builder (2.27.1-SNAPSHOT)

public static final class Object.Builder extends GeneratedMessageV3.Builder<Object.Builder> implements ObjectOrBuilder

An object.

Protobuf type google.storage.v2.Object

Implements

ObjectOrBuilder

Static Methods

getDescriptor()

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

Methods

addAcl(ObjectAccessControl value)

public Object.Builder addAcl(ObjectAccessControl value)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
valueObjectAccessControl
Returns
TypeDescription
Object.Builder

addAcl(ObjectAccessControl.Builder builderForValue)

public Object.Builder addAcl(ObjectAccessControl.Builder builderForValue)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
builderForValueObjectAccessControl.Builder
Returns
TypeDescription
Object.Builder

addAcl(int index, ObjectAccessControl value)

public Object.Builder addAcl(int index, ObjectAccessControl value)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameters
NameDescription
indexint
valueObjectAccessControl
Returns
TypeDescription
Object.Builder

addAcl(int index, ObjectAccessControl.Builder builderForValue)

public Object.Builder addAcl(int index, ObjectAccessControl.Builder builderForValue)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameters
NameDescription
indexint
builderForValueObjectAccessControl.Builder
Returns
TypeDescription
Object.Builder

addAclBuilder()

public ObjectAccessControl.Builder addAclBuilder()

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Returns
TypeDescription
ObjectAccessControl.Builder

addAclBuilder(int index)

public ObjectAccessControl.Builder addAclBuilder(int index)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
ObjectAccessControl.Builder

addAllAcl(Iterable<? extends ObjectAccessControl> values)

public Object.Builder addAllAcl(Iterable<? extends ObjectAccessControl> values)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
valuesIterable<? extends com.google.storage.v2.ObjectAccessControl>
Returns
TypeDescription
Object.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public Object build()
Returns
TypeDescription
Object

buildPartial()

public Object buildPartial()
Returns
TypeDescription
Object

clear()

public Object.Builder clear()
Returns
TypeDescription
Object.Builder
Overrides

clearAcl()

public Object.Builder clearAcl()

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Returns
TypeDescription
Object.Builder

clearBucket()

public Object.Builder clearBucket()

Immutable. The name of the bucket containing this object.

string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearCacheControl()

public Object.Builder clearCacheControl()

Cache-Control directive for the object data, matching https://tools.ietf.org/html/rfc7234#section-5.2". If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

string cache_control = 9;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearChecksums()

public Object.Builder clearChecksums()

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

clearComponentCount()

public Object.Builder clearComponentCount()

Output only. Number of underlying components that make up this object. Components are accumulated by compose operations. Attempting to set or update this field will result in a FieldViolation.

int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearContentDisposition()

public Object.Builder clearContentDisposition()

Content-Disposition of the object data, matching https://tools.ietf.org/html/rfc6266.

string content_disposition = 8;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearContentEncoding()

public Object.Builder clearContentEncoding()

Content-Encoding of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.2.2

string content_encoding = 7;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearContentLanguage()

public Object.Builder clearContentLanguage()

Content-Language of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.3.2.

string content_language = 11;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearContentType()

public Object.Builder clearContentType()

Content-Type of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.1.5. If an object is stored without a Content-Type, it is served as application/octet-stream.

string content_type = 13;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearCreateTime()

public Object.Builder clearCreateTime()

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

clearCustomTime()

public Object.Builder clearCustomTime()

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Returns
TypeDescription
Object.Builder

clearCustomerEncryption()

public Object.Builder clearCustomerEncryption()

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Returns
TypeDescription
Object.Builder

clearDeleteTime()

public Object.Builder clearDeleteTime()

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

clearEtag()

public Object.Builder clearEtag()

The etag of the object. If included in the metadata of an update or delete request message, the operation will only be performed if the etag matches that of the live object.

string etag = 27;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearEventBasedHold()

public Object.Builder clearEventBasedHold()

Whether an object is under event-based hold. An event-based hold is a way to force the retention of an object until after some event occurs. Once the hold is released by explicitly setting this field to false, the object will become subject to any bucket-level retention policy, except that the retention duration will be calculated from the time the event based hold was lifted, rather than the time the object was created.

In a WriteObject request, not setting this field implies that the value should be taken from the parent bucket's "default_event_based_hold" field. In a response, this field will always be set to true or false.

optional bool event_based_hold = 23;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Object.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Object.Builder
Overrides

clearGeneration()

public Object.Builder clearGeneration()

Immutable. The content generation of this object. Used for object versioning. Attempting to set or update this field will result in a FieldViolation.

int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearKmsKey()

public Object.Builder clearKmsKey()

Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.

string kms_key = 18 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearMetadata()

public Object.Builder clearMetadata()
Returns
TypeDescription
Object.Builder

clearMetageneration()

public Object.Builder clearMetageneration()

Output only. The version of the metadata for this generation of this object. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. Attempting to set or update this field will result in a FieldViolation.

int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearName()

public Object.Builder clearName()

Immutable. The name of this object. Nearly any sequence of unicode characters is valid. See Guidelines. Example: test.txt The name field by itself does not uniquely identify a Cloud Storage object. A Cloud Storage object is uniquely identified by the tuple of (bucket, object, generation).

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearOwner()

public Object.Builder clearOwner()

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

clearRetentionExpireTime()

public Object.Builder clearRetentionExpireTime()

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Returns
TypeDescription
Object.Builder

clearSize()

public Object.Builder clearSize()

Output only. Content-Length of the object data in bytes, matching https://tools.ietf.org/html/rfc7230#section-3.3.2. Attempting to set or update this field will result in a FieldViolation.

int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearStorageClass()

public Object.Builder clearStorageClass()

Storage class of the object.

string storage_class = 5;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearTemporaryHold()

public Object.Builder clearTemporaryHold()

Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.

bool temporary_hold = 20;

Returns
TypeDescription
Object.Builder

This builder for chaining.

clearUpdateStorageClassTime()

public Object.Builder clearUpdateStorageClassTime()

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

clearUpdateTime()

public Object.Builder clearUpdateTime()

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Object.Builder

clone()

public Object.Builder clone()
Returns
TypeDescription
Object.Builder
Overrides

containsMetadata(String key)

public boolean containsMetadata(String key)

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Parameter
NameDescription
keyString
Returns
TypeDescription
boolean

getAcl(int index)

public ObjectAccessControl getAcl(int index)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
ObjectAccessControl

getAclBuilder(int index)

public ObjectAccessControl.Builder getAclBuilder(int index)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
ObjectAccessControl.Builder

getAclBuilderList()

public List<ObjectAccessControl.Builder> getAclBuilderList()

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Returns
TypeDescription
List<Builder>

getAclCount()

public int getAclCount()

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Returns
TypeDescription
int

getAclList()

public List<ObjectAccessControl> getAclList()

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Returns
TypeDescription
List<ObjectAccessControl>

getAclOrBuilder(int index)

public ObjectAccessControlOrBuilder getAclOrBuilder(int index)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
ObjectAccessControlOrBuilder

getAclOrBuilderList()

public List<? extends ObjectAccessControlOrBuilder> getAclOrBuilderList()

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Returns
TypeDescription
List<? extends com.google.storage.v2.ObjectAccessControlOrBuilder>

getBucket()

public String getBucket()

Immutable. The name of the bucket containing this object.

string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The bucket.

getBucketBytes()

public ByteString getBucketBytes()

Immutable. The name of the bucket containing this object.

string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for bucket.

getCacheControl()

public String getCacheControl()

Cache-Control directive for the object data, matching https://tools.ietf.org/html/rfc7234#section-5.2". If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

string cache_control = 9;

Returns
TypeDescription
String

The cacheControl.

getCacheControlBytes()

public ByteString getCacheControlBytes()

Cache-Control directive for the object data, matching https://tools.ietf.org/html/rfc7234#section-5.2". If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

string cache_control = 9;

Returns
TypeDescription
ByteString

The bytes for cacheControl.

getChecksums()

public ObjectChecksums getChecksums()

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ObjectChecksums

The checksums.

getChecksumsBuilder()

public ObjectChecksums.Builder getChecksumsBuilder()

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ObjectChecksums.Builder

getChecksumsOrBuilder()

public ObjectChecksumsOrBuilder getChecksumsOrBuilder()

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
ObjectChecksumsOrBuilder

getComponentCount()

public int getComponentCount()

Output only. Number of underlying components that make up this object. Components are accumulated by compose operations. Attempting to set or update this field will result in a FieldViolation.

int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
int

The componentCount.

getContentDisposition()

public String getContentDisposition()

Content-Disposition of the object data, matching https://tools.ietf.org/html/rfc6266.

string content_disposition = 8;

Returns
TypeDescription
String

The contentDisposition.

getContentDispositionBytes()

public ByteString getContentDispositionBytes()

Content-Disposition of the object data, matching https://tools.ietf.org/html/rfc6266.

string content_disposition = 8;

Returns
TypeDescription
ByteString

The bytes for contentDisposition.

getContentEncoding()

public String getContentEncoding()

Content-Encoding of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.2.2

string content_encoding = 7;

Returns
TypeDescription
String

The contentEncoding.

getContentEncodingBytes()

public ByteString getContentEncodingBytes()

Content-Encoding of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.2.2

string content_encoding = 7;

Returns
TypeDescription
ByteString

The bytes for contentEncoding.

getContentLanguage()

public String getContentLanguage()

Content-Language of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.3.2.

string content_language = 11;

Returns
TypeDescription
String

The contentLanguage.

getContentLanguageBytes()

public ByteString getContentLanguageBytes()

Content-Language of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.3.2.

string content_language = 11;

Returns
TypeDescription
ByteString

The bytes for contentLanguage.

getContentType()

public String getContentType()

Content-Type of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.1.5. If an object is stored without a Content-Type, it is served as application/octet-stream.

string content_type = 13;

Returns
TypeDescription
String

The contentType.

getContentTypeBytes()

public ByteString getContentTypeBytes()

Content-Type of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.1.5. If an object is stored without a Content-Type, it is served as application/octet-stream.

string content_type = 13;

Returns
TypeDescription
ByteString

The bytes for contentType.

getCreateTime()

public Timestamp getCreateTime()

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The createTime.

getCreateTimeBuilder()

public Timestamp.Builder getCreateTimeBuilder()

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Builder

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getCustomTime()

public Timestamp getCustomTime()

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Returns
TypeDescription
Timestamp

The customTime.

getCustomTimeBuilder()

public Timestamp.Builder getCustomTimeBuilder()

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Returns
TypeDescription
Builder

getCustomTimeOrBuilder()

public TimestampOrBuilder getCustomTimeOrBuilder()

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Returns
TypeDescription
TimestampOrBuilder

getCustomerEncryption()

public CustomerEncryption getCustomerEncryption()

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Returns
TypeDescription
CustomerEncryption

The customerEncryption.

getCustomerEncryptionBuilder()

public CustomerEncryption.Builder getCustomerEncryptionBuilder()

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Returns
TypeDescription
CustomerEncryption.Builder

getCustomerEncryptionOrBuilder()

public CustomerEncryptionOrBuilder getCustomerEncryptionOrBuilder()

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Returns
TypeDescription
CustomerEncryptionOrBuilder

getDefaultInstanceForType()

public Object getDefaultInstanceForType()
Returns
TypeDescription
Object

getDeleteTime()

public Timestamp getDeleteTime()

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The deleteTime.

getDeleteTimeBuilder()

public Timestamp.Builder getDeleteTimeBuilder()

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Builder

getDeleteTimeOrBuilder()

public TimestampOrBuilder getDeleteTimeOrBuilder()

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getEtag()

public String getEtag()

The etag of the object. If included in the metadata of an update or delete request message, the operation will only be performed if the etag matches that of the live object.

string etag = 27;

Returns
TypeDescription
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

The etag of the object. If included in the metadata of an update or delete request message, the operation will only be performed if the etag matches that of the live object.

string etag = 27;

Returns
TypeDescription
ByteString

The bytes for etag.

getEventBasedHold()

public boolean getEventBasedHold()

Whether an object is under event-based hold. An event-based hold is a way to force the retention of an object until after some event occurs. Once the hold is released by explicitly setting this field to false, the object will become subject to any bucket-level retention policy, except that the retention duration will be calculated from the time the event based hold was lifted, rather than the time the object was created.

In a WriteObject request, not setting this field implies that the value should be taken from the parent bucket's "default_event_based_hold" field. In a response, this field will always be set to true or false.

optional bool event_based_hold = 23;

Returns
TypeDescription
boolean

The eventBasedHold.

getGeneration()

public long getGeneration()

Immutable. The content generation of this object. Used for object versioning. Attempting to set or update this field will result in a FieldViolation.

int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
long

The generation.

getKmsKey()

public String getKmsKey()

Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.

string kms_key = 18 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
String

The kmsKey.

getKmsKeyBytes()

public ByteString getKmsKeyBytes()

Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.

string kms_key = 18 [(.google.api.resource_reference) = { ... }

Returns
TypeDescription
ByteString

The bytes for kmsKey.

getMetadata()

public Map<String,String> getMetadata()

Use #getMetadataMap() instead.

Returns
TypeDescription
Map<String,String>

getMetadataCount()

public int getMetadataCount()

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Returns
TypeDescription
int

getMetadataMap()

public Map<String,String> getMetadataMap()

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Returns
TypeDescription
Map<String,String>

getMetadataOrDefault(String key, String defaultValue)

public String getMetadataOrDefault(String key, String defaultValue)

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Parameters
NameDescription
keyString
defaultValueString
Returns
TypeDescription
String

getMetadataOrThrow(String key)

public String getMetadataOrThrow(String key)

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Parameter
NameDescription
keyString
Returns
TypeDescription
String

getMetageneration()

public long getMetageneration()

Output only. The version of the metadata for this generation of this object. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. Attempting to set or update this field will result in a FieldViolation.

int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
long

The metageneration.

getMutableMetadata()

public Map<String,String> getMutableMetadata()

Use alternate mutation accessors instead.

Returns
TypeDescription
Map<String,String>

getName()

public String getName()

Immutable. The name of this object. Nearly any sequence of unicode characters is valid. See Guidelines. Example: test.txt The name field by itself does not uniquely identify a Cloud Storage object. A Cloud Storage object is uniquely identified by the tuple of (bucket, object, generation).

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Immutable. The name of this object. Nearly any sequence of unicode characters is valid. See Guidelines. Example: test.txt The name field by itself does not uniquely identify a Cloud Storage object. A Cloud Storage object is uniquely identified by the tuple of (bucket, object, generation).

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Returns
TypeDescription
ByteString

The bytes for name.

getOwner()

public Owner getOwner()

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Owner

The owner.

getOwnerBuilder()

public Owner.Builder getOwnerBuilder()

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Owner.Builder

getOwnerOrBuilder()

public OwnerOrBuilder getOwnerOrBuilder()

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
OwnerOrBuilder

getRetentionExpireTime()

public Timestamp getRetentionExpireTime()

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Returns
TypeDescription
Timestamp

The retentionExpireTime.

getRetentionExpireTimeBuilder()

public Timestamp.Builder getRetentionExpireTimeBuilder()

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Returns
TypeDescription
Builder

getRetentionExpireTimeOrBuilder()

public TimestampOrBuilder getRetentionExpireTimeOrBuilder()

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Returns
TypeDescription
TimestampOrBuilder

getSize()

public long getSize()

Output only. Content-Length of the object data in bytes, matching https://tools.ietf.org/html/rfc7230#section-3.3.2. Attempting to set or update this field will result in a FieldViolation.

int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
long

The size.

getStorageClass()

public String getStorageClass()

Storage class of the object.

string storage_class = 5;

Returns
TypeDescription
String

The storageClass.

getStorageClassBytes()

public ByteString getStorageClassBytes()

Storage class of the object.

string storage_class = 5;

Returns
TypeDescription
ByteString

The bytes for storageClass.

getTemporaryHold()

public boolean getTemporaryHold()

Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.

bool temporary_hold = 20;

Returns
TypeDescription
boolean

The temporaryHold.

getUpdateStorageClassTime()

public Timestamp getUpdateStorageClassTime()

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The updateStorageClassTime.

getUpdateStorageClassTimeBuilder()

public Timestamp.Builder getUpdateStorageClassTimeBuilder()

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Builder

getUpdateStorageClassTimeOrBuilder()

public TimestampOrBuilder getUpdateStorageClassTimeOrBuilder()

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

getUpdateTime()

public Timestamp getUpdateTime()

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Timestamp

The updateTime.

getUpdateTimeBuilder()

public Timestamp.Builder getUpdateTimeBuilder()

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
Builder

getUpdateTimeOrBuilder()

public TimestampOrBuilder getUpdateTimeOrBuilder()

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
TimestampOrBuilder

hasChecksums()

public boolean hasChecksums()

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the checksums field is set.

hasCreateTime()

public boolean hasCreateTime()

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the createTime field is set.

hasCustomTime()

public boolean hasCustomTime()

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Returns
TypeDescription
boolean

Whether the customTime field is set.

hasCustomerEncryption()

public boolean hasCustomerEncryption()

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Returns
TypeDescription
boolean

Whether the customerEncryption field is set.

hasDeleteTime()

public boolean hasDeleteTime()

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the deleteTime field is set.

hasEventBasedHold()

public boolean hasEventBasedHold()

Whether an object is under event-based hold. An event-based hold is a way to force the retention of an object until after some event occurs. Once the hold is released by explicitly setting this field to false, the object will become subject to any bucket-level retention policy, except that the retention duration will be calculated from the time the event based hold was lifted, rather than the time the object was created.

In a WriteObject request, not setting this field implies that the value should be taken from the parent bucket's "default_event_based_hold" field. In a response, this field will always be set to true or false.

optional bool event_based_hold = 23;

Returns
TypeDescription
boolean

Whether the eventBasedHold field is set.

hasOwner()

public boolean hasOwner()

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the owner field is set.

hasRetentionExpireTime()

public boolean hasRetentionExpireTime()

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Returns
TypeDescription
boolean

Whether the retentionExpireTime field is set.

hasUpdateStorageClassTime()

public boolean hasUpdateStorageClassTime()

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the updateStorageClassTime field is set.

hasUpdateTime()

public boolean hasUpdateTime()

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
TypeDescription
boolean

Whether the updateTime field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

internalGetMapField(int number)

protected MapField internalGetMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

internalGetMutableMapField(int number)

protected MapField internalGetMutableMapField(int number)
Parameter
NameDescription
numberint
Returns
TypeDescription
MapField
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeChecksums(ObjectChecksums value)

public Object.Builder mergeChecksums(ObjectChecksums value)

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueObjectChecksums
Returns
TypeDescription
Object.Builder

mergeCreateTime(Timestamp value)

public Object.Builder mergeCreateTime(Timestamp value)

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

mergeCustomTime(Timestamp value)

public Object.Builder mergeCustomTime(Timestamp value)

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

mergeCustomerEncryption(CustomerEncryption value)

public Object.Builder mergeCustomerEncryption(CustomerEncryption value)

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Parameter
NameDescription
valueCustomerEncryption
Returns
TypeDescription
Object.Builder

mergeDeleteTime(Timestamp value)

public Object.Builder mergeDeleteTime(Timestamp value)

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(Object other)

public Object.Builder mergeFrom(Object other)
Parameter
NameDescription
otherObject
Returns
TypeDescription
Object.Builder

mergeOwner(Owner value)

public Object.Builder mergeOwner(Owner value)

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueOwner
Returns
TypeDescription
Object.Builder

mergeRetentionExpireTime(Timestamp value)

public Object.Builder mergeRetentionExpireTime(Timestamp value)

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

mergeUpdateStorageClassTime(Timestamp value)

public Object.Builder mergeUpdateStorageClassTime(Timestamp value)

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

mergeUpdateTime(Timestamp value)

public Object.Builder mergeUpdateTime(Timestamp value)

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

putAllMetadata(Map<String,String> values)

public Object.Builder putAllMetadata(Map<String,String> values)

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Parameter
NameDescription
valuesMap<String,String>
Returns
TypeDescription
Object.Builder

putMetadata(String key, String value)

public Object.Builder putMetadata(String key, String value)

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Parameters
NameDescription
keyString
valueString
Returns
TypeDescription
Object.Builder

removeAcl(int index)

public Object.Builder removeAcl(int index)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameter
NameDescription
indexint
Returns
TypeDescription
Object.Builder

removeMetadata(String key)

public Object.Builder removeMetadata(String key)

User-provided metadata, in key/value pairs.

map<string, string> metadata = 22;

Parameter
NameDescription
keyString
Returns
TypeDescription
Object.Builder

setAcl(int index, ObjectAccessControl value)

public Object.Builder setAcl(int index, ObjectAccessControl value)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameters
NameDescription
indexint
valueObjectAccessControl
Returns
TypeDescription
Object.Builder

setAcl(int index, ObjectAccessControl.Builder builderForValue)

public Object.Builder setAcl(int index, ObjectAccessControl.Builder builderForValue)

Access controls on the object. If iam_config.uniform_bucket_level_access is enabled on the parent bucket, requests to set, read, or modify acl is an error.

repeated .google.storage.v2.ObjectAccessControl acl = 10;

Parameters
NameDescription
indexint
builderForValueObjectAccessControl.Builder
Returns
TypeDescription
Object.Builder

setBucket(String value)

public Object.Builder setBucket(String value)

Immutable. The name of the bucket containing this object.

string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The bucket to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setBucketBytes(ByteString value)

public Object.Builder setBucketBytes(ByteString value)

Immutable. The name of the bucket containing this object.

string bucket = 2 [(.google.api.field_behavior) = IMMUTABLE, (.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for bucket to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setCacheControl(String value)

public Object.Builder setCacheControl(String value)

Cache-Control directive for the object data, matching https://tools.ietf.org/html/rfc7234#section-5.2". If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

string cache_control = 9;

Parameter
NameDescription
valueString

The cacheControl to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setCacheControlBytes(ByteString value)

public Object.Builder setCacheControlBytes(ByteString value)

Cache-Control directive for the object data, matching https://tools.ietf.org/html/rfc7234#section-5.2". If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600.

string cache_control = 9;

Parameter
NameDescription
valueByteString

The bytes for cacheControl to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setChecksums(ObjectChecksums value)

public Object.Builder setChecksums(ObjectChecksums value)

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueObjectChecksums
Returns
TypeDescription
Object.Builder

setChecksums(ObjectChecksums.Builder builderForValue)

public Object.Builder setChecksums(ObjectChecksums.Builder builderForValue)

Output only. Hashes for the data part of this object. This field is used for output only and will be silently ignored if provided in requests.

.google.storage.v2.ObjectChecksums checksums = 16 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueObjectChecksums.Builder
Returns
TypeDescription
Object.Builder

setComponentCount(int value)

public Object.Builder setComponentCount(int value)

Output only. Number of underlying components that make up this object. Components are accumulated by compose operations. Attempting to set or update this field will result in a FieldViolation.

int32 component_count = 15 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueint

The componentCount to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentDisposition(String value)

public Object.Builder setContentDisposition(String value)

Content-Disposition of the object data, matching https://tools.ietf.org/html/rfc6266.

string content_disposition = 8;

Parameter
NameDescription
valueString

The contentDisposition to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentDispositionBytes(ByteString value)

public Object.Builder setContentDispositionBytes(ByteString value)

Content-Disposition of the object data, matching https://tools.ietf.org/html/rfc6266.

string content_disposition = 8;

Parameter
NameDescription
valueByteString

The bytes for contentDisposition to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentEncoding(String value)

public Object.Builder setContentEncoding(String value)

Content-Encoding of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.2.2

string content_encoding = 7;

Parameter
NameDescription
valueString

The contentEncoding to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentEncodingBytes(ByteString value)

public Object.Builder setContentEncodingBytes(ByteString value)

Content-Encoding of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.2.2

string content_encoding = 7;

Parameter
NameDescription
valueByteString

The bytes for contentEncoding to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentLanguage(String value)

public Object.Builder setContentLanguage(String value)

Content-Language of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.3.2.

string content_language = 11;

Parameter
NameDescription
valueString

The contentLanguage to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentLanguageBytes(ByteString value)

public Object.Builder setContentLanguageBytes(ByteString value)

Content-Language of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.3.2.

string content_language = 11;

Parameter
NameDescription
valueByteString

The bytes for contentLanguage to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentType(String value)

public Object.Builder setContentType(String value)

Content-Type of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.1.5. If an object is stored without a Content-Type, it is served as application/octet-stream.

string content_type = 13;

Parameter
NameDescription
valueString

The contentType to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setContentTypeBytes(ByteString value)

public Object.Builder setContentTypeBytes(ByteString value)

Content-Type of the object data, matching https://tools.ietf.org/html/rfc7231#section-3.1.1.5. If an object is stored without a Content-Type, it is served as application/octet-stream.

string content_type = 13;

Parameter
NameDescription
valueByteString

The bytes for contentType to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setCreateTime(Timestamp value)

public Object.Builder setCreateTime(Timestamp value)

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

setCreateTime(Timestamp.Builder builderForValue)

public Object.Builder setCreateTime(Timestamp.Builder builderForValue)

Output only. The creation time of the object. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp create_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Object.Builder

setCustomTime(Timestamp value)

public Object.Builder setCustomTime(Timestamp value)

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

setCustomTime(Timestamp.Builder builderForValue)

public Object.Builder setCustomTime(Timestamp.Builder builderForValue)

A user-specified timestamp set on an object.

.google.protobuf.Timestamp custom_time = 26;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Object.Builder

setCustomerEncryption(CustomerEncryption value)

public Object.Builder setCustomerEncryption(CustomerEncryption value)

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Parameter
NameDescription
valueCustomerEncryption
Returns
TypeDescription
Object.Builder

setCustomerEncryption(CustomerEncryption.Builder builderForValue)

public Object.Builder setCustomerEncryption(CustomerEncryption.Builder builderForValue)

Metadata of Customer-Supplied Encryption Key, if the object is encrypted by such a key.

.google.storage.v2.CustomerEncryption customer_encryption = 25;

Parameter
NameDescription
builderForValueCustomerEncryption.Builder
Returns
TypeDescription
Object.Builder

setDeleteTime(Timestamp value)

public Object.Builder setDeleteTime(Timestamp value)

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

setDeleteTime(Timestamp.Builder builderForValue)

public Object.Builder setDeleteTime(Timestamp.Builder builderForValue)

Output only. If this object is noncurrent, this is the time when the object became noncurrent. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp delete_time = 12 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Object.Builder

setEtag(String value)

public Object.Builder setEtag(String value)

The etag of the object. If included in the metadata of an update or delete request message, the operation will only be performed if the etag matches that of the live object.

string etag = 27;

Parameter
NameDescription
valueString

The etag to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setEtagBytes(ByteString value)

public Object.Builder setEtagBytes(ByteString value)

The etag of the object. If included in the metadata of an update or delete request message, the operation will only be performed if the etag matches that of the live object.

string etag = 27;

Parameter
NameDescription
valueByteString

The bytes for etag to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setEventBasedHold(boolean value)

public Object.Builder setEventBasedHold(boolean value)

Whether an object is under event-based hold. An event-based hold is a way to force the retention of an object until after some event occurs. Once the hold is released by explicitly setting this field to false, the object will become subject to any bucket-level retention policy, except that the retention duration will be calculated from the time the event based hold was lifted, rather than the time the object was created.

In a WriteObject request, not setting this field implies that the value should be taken from the parent bucket's "default_event_based_hold" field. In a response, this field will always be set to true or false.

optional bool event_based_hold = 23;

Parameter
NameDescription
valueboolean

The eventBasedHold to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

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

setGeneration(long value)

public Object.Builder setGeneration(long value)

Immutable. The content generation of this object. Used for object versioning. Attempting to set or update this field will result in a FieldViolation.

int64 generation = 3 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valuelong

The generation to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setKmsKey(String value)

public Object.Builder setKmsKey(String value)

Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.

string kms_key = 18 [(.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueString

The kmsKey to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setKmsKeyBytes(ByteString value)

public Object.Builder setKmsKeyBytes(ByteString value)

Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.

string kms_key = 18 [(.google.api.resource_reference) = { ... }

Parameter
NameDescription
valueByteString

The bytes for kmsKey to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setMetageneration(long value)

public Object.Builder setMetageneration(long value)

Output only. The version of the metadata for this generation of this object. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. Attempting to set or update this field will result in a FieldViolation.

int64 metageneration = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valuelong

The metageneration to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setName(String value)

public Object.Builder setName(String value)

Immutable. The name of this object. Nearly any sequence of unicode characters is valid. See Guidelines. Example: test.txt The name field by itself does not uniquely identify a Cloud Storage object. A Cloud Storage object is uniquely identified by the tuple of (bucket, object, generation).

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Object.Builder setNameBytes(ByteString value)

Immutable. The name of this object. Nearly any sequence of unicode characters is valid. See Guidelines. Example: test.txt The name field by itself does not uniquely identify a Cloud Storage object. A Cloud Storage object is uniquely identified by the tuple of (bucket, object, generation).

string name = 1 [(.google.api.field_behavior) = IMMUTABLE];

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setOwner(Owner value)

public Object.Builder setOwner(Owner value)

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueOwner
Returns
TypeDescription
Object.Builder

setOwner(Owner.Builder builderForValue)

public Object.Builder setOwner(Owner.Builder builderForValue)

Output only. The owner of the object. This will always be the uploader of the object. Attempting to set or update this field will result in a FieldViolation.

.google.storage.v2.Owner owner = 24 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueOwner.Builder
Returns
TypeDescription
Object.Builder

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

public Object.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Object.Builder
Overrides

setRetentionExpireTime(Timestamp value)

public Object.Builder setRetentionExpireTime(Timestamp value)

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

setRetentionExpireTime(Timestamp.Builder builderForValue)

public Object.Builder setRetentionExpireTime(Timestamp.Builder builderForValue)

A server-determined value that specifies the earliest time that the object's retention period expires. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).

.google.protobuf.Timestamp retention_expire_time = 21;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Object.Builder

setSize(long value)

public Object.Builder setSize(long value)

Output only. Content-Length of the object data in bytes, matching https://tools.ietf.org/html/rfc7230#section-3.3.2. Attempting to set or update this field will result in a FieldViolation.

int64 size = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valuelong

The size to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setStorageClass(String value)

public Object.Builder setStorageClass(String value)

Storage class of the object.

string storage_class = 5;

Parameter
NameDescription
valueString

The storageClass to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setStorageClassBytes(ByteString value)

public Object.Builder setStorageClassBytes(ByteString value)

Storage class of the object.

string storage_class = 5;

Parameter
NameDescription
valueByteString

The bytes for storageClass to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setTemporaryHold(boolean value)

public Object.Builder setTemporaryHold(boolean value)

Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.

bool temporary_hold = 20;

Parameter
NameDescription
valueboolean

The temporaryHold to set.

Returns
TypeDescription
Object.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

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

setUpdateStorageClassTime(Timestamp value)

public Object.Builder setUpdateStorageClassTime(Timestamp value)

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

setUpdateStorageClassTime(Timestamp.Builder builderForValue)

public Object.Builder setUpdateStorageClassTime(Timestamp.Builder builderForValue)

Output only. The time at which the object's storage class was last changed. When the object is initially created, it will be set to time_created. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_storage_class_time = 19 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Object.Builder

setUpdateTime(Timestamp value)

public Object.Builder setUpdateTime(Timestamp value)

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
valueTimestamp
Returns
TypeDescription
Object.Builder

setUpdateTime(Timestamp.Builder builderForValue)

public Object.Builder setUpdateTime(Timestamp.Builder builderForValue)

Output only. The modification time of the object metadata. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration. Attempting to set or update this field will result in a FieldViolation.

.google.protobuf.Timestamp update_time = 17 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
Object.Builder