Class: Google::Apis::FirestoreV1::Target

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 specification of a set of documents to listen to.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Target

Returns a new instance of Target.



3245
3246
3247
# File 'lib/google/apis/firestore_v1/classes.rb', line 3245

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

Instance Attribute Details

#documentsGoogle::Apis::FirestoreV1::DocumentsTarget

A target specified by a set of documents names. Corresponds to the JSON property documents



3205
3206
3207
# File 'lib/google/apis/firestore_v1/classes.rb', line 3205

def documents
  @documents
end

#expected_countFixnum

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

Returns:

  • (Fixnum)


3213
3214
3215
# File 'lib/google/apis/firestore_v1/classes.rb', line 3213

def expected_count
  @expected_count
end

#onceBoolean Also known as: once?

If the target should be removed once it is current and consistent. Corresponds to the JSON property once

Returns:

  • (Boolean)


3218
3219
3220
# File 'lib/google/apis/firestore_v1/classes.rb', line 3218

def once
  @once
end

#queryGoogle::Apis::FirestoreV1::QueryTarget

A target specified by a query. Corresponds to the JSON property query



3224
3225
3226
# File 'lib/google/apis/firestore_v1/classes.rb', line 3224

def query
  @query
end

#read_timeString

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

Returns:

  • (String)


3230
3231
3232
# File 'lib/google/apis/firestore_v1/classes.rb', line 3230

def read_time
  @read_time
end

#resume_tokenString

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.

Returns:

  • (String)


3237
3238
3239
# File 'lib/google/apis/firestore_v1/classes.rb', line 3237

def resume_token
  @resume_token
end

#target_idFixnum

The target ID that identifies the target on the stream. Must be a positive number and non-zero. Corresponds to the JSON property targetId

Returns:

  • (Fixnum)


3243
3244
3245
# File 'lib/google/apis/firestore_v1/classes.rb', line 3243

def target_id
  @target_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3250
3251
3252
3253
3254
3255
3256
3257
3258
# File 'lib/google/apis/firestore_v1/classes.rb', line 3250

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