Class: Google::Apis::FirestoreV1::Target
- Inherits:
-
Object
- Object
- Google::Apis::FirestoreV1::Target
- 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
A specification of a set of documents to listen to.
Instance Attribute Summary collapse
-
#documents ⇒ Google::Apis::FirestoreV1::DocumentsTarget
A target specified by a set of documents names.
-
#expected_count ⇒ Fixnum
The number of documents that last matched the query at the resume token or read time.
-
#once ⇒ Boolean
(also: #once?)
If the target should be removed once it is current and consistent.
-
#query ⇒ Google::Apis::FirestoreV1::QueryTarget
A target specified by a query.
-
#read_time ⇒ String
Start listening after a specific
read_time
. -
#resume_token ⇒ String
A resume token from a prior TargetChange for an identical target.
-
#target_id ⇒ Fixnum
The target ID that identifies the target on the stream.
Instance Method Summary collapse
-
#initialize(**args) ⇒ Target
constructor
A new instance of Target.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ Target
Returns a new instance of Target.
3857 3858 3859 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3857 def initialize(**args) update!(**args) end |
Instance Attribute Details
#documents ⇒ Google::Apis::FirestoreV1::DocumentsTarget
A target specified by a set of documents names.
Corresponds to the JSON property documents
3807 3808 3809 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3807 def documents @documents end |
#expected_count ⇒ Fixnum
The number of documents that last matched the query at the resume token or
read time. This value is only relevant when a resume_type
is provided. This
value being present and greater than zero signals that the client wants
ExistenceFilter.unchanged_names
to be included in the response.
Corresponds to the JSON property expectedCount
3815 3816 3817 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3815 def expected_count @expected_count end |
#once ⇒ Boolean Also known as: once?
If the target should be removed once it is current and consistent.
Corresponds to the JSON property once
3820 3821 3822 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3820 def once @once end |
#query ⇒ Google::Apis::FirestoreV1::QueryTarget
A target specified by a query.
Corresponds to the JSON property query
3826 3827 3828 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3826 def query @query end |
#read_time ⇒ String
Start listening after a specific read_time
. The client must know the state
of matching documents at this time.
Corresponds to the JSON property readTime
3832 3833 3834 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3832 def read_time @read_time end |
#resume_token ⇒ String
A resume token from a prior TargetChange for an identical target. Using a
resume token with a different target is unsupported and may fail.
Corresponds to the JSON property resumeToken
NOTE: Values are automatically base64 encoded/decoded in the client library.
3839 3840 3841 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3839 def resume_token @resume_token end |
#target_id ⇒ Fixnum
The target ID that identifies the target on the stream. Must be a positive
number and non-zero. If target_id
is 0 (or unspecified), the server will
assign an ID for this target and return that in a TargetChange::ADD
event.
Once a target with target_id=0
is added, all subsequent targets must also
have target_id=0
. If an AddTarget
request with target_id != 0
is sent to
the server after a target with target_id=0
is added, the server will
immediately send a response with a TargetChange::Remove
event. Note that if
the client sends multiple AddTarget
requests without an ID, the order of IDs
returned in TargetChage.target_ids
are undefined. Therefore, clients should
provide a target ID instead of relying on the server to assign one. If
target_id
is non-zero, there must not be an existing active target on this
stream with the same ID.
Corresponds to the JSON property targetId
3855 3856 3857 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3855 def target_id @target_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
3862 3863 3864 3865 3866 3867 3868 3869 3870 |
# File 'lib/google/apis/firestore_v1/classes.rb', line 3862 def update!(**args) @documents = args[:documents] if args.key?(:documents) @expected_count = args[:expected_count] if args.key?(:expected_count) @once = args[:once] if args.key?(:once) @query = args[:query] if args.key?(:query) @read_time = args[:read_time] if args.key?(:read_time) @resume_token = args[:resume_token] if args.key?(:resume_token) @target_id = args[:target_id] if args.key?(:target_id) end |