Class: Google::Apis::FirestoreV1beta1::Write

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

Overview

A write on a document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Write

Returns a new instance of Write.



2888
2889
2890
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2888

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

Instance Attribute Details

#current_document ⇒ Google::Apis::FirestoreV1beta1::Precondition

A precondition on a document, used for conditional operations. Corresponds to the JSON property currentDocument



2855
2856
2857
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2855

def current_document
  @current_document
end

#delete ⇒ String

A document name to delete. In the format: projects/project_id/databases/ database_id/documents/document_path`. Corresponds to the JSON propertydelete`

Returns:

  • (String)


2861
2862
2863
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2861

def delete
  @delete
end

#transform ⇒ Google::Apis::FirestoreV1beta1::DocumentTransform

A transformation of a document. Corresponds to the JSON property transform



2866
2867
2868
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2866

def transform
  @transform
end

#update ⇒ Google::Apis::FirestoreV1beta1::Document

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



2871
2872
2873
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2871

def update
  @update
end

#update_mask ⇒ Google::Apis::FirestoreV1beta1::DocumentMask

A set of field paths on a document. Used to restrict a get or update operation on a document to a subset of its fields. This is different from standard field masks, as this is always scoped to a Document, and takes in account the dynamic nature of Value. Corresponds to the JSON property updateMask



2879
2880
2881
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2879

def update_mask
  @update_mask
end

#update_transforms ⇒ Array<Google::Apis::FirestoreV1beta1::FieldTransform>

The transforms to perform after update. This field can be set only when the operation is update. If present, this write is equivalent to performing update and transform to the same document atomically and in order. Corresponds to the JSON property updateTransforms



2886
2887
2888
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2886

def update_transforms
  @update_transforms
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2893
2894
2895
2896
2897
2898
2899
2900
# File 'lib/google/apis/firestore_v1beta1/classes.rb', line 2893

def update!(**args)
  @current_document = args[:current_document] if args.key?(:current_document)
  @delete = args[:delete] if args.key?(:delete)
  @transform = args[:transform] if args.key?(:transform)
  @update = args[:update] if args.key?(:update)
  @update_mask = args[:update_mask] if args.key?(:update_mask)
  @update_transforms = args[:update_transforms] if args.key?(:update_transforms)
end