Class: Google::Apis::FirestoreV1::WriteRequest

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/firestore_v1/classes.rb,
lib/google/apis/firestore_v1/representations.rb,
lib/google/apis/firestore_v1/representations.rb

Overview

The request for Firestore.Write. The first request creates a stream, or resumes an existing one from a token. When creating a new stream, the server replies with a response containing only an ID and a token, to use in the next request. When resuming a stream, the server first streams any responses later than the given token, then a response containing only an up-to-date token, to use in the next request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ WriteRequest

Returns a new instance of WriteRequest.



5086
5087
5088
# File 'lib/google/apis/firestore_v1/classes.rb', line 5086

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#labelsHash<String,String>

Labels associated with this write request. Corresponds to the JSON property labels

Returns:

  • (Hash<String,String>)


5053
5054
5055
# File 'lib/google/apis/firestore_v1/classes.rb', line 5053

def labels
  @labels
end

#request_optionsGoogle::Apis::FirestoreV1::RequestOptions

Options for a server request. Corresponds to the JSON property requestOptions



5058
5059
5060
# File 'lib/google/apis/firestore_v1/classes.rb', line 5058

def request_options
  @request_options
end

#stream_idString

The ID of the write stream to resume. This may only be set in the first message. When left empty, a new write stream will be created. Corresponds to the JSON property streamId

Returns:

  • (String)


5064
5065
5066
# File 'lib/google/apis/firestore_v1/classes.rb', line 5064

def stream_id
  @stream_id
end

#stream_tokenString

A stream token that was previously sent by the server. The client should set this field to the token from the most recent WriteResponse it has received. This acknowledges that the client has received responses up to this token. After sending this token, earlier tokens may not be used anymore. The server may close the stream if there are too many unacknowledged responses. Leave this field unset when creating a new stream. To resume a stream at a specific point, set this field and the stream_id field. Leave this field unset when creating a new stream. Corresponds to the JSON property streamToken NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


5077
5078
5079
# File 'lib/google/apis/firestore_v1/classes.rb', line 5077

def stream_token
  @stream_token
end

#writesArray<Google::Apis::FirestoreV1::Write>

The writes to apply. Always executed atomically and in order. This must be empty on the first request. This may be empty on the last request. This must not be empty on all other requests. Corresponds to the JSON property writes



5084
5085
5086
# File 'lib/google/apis/firestore_v1/classes.rb', line 5084

def writes
  @writes
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



5091
5092
5093
5094
5095
5096
5097
# File 'lib/google/apis/firestore_v1/classes.rb', line 5091

def update!(**args)
  @labels = args[:labels] if args.key?(:labels)
  @request_options = args[:request_options] if args.key?(:request_options)
  @stream_id = args[:stream_id] if args.key?(:stream_id)
  @stream_token = args[:stream_token] if args.key?(:stream_token)
  @writes = args[:writes] if args.key?(:writes)
end