Documentation

WriteRequest extends Message
in package

Request object for ByteStream.Write.

Generated from protobuf message google.bytestream.WriteRequest

Table of Contents

Properties

$data  : mixed
A portion of the data for the resource. The client **may** leave `data` empty for any given `WriteRequest`. This enables the client to inform the service that the request is still live while it is running an operation to generate more data.
$finish_write  : mixed
If `true`, this indicates that the write is complete. Sending any `WriteRequest`s subsequent to one in which `finish_write` is `true` will cause an error.
$resource_name  : mixed
The name of the resource to write. This **must** be set on the first `WriteRequest` of each `Write()` action. If it is set on subsequent calls, it **must** match the value of the first request.
$write_offset  : mixed
The offset from the beginning of the resource at which the data should be written. It is required on all `WriteRequest`s.

Methods

__construct()  : mixed
Constructor.
getData()  : string
A portion of the data for the resource. The client **may** leave `data` empty for any given `WriteRequest`. This enables the client to inform the service that the request is still live while it is running an operation to generate more data.
getFinishWrite()  : bool
If `true`, this indicates that the write is complete. Sending any `WriteRequest`s subsequent to one in which `finish_write` is `true` will cause an error.
getResourceName()  : string
The name of the resource to write. This **must** be set on the first `WriteRequest` of each `Write()` action. If it is set on subsequent calls, it **must** match the value of the first request.
getWriteOffset()  : int|string
The offset from the beginning of the resource at which the data should be written. It is required on all `WriteRequest`s.
setData()  : $this
A portion of the data for the resource. The client **may** leave `data` empty for any given `WriteRequest`. This enables the client to inform the service that the request is still live while it is running an operation to generate more data.
setFinishWrite()  : $this
If `true`, this indicates that the write is complete. Sending any `WriteRequest`s subsequent to one in which `finish_write` is `true` will cause an error.
setResourceName()  : $this
The name of the resource to write. This **must** be set on the first `WriteRequest` of each `Write()` action. If it is set on subsequent calls, it **must** match the value of the first request.
setWriteOffset()  : $this
The offset from the beginning of the resource at which the data should be written. It is required on all `WriteRequest`s.

Properties

$data

A portion of the data for the resource. The client **may** leave `data` empty for any given `WriteRequest`. This enables the client to inform the service that the request is still live while it is running an operation to generate more data.

protected mixed $data = ''

Generated from protobuf field bytes data = 10 [json_name = "data"];

$finish_write

If `true`, this indicates that the write is complete. Sending any `WriteRequest`s subsequent to one in which `finish_write` is `true` will cause an error.

protected mixed $finish_write = false

Generated from protobuf field bool finish_write = 3 [json_name = "finishWrite"];

$resource_name

The name of the resource to write. This **must** be set on the first `WriteRequest` of each `Write()` action. If it is set on subsequent calls, it **must** match the value of the first request.

protected mixed $resource_name = ''

Generated from protobuf field string resource_name = 1 [json_name = "resourceName"];

$write_offset

The offset from the beginning of the resource at which the data should be written. It is required on all `WriteRequest`s.

protected mixed $write_offset = 0

In the first WriteRequest of a Write() action, it indicates the initial offset for the Write() call. The value must be equal to the committed_size that a call to QueryWriteStatus() would return. On subsequent calls, this value must be set and must be equal to the sum of the first write_offset and the sizes of all data bundles sent previously on this stream. An incorrect value will cause an error.

Generated from protobuf field int64 write_offset = 2 [json_name = "writeOffset"];

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $data = NULL ]) : mixed
Parameters
$data : array<string|int, mixed> = NULL

{ Optional. Data for populating the Message object.

@type string $resource_name
      The name of the resource to write. This **must** be set on the first
      `WriteRequest` of each `Write()` action. If it is set on subsequent calls,
      it **must** match the value of the first request.
@type int|string $write_offset
      The offset from the beginning of the resource at which the data should be
      written. It is required on all `WriteRequest`s.
      In the first `WriteRequest` of a `Write()` action, it indicates
      the initial offset for the `Write()` call. The value **must** be equal to
      the `committed_size` that a call to `QueryWriteStatus()` would return.
      On subsequent calls, this value **must** be set and **must** be equal to
      the sum of the first `write_offset` and the sizes of all `data` bundles
      sent previously on this stream.
      An incorrect value will cause an error.
@type bool $finish_write
      If `true`, this indicates that the write is complete. Sending any
      `WriteRequest`s subsequent to one in which `finish_write` is `true` will
      cause an error.
@type string $data
      A portion of the data for the resource. The client **may** leave `data`
      empty for any given `WriteRequest`. This enables the client to inform the
      service that the request is still live while it is running an operation to
      generate more data.

}

getData()

A portion of the data for the resource. The client **may** leave `data` empty for any given `WriteRequest`. This enables the client to inform the service that the request is still live while it is running an operation to generate more data.

public getData() : string

Generated from protobuf field bytes data = 10 [json_name = "data"];

Return values
string

getFinishWrite()

If `true`, this indicates that the write is complete. Sending any `WriteRequest`s subsequent to one in which `finish_write` is `true` will cause an error.

public getFinishWrite() : bool

Generated from protobuf field bool finish_write = 3 [json_name = "finishWrite"];

Return values
bool

getResourceName()

The name of the resource to write. This **must** be set on the first `WriteRequest` of each `Write()` action. If it is set on subsequent calls, it **must** match the value of the first request.

public getResourceName() : string

Generated from protobuf field string resource_name = 1 [json_name = "resourceName"];

Return values
string

getWriteOffset()

The offset from the beginning of the resource at which the data should be written. It is required on all `WriteRequest`s.

public getWriteOffset() : int|string

In the first WriteRequest of a Write() action, it indicates the initial offset for the Write() call. The value must be equal to the committed_size that a call to QueryWriteStatus() would return. On subsequent calls, this value must be set and must be equal to the sum of the first write_offset and the sizes of all data bundles sent previously on this stream. An incorrect value will cause an error.

Generated from protobuf field int64 write_offset = 2 [json_name = "writeOffset"];

Return values
int|string

setData()

A portion of the data for the resource. The client **may** leave `data` empty for any given `WriteRequest`. This enables the client to inform the service that the request is still live while it is running an operation to generate more data.

public setData(string $var) : $this

Generated from protobuf field bytes data = 10 [json_name = "data"];

Parameters
$var : string
Return values
$this

setFinishWrite()

If `true`, this indicates that the write is complete. Sending any `WriteRequest`s subsequent to one in which `finish_write` is `true` will cause an error.

public setFinishWrite(bool $var) : $this

Generated from protobuf field bool finish_write = 3 [json_name = "finishWrite"];

Parameters
$var : bool
Return values
$this

setResourceName()

The name of the resource to write. This **must** be set on the first `WriteRequest` of each `Write()` action. If it is set on subsequent calls, it **must** match the value of the first request.

public setResourceName(string $var) : $this

Generated from protobuf field string resource_name = 1 [json_name = "resourceName"];

Parameters
$var : string
Return values
$this

setWriteOffset()

The offset from the beginning of the resource at which the data should be written. It is required on all `WriteRequest`s.

public setWriteOffset(int|string $var) : $this

In the first WriteRequest of a Write() action, it indicates the initial offset for the Write() call. The value must be equal to the committed_size that a call to QueryWriteStatus() would return. On subsequent calls, this value must be set and must be equal to the sum of the first write_offset and the sizes of all data bundles sent previously on this stream. An incorrect value will cause an error.

Generated from protobuf field int64 write_offset = 2 [json_name = "writeOffset"];

Parameters
$var : int|string
Return values
$this

        
On this page

Search results