Class: Google::Apis::FirestoreV1::Value

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 message that can hold any of the supported value types.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Value

Returns a new instance of Value.



2523
2524
2525
# File 'lib/google/apis/firestore_v1/classes.rb', line 2523

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

Instance Attribute Details

#array_valueGoogle::Apis::FirestoreV1::ArrayValue

An array value. Corresponds to the JSON property arrayValue



2461
2462
2463
# File 'lib/google/apis/firestore_v1/classes.rb', line 2461

def array_value
  @array_value
end

#boolean_valueBoolean Also known as: boolean_value?

A boolean value. Corresponds to the JSON property booleanValue

Returns:

  • (Boolean)


2466
2467
2468
# File 'lib/google/apis/firestore_v1/classes.rb', line 2466

def boolean_value
  @boolean_value
end

#bytes_valueString

A bytes value. Must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes are considered by queries. Corresponds to the JSON property bytesValue NOTE: Values are automatically base64 encoded/decoded in the client library.

Returns:

  • (String)


2474
2475
2476
# File 'lib/google/apis/firestore_v1/classes.rb', line 2474

def bytes_value
  @bytes_value
end

#double_valueFloat

A double value. Corresponds to the JSON property doubleValue

Returns:

  • (Float)


2479
2480
2481
# File 'lib/google/apis/firestore_v1/classes.rb', line 2479

def double_value
  @double_value
end

#geo_point_valueGoogle::Apis::FirestoreV1::LatLng

An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. Corresponds to the JSON property geoPointValue



2487
2488
2489
# File 'lib/google/apis/firestore_v1/classes.rb', line 2487

def geo_point_value
  @geo_point_value
end

#integer_valueFixnum

An integer value. Corresponds to the JSON property integerValue

Returns:

  • (Fixnum)


2492
2493
2494
# File 'lib/google/apis/firestore_v1/classes.rb', line 2492

def integer_value
  @integer_value
end

#map_valueGoogle::Apis::FirestoreV1::MapValue

A map value. Corresponds to the JSON property mapValue



2497
2498
2499
# File 'lib/google/apis/firestore_v1/classes.rb', line 2497

def map_value
  @map_value
end

#null_valueString

A null value. Corresponds to the JSON property nullValue

Returns:

  • (String)


2502
2503
2504
# File 'lib/google/apis/firestore_v1/classes.rb', line 2502

def null_value
  @null_value
end

#reference_valueString

A reference to a document. For example: projects/project_id/databases/ database_id/documents/document_path`. Corresponds to the JSON propertyreferenceValue`

Returns:

  • (String)


2508
2509
2510
# File 'lib/google/apis/firestore_v1/classes.rb', line 2508

def reference_value
  @reference_value
end

#string_valueString

A string value. The string, represented as UTF-8, must not exceed 1 MiB - 89 bytes. Only the first 1,500 bytes of the UTF-8 representation are considered by queries. Corresponds to the JSON property stringValue

Returns:

  • (String)


2515
2516
2517
# File 'lib/google/apis/firestore_v1/classes.rb', line 2515

def string_value
  @string_value
end

#timestamp_valueString

A timestamp value. Precise only to microseconds. When stored, any additional precision is rounded down. Corresponds to the JSON property timestampValue

Returns:

  • (String)


2521
2522
2523
# File 'lib/google/apis/firestore_v1/classes.rb', line 2521

def timestamp_value
  @timestamp_value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
# File 'lib/google/apis/firestore_v1/classes.rb', line 2528

def update!(**args)
  @array_value = args[:array_value] if args.key?(:array_value)
  @boolean_value = args[:boolean_value] if args.key?(:boolean_value)
  @bytes_value = args[:bytes_value] if args.key?(:bytes_value)
  @double_value = args[:double_value] if args.key?(:double_value)
  @geo_point_value = args[:geo_point_value] if args.key?(:geo_point_value)
  @integer_value = args[:integer_value] if args.key?(:integer_value)
  @map_value = args[:map_value] if args.key?(:map_value)
  @null_value = args[:null_value] if args.key?(:null_value)
  @reference_value = args[:reference_value] if args.key?(:reference_value)
  @string_value = args[:string_value] if args.key?(:string_value)
  @timestamp_value = args[:timestamp_value] if args.key?(:timestamp_value)
end