Class: Google::Apis::FirestoreV1::DocumentChange

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

A Document has changed. May be the result of multiple writes, including deletes, that ultimately resulted in a new value for the Document. Multiple DocumentChange messages may be returned for the same logical change, if multiple targets are affected. For PipelineQueryTargets, document will be in the new pipeline format, For a Listen stream with both QueryTargets and PipelineQueryTargets present, if a document matches both types of queries, then a separate DocumentChange messages will be sent out one for each set.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ DocumentChange

Returns a new instance of DocumentChange.



662
663
664
# File 'lib/google/apis/firestore_v1/classes.rb', line 662

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

Instance Attribute Details

#documentGoogle::Apis::FirestoreV1::Document

A Firestore document. Must not exceed 1 MiB - 4 bytes. Corresponds to the JSON property document



650
651
652
# File 'lib/google/apis/firestore_v1/classes.rb', line 650

def document
  @document
end

#removed_target_idsArray<Fixnum>

A set of target IDs for targets that no longer match this document. Corresponds to the JSON property removedTargetIds

Returns:

  • (Array<Fixnum>)


655
656
657
# File 'lib/google/apis/firestore_v1/classes.rb', line 655

def removed_target_ids
  @removed_target_ids
end

#target_idsArray<Fixnum>

A set of target IDs of targets that match this document. Corresponds to the JSON property targetIds

Returns:

  • (Array<Fixnum>)


660
661
662
# File 'lib/google/apis/firestore_v1/classes.rb', line 660

def target_ids
  @target_ids
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



667
668
669
670
671
# File 'lib/google/apis/firestore_v1/classes.rb', line 667

def update!(**args)
  @document = args[:document] if args.key?(:document)
  @removed_target_ids = args[:removed_target_ids] if args.key?(:removed_target_ids)
  @target_ids = args[:target_ids] if args.key?(:target_ids)
end