Class: Google::Cloud::Bigtable::V2::Type::Struct

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/bigtable/v2/types.rb

Overview

A structured data value, consisting of fields which map to dynamically typed values. Values of type Struct are stored in Value.array_value where entries are in the same order and number as field_types.

Defined Under Namespace

Classes: Encoding, Field

Instance Attribute Summary collapse

Instance Attribute Details

#encoding::Google::Cloud::Bigtable::V2::Type::Struct::Encoding

Returns The encoding to use when converting to or from lower level types.

Returns:



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'proto_docs/google/bigtable/v2/types.rb', line 339

class Struct
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A struct field and its type.
  # @!attribute [rw] field_name
  #   @return [::String]
  #     The field name (optional). Fields without a `field_name` are considered
  #     anonymous and cannot be referenced by name.
  # @!attribute [rw] type
  #   @return [::Google::Cloud::Bigtable::V2::Type]
  #     The type of values in this field.
  class Field
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Rules used to convert to or from lower level types.
  # @!attribute [rw] singleton
  #   @return [::Google::Cloud::Bigtable::V2::Type::Struct::Encoding::Singleton]
  #     Use `Singleton` encoding.
  #
  #     Note: The following fields are mutually exclusive: `singleton`, `delimited_bytes`, `ordered_code_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] delimited_bytes
  #   @return [::Google::Cloud::Bigtable::V2::Type::Struct::Encoding::DelimitedBytes]
  #     Use `DelimitedBytes` encoding.
  #
  #     Note: The following fields are mutually exclusive: `delimited_bytes`, `singleton`, `ordered_code_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] ordered_code_bytes
  #   @return [::Google::Cloud::Bigtable::V2::Type::Struct::Encoding::OrderedCodeBytes]
  #     User `OrderedCodeBytes` encoding.
  #
  #     Note: The following fields are mutually exclusive: `ordered_code_bytes`, `singleton`, `delimited_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class Encoding
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Uses the encoding of `fields[0].type` as-is.
    # Only valid if `fields.size == 1`.
    class Singleton
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Fields are encoded independently and concatenated with a configurable
    # `delimiter` in between.
    #
    # A struct with no fields defined is encoded as a single `delimiter`.
    #
    # Sorted mode:
    #
    #  - Fields are encoded in sorted mode.
    #  - Encoded field values must not contain any bytes <= `delimiter[0]`
    #  - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
    #    `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
    #
    # Distinct mode:
    #
    #  - Fields are encoded in distinct mode.
    #  - Encoded field values must not contain `delimiter[0]`.
    # @!attribute [rw] delimiter
    #   @return [::String]
    #     Byte sequence used to delimit concatenated fields. The delimiter must
    #     contain at least 1 character and at most 50 characters.
    class DelimitedBytes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Fields are encoded independently and concatenated with the fixed byte
    # pair `{0x00, 0x01}` in between.
    #
    # Any null `(0x00)` byte in an encoded field is replaced by the fixed
    # byte pair `{0x00, 0xFF}`.
    #
    # Fields that encode to the empty string "" have special handling:
    #
    #  - If *every* field encodes to "", or if the STRUCT has no fields
    #    defined, then the STRUCT is encoded as the fixed byte pair
    #    `{0x00, 0x00}`.
    #  - Otherwise, the STRUCT only encodes until the last non-empty field,
    #    omitting any trailing empty fields. Any empty fields that aren't
    #    omitted are replaced with the fixed byte pair `{0x00, 0x00}`.
    #
    # Examples:
    #
    # ```
    #  - STRUCT()             -> "\00\00"
    #  - STRUCT("")           -> "\00\00"
    #  - STRUCT("", "")       -> "\00\00"
    #  - STRUCT("", "B")      -> "\00\00" + "\00\01" + "B"
    #  - STRUCT("A", "")      -> "A"
    #  - STRUCT("", "B", "")  -> "\00\00" + "\00\01" + "B"
    #  - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
    # ```
    #
    #
    # Since null bytes are always escaped, this encoding can cause size
    # blowup for encodings like `Int64.BigEndianBytes` that are likely to
    # produce many such bytes.
    #
    # Sorted mode:
    #
    #  - Fields are encoded in sorted mode.
    #  - All values supported by the field encodings are allowed
    #  - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
    #    `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
    #
    # Distinct mode:
    #
    #  - Fields are encoded in distinct mode.
    #  - All values supported by the field encodings are allowed.
    class OrderedCodeBytes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end
end

#fields::Array<::Google::Cloud::Bigtable::V2::Type::Struct::Field>

Returns The names and types of the fields in this struct.

Returns:



339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'proto_docs/google/bigtable/v2/types.rb', line 339

class Struct
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # A struct field and its type.
  # @!attribute [rw] field_name
  #   @return [::String]
  #     The field name (optional). Fields without a `field_name` are considered
  #     anonymous and cannot be referenced by name.
  # @!attribute [rw] type
  #   @return [::Google::Cloud::Bigtable::V2::Type]
  #     The type of values in this field.
  class Field
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Rules used to convert to or from lower level types.
  # @!attribute [rw] singleton
  #   @return [::Google::Cloud::Bigtable::V2::Type::Struct::Encoding::Singleton]
  #     Use `Singleton` encoding.
  #
  #     Note: The following fields are mutually exclusive: `singleton`, `delimited_bytes`, `ordered_code_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] delimited_bytes
  #   @return [::Google::Cloud::Bigtable::V2::Type::Struct::Encoding::DelimitedBytes]
  #     Use `DelimitedBytes` encoding.
  #
  #     Note: The following fields are mutually exclusive: `delimited_bytes`, `singleton`, `ordered_code_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  # @!attribute [rw] ordered_code_bytes
  #   @return [::Google::Cloud::Bigtable::V2::Type::Struct::Encoding::OrderedCodeBytes]
  #     User `OrderedCodeBytes` encoding.
  #
  #     Note: The following fields are mutually exclusive: `ordered_code_bytes`, `singleton`, `delimited_bytes`. If a field in that set is populated, all other fields in the set will automatically be cleared.
  class Encoding
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Uses the encoding of `fields[0].type` as-is.
    # Only valid if `fields.size == 1`.
    class Singleton
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Fields are encoded independently and concatenated with a configurable
    # `delimiter` in between.
    #
    # A struct with no fields defined is encoded as a single `delimiter`.
    #
    # Sorted mode:
    #
    #  - Fields are encoded in sorted mode.
    #  - Encoded field values must not contain any bytes <= `delimiter[0]`
    #  - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
    #    `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
    #
    # Distinct mode:
    #
    #  - Fields are encoded in distinct mode.
    #  - Encoded field values must not contain `delimiter[0]`.
    # @!attribute [rw] delimiter
    #   @return [::String]
    #     Byte sequence used to delimit concatenated fields. The delimiter must
    #     contain at least 1 character and at most 50 characters.
    class DelimitedBytes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Fields are encoded independently and concatenated with the fixed byte
    # pair `{0x00, 0x01}` in between.
    #
    # Any null `(0x00)` byte in an encoded field is replaced by the fixed
    # byte pair `{0x00, 0xFF}`.
    #
    # Fields that encode to the empty string "" have special handling:
    #
    #  - If *every* field encodes to "", or if the STRUCT has no fields
    #    defined, then the STRUCT is encoded as the fixed byte pair
    #    `{0x00, 0x00}`.
    #  - Otherwise, the STRUCT only encodes until the last non-empty field,
    #    omitting any trailing empty fields. Any empty fields that aren't
    #    omitted are replaced with the fixed byte pair `{0x00, 0x00}`.
    #
    # Examples:
    #
    # ```
    #  - STRUCT()             -> "\00\00"
    #  - STRUCT("")           -> "\00\00"
    #  - STRUCT("", "")       -> "\00\00"
    #  - STRUCT("", "B")      -> "\00\00" + "\00\01" + "B"
    #  - STRUCT("A", "")      -> "A"
    #  - STRUCT("", "B", "")  -> "\00\00" + "\00\01" + "B"
    #  - STRUCT("A", "", "C") -> "A" + "\00\01" + "\00\00" + "\00\01" + "C"
    # ```
    #
    #
    # Since null bytes are always escaped, this encoding can cause size
    # blowup for encodings like `Int64.BigEndianBytes` that are likely to
    # produce many such bytes.
    #
    # Sorted mode:
    #
    #  - Fields are encoded in sorted mode.
    #  - All values supported by the field encodings are allowed
    #  - Element-wise order is preserved: `A < B` if `A[0] < B[0]`, or if
    #    `A[0] == B[0] && A[1] < B[1]`, etc. Strict prefixes sort first.
    #
    # Distinct mode:
    #
    #  - Fields are encoded in distinct mode.
    #  - All values supported by the field encodings are allowed.
    class OrderedCodeBytes
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end
end