Class WriteObjectSpec.Builder (2.19.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
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

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

build()

public WriteObjectSpec build()
Returns
TypeDescription
WriteObjectSpec

buildPartial()

public WriteObjectSpec buildPartial()
Returns
TypeDescription
WriteObjectSpec

clear()

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

clearField(Descriptors.FieldDescriptor field)

public WriteObjectSpec.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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. The object_size value is ignored for one-shot (non-resumable) writes.

optional int64 object_size = 8;

Returns
TypeDescription
WriteObjectSpec.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

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

clone()

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

getDefaultInstanceForType()

public WriteObjectSpec getDefaultInstanceForType()
Returns
TypeDescription
WriteObjectSpec

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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. The object_size value is ignored for one-shot (non-resumable) writes.

optional int64 object_size = 8;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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. The object_size value is ignored for one-shot (non-resumable) writes.

optional int64 object_size = 8;

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

Whether the resource field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

mergeFrom(Message other)

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

mergeFrom(WriteObjectSpec other)

public WriteObjectSpec.Builder mergeFrom(WriteObjectSpec other)
Parameter
NameDescription
otherWriteObjectSpec
Returns
TypeDescription
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
NameDescription
valueObject
Returns
TypeDescription
WriteObjectSpec.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

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

setField(Descriptors.FieldDescriptor field, Object value)

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

The ifGenerationMatch to set.

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

The ifGenerationNotMatch to set.

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

The ifMetagenerationMatch to set.

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

The ifMetagenerationNotMatch to set.

Returns
TypeDescription
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. The object_size value is ignored for one-shot (non-resumable) writes.

optional int64 object_size = 8;

Parameter
NameDescription
valuelong

The objectSize to set.

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

The predefinedAcl to set.

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

The bytes for predefinedAcl to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
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
NameDescription
valueObject
Returns
TypeDescription
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
NameDescription
builderForValueObject.Builder
Returns
TypeDescription
WriteObjectSpec.Builder

setUnknownFields(UnknownFieldSet unknownFields)

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