Class WriteObjectSpec.Builder (2.45.0)

public static final class WriteObjectSpec.Builder extends GeneratedMessageV3.Builder<WriteObjectSpec.Builder> implements WriteObjectSpecOrBuilder

Describes an attempt to insert an object, possibly over multiple requests.

Protobuf type google.storage.v2.WriteObjectSpec

Static Methods

getDescriptor()

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

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public WriteObjectSpec build()
Returns
Type Description
WriteObjectSpec

buildPartial()

public WriteObjectSpec buildPartial()
Returns
Type Description
WriteObjectSpec

clear()

public WriteObjectSpec.Builder clear()
Returns
Type Description
WriteObjectSpec.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

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

clearIfGenerationMatch()

public WriteObjectSpec.Builder clearIfGenerationMatch()

Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

optional int64 if_generation_match = 3;

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

clearIfGenerationNotMatch()

public WriteObjectSpec.Builder clearIfGenerationNotMatch()

Makes the operation conditional on whether the object's live generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

optional int64 if_generation_not_match = 4;

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

clearIfMetagenerationMatch()

public WriteObjectSpec.Builder clearIfMetagenerationMatch()

Makes the operation conditional on whether the object's current metageneration matches the given value.

optional int64 if_metageneration_match = 5;

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

clearIfMetagenerationNotMatch()

public WriteObjectSpec.Builder clearIfMetagenerationNotMatch()

Makes the operation conditional on whether the object's current metageneration does not match the given value.

optional int64 if_metageneration_not_match = 6;

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

clearObjectSize()

public WriteObjectSpec.Builder clearObjectSize()

The expected final object size being uploaded. If this value is set, closing the stream after writing fewer or more than object_size bytes will result in an OUT_OF_RANGE error.

This situation is considered a client error, and if such an error occurs you must start the upload over from scratch, this time sending the correct number of bytes.

optional int64 object_size = 8;

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clearPredefinedAcl()

public WriteObjectSpec.Builder clearPredefinedAcl()

Apply a predefined set of access controls to this object. Valid values are "authenticatedRead", "bucketOwnerFullControl", "bucketOwnerRead", "private", "projectPrivate", or "publicRead".

string predefined_acl = 7;

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

clearResource()

public WriteObjectSpec.Builder clearResource()

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
WriteObjectSpec.Builder

clone()

public WriteObjectSpec.Builder clone()
Returns
Type Description
WriteObjectSpec.Builder
Overrides

getDefaultInstanceForType()

public WriteObjectSpec getDefaultInstanceForType()
Returns
Type Description
WriteObjectSpec

getDescriptorForType()

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

getIfGenerationMatch()

public long getIfGenerationMatch()

Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

optional int64 if_generation_match = 3;

Returns
Type Description
long

The ifGenerationMatch.

getIfGenerationNotMatch()

public long getIfGenerationNotMatch()

Makes the operation conditional on whether the object's live generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

optional int64 if_generation_not_match = 4;

Returns
Type Description
long

The ifGenerationNotMatch.

getIfMetagenerationMatch()

public long getIfMetagenerationMatch()

Makes the operation conditional on whether the object's current metageneration matches the given value.

optional int64 if_metageneration_match = 5;

Returns
Type Description
long

The ifMetagenerationMatch.

getIfMetagenerationNotMatch()

public long getIfMetagenerationNotMatch()

Makes the operation conditional on whether the object's current metageneration does not match the given value.

optional int64 if_metageneration_not_match = 6;

Returns
Type Description
long

The ifMetagenerationNotMatch.

getObjectSize()

public long getObjectSize()

The expected final object size being uploaded. If this value is set, closing the stream after writing fewer or more than object_size bytes will result in an OUT_OF_RANGE error.

This situation is considered a client error, and if such an error occurs you must start the upload over from scratch, this time sending the correct number of bytes.

optional int64 object_size = 8;

Returns
Type Description
long

The objectSize.

getPredefinedAcl()

public String getPredefinedAcl()

Apply a predefined set of access controls to this object. Valid values are "authenticatedRead", "bucketOwnerFullControl", "bucketOwnerRead", "private", "projectPrivate", or "publicRead".

string predefined_acl = 7;

Returns
Type Description
String

The predefinedAcl.

getPredefinedAclBytes()

public ByteString getPredefinedAclBytes()

Apply a predefined set of access controls to this object. Valid values are "authenticatedRead", "bucketOwnerFullControl", "bucketOwnerRead", "private", "projectPrivate", or "publicRead".

string predefined_acl = 7;

Returns
Type Description
ByteString

The bytes for predefinedAcl.

getResource()

public Object getResource()

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Object

The resource.

getResourceBuilder()

public Object.Builder getResourceBuilder()

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
Object.Builder

getResourceOrBuilder()

public ObjectOrBuilder getResourceOrBuilder()

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ObjectOrBuilder

hasIfGenerationMatch()

public boolean hasIfGenerationMatch()

Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

optional int64 if_generation_match = 3;

Returns
Type Description
boolean

Whether the ifGenerationMatch field is set.

hasIfGenerationNotMatch()

public boolean hasIfGenerationNotMatch()

Makes the operation conditional on whether the object's live generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

optional int64 if_generation_not_match = 4;

Returns
Type Description
boolean

Whether the ifGenerationNotMatch field is set.

hasIfMetagenerationMatch()

public boolean hasIfMetagenerationMatch()

Makes the operation conditional on whether the object's current metageneration matches the given value.

optional int64 if_metageneration_match = 5;

Returns
Type Description
boolean

Whether the ifMetagenerationMatch field is set.

hasIfMetagenerationNotMatch()

public boolean hasIfMetagenerationNotMatch()

Makes the operation conditional on whether the object's current metageneration does not match the given value.

optional int64 if_metageneration_not_match = 6;

Returns
Type Description
boolean

Whether the ifMetagenerationNotMatch field is set.

hasObjectSize()

public boolean hasObjectSize()

The expected final object size being uploaded. If this value is set, closing the stream after writing fewer or more than object_size bytes will result in an OUT_OF_RANGE error.

This situation is considered a client error, and if such an error occurs you must start the upload over from scratch, this time sending the correct number of bytes.

optional int64 object_size = 8;

Returns
Type Description
boolean

Whether the objectSize field is set.

hasResource()

public boolean hasResource()

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
boolean

Whether the resource field is set.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(WriteObjectSpec other)

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

mergeResource(Object value)

public WriteObjectSpec.Builder mergeResource(Object value)

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Object
Returns
Type Description
WriteObjectSpec.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

setIfGenerationMatch(long value)

public WriteObjectSpec.Builder setIfGenerationMatch(long value)

Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.

optional int64 if_generation_match = 3;

Parameter
Name Description
value long

The ifGenerationMatch to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

setIfGenerationNotMatch(long value)

public WriteObjectSpec.Builder setIfGenerationNotMatch(long value)

Makes the operation conditional on whether the object's live generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.

optional int64 if_generation_not_match = 4;

Parameter
Name Description
value long

The ifGenerationNotMatch to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

setIfMetagenerationMatch(long value)

public WriteObjectSpec.Builder setIfMetagenerationMatch(long value)

Makes the operation conditional on whether the object's current metageneration matches the given value.

optional int64 if_metageneration_match = 5;

Parameter
Name Description
value long

The ifMetagenerationMatch to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

setIfMetagenerationNotMatch(long value)

public WriteObjectSpec.Builder setIfMetagenerationNotMatch(long value)

Makes the operation conditional on whether the object's current metageneration does not match the given value.

optional int64 if_metageneration_not_match = 6;

Parameter
Name Description
value long

The ifMetagenerationNotMatch to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

setObjectSize(long value)

public WriteObjectSpec.Builder setObjectSize(long value)

The expected final object size being uploaded. If this value is set, closing the stream after writing fewer or more than object_size bytes will result in an OUT_OF_RANGE error.

This situation is considered a client error, and if such an error occurs you must start the upload over from scratch, this time sending the correct number of bytes.

optional int64 object_size = 8;

Parameter
Name Description
value long

The objectSize to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

setPredefinedAcl(String value)

public WriteObjectSpec.Builder setPredefinedAcl(String value)

Apply a predefined set of access controls to this object. Valid values are "authenticatedRead", "bucketOwnerFullControl", "bucketOwnerRead", "private", "projectPrivate", or "publicRead".

string predefined_acl = 7;

Parameter
Name Description
value String

The predefinedAcl to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

setPredefinedAclBytes(ByteString value)

public WriteObjectSpec.Builder setPredefinedAclBytes(ByteString value)

Apply a predefined set of access controls to this object. Valid values are "authenticatedRead", "bucketOwnerFullControl", "bucketOwnerRead", "private", "projectPrivate", or "publicRead".

string predefined_acl = 7;

Parameter
Name Description
value ByteString

The bytes for predefinedAcl to set.

Returns
Type Description
WriteObjectSpec.Builder

This builder for chaining.

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

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

setResource(Object value)

public WriteObjectSpec.Builder setResource(Object value)

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
value Object
Returns
Type Description
WriteObjectSpec.Builder

setResource(Object.Builder builderForValue)

public WriteObjectSpec.Builder setResource(Object.Builder builderForValue)

Required. Destination object, including its name and its metadata.

.google.storage.v2.Object resource = 1 [(.google.api.field_behavior) = REQUIRED];

Parameter
Name Description
builderForValue Object.Builder
Returns
Type Description
WriteObjectSpec.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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