# # Autogenerated by Thrift Compiler (2.3.0-upfluence) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # require 'thrift' module Thrift module Types module Value class NullValue; end class ListValue; end class MapEntry; end class MapValue; end class StructValue; end class Value < ::Thrift::Union; end class NullValue include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'NullValue'.freeze NAMESPACE = 'types.value'.freeze FIELDS = { } def struct_fields; FIELDS; end def validate end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end class ListValue include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'ListValue'.freeze NAMESPACE = 'types.value'.freeze THRIFT_FIELD_INDEX_VALUES = 1 FIELDS = { THRIFT_FIELD_INDEX_VALUES => {type: ::Thrift::Types::LIST, name: 'values', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field values is unset!') unless @values end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end class MapEntry include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'MapEntry'.freeze NAMESPACE = 'types.value'.freeze THRIFT_FIELD_INDEX_KEY = 1 THRIFT_FIELD_INDEX_VALUE = 2 FIELDS = { THRIFT_FIELD_INDEX_KEY => {type: ::Thrift::Types::STRUCT, name: 'key', class: ::Thrift::Types::Value::Value}, THRIFT_FIELD_INDEX_VALUE => {type: ::Thrift::Types::STRUCT, name: 'value', class: ::Thrift::Types::Value::Value} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field key is unset!') unless @key raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field value is unset!') unless @value end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end class MapValue include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'MapValue'.freeze NAMESPACE = 'types.value'.freeze THRIFT_FIELD_INDEX_ENTRIES = 1 FIELDS = { THRIFT_FIELD_INDEX_ENTRIES => {type: ::Thrift::Types::LIST, name: 'entries', element: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::MapEntry}} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field entries is unset!') unless @entries end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end class StructValue include ::Thrift::Struct, ::Thrift::Struct_Union NAME = 'StructValue'.freeze NAMESPACE = 'types.value'.freeze THRIFT_FIELD_INDEX_FIELDS = 1 FIELDS = { THRIFT_FIELD_INDEX_FIELDS => {type: ::Thrift::Types::MAP, name: 'fields', key: {type: ::Thrift::Types::STRING}, value: {type: ::Thrift::Types::STRUCT, class: ::Thrift::Types::Value::Value}} } def struct_fields; FIELDS; end def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field fields is unset!') unless @fields end ::Thrift::Struct.generate_accessors self ::Thrift.register_struct_type self end class Value < ::Thrift::Union include ::Thrift::Struct_Union NAME = 'Value'.freeze NAMESPACE = 'types.value'.freeze class << self def null_value(val) Value.new(:null_value, val) end def string_value(val) Value.new(:string_value, val) end def binary_value(val) Value.new(:binary_value, val) end def integer_value(val) Value.new(:integer_value, val) end def double_value(val) Value.new(:double_value, val) end def bool_value(val) Value.new(:bool_value, val) end def list_value(val) Value.new(:list_value, val) end def map_value(val) Value.new(:map_value, val) end def struct_value(val) Value.new(:struct_value, val) end end THRIFT_FIELD_INDEX_NULL_VALUE = 1 THRIFT_FIELD_INDEX_STRING_VALUE = 2 THRIFT_FIELD_INDEX_BINARY_VALUE = 3 THRIFT_FIELD_INDEX_INTEGER_VALUE = 4 THRIFT_FIELD_INDEX_DOUBLE_VALUE = 5 THRIFT_FIELD_INDEX_BOOL_VALUE = 6 THRIFT_FIELD_INDEX_LIST_VALUE = 7 THRIFT_FIELD_INDEX_MAP_VALUE = 8 THRIFT_FIELD_INDEX_STRUCT_VALUE = 9 FIELDS = { THRIFT_FIELD_INDEX_NULL_VALUE => {type: ::Thrift::Types::STRUCT, name: 'null_value', class: ::Thrift::Types::Value::NullValue}, THRIFT_FIELD_INDEX_STRING_VALUE => {type: ::Thrift::Types::STRING, name: 'string_value'}, THRIFT_FIELD_INDEX_BINARY_VALUE => {type: ::Thrift::Types::STRING, name: 'binary_value', binary: true}, THRIFT_FIELD_INDEX_INTEGER_VALUE => {type: ::Thrift::Types::I64, name: 'integer_value'}, THRIFT_FIELD_INDEX_DOUBLE_VALUE => {type: ::Thrift::Types::DOUBLE, name: 'double_value'}, THRIFT_FIELD_INDEX_BOOL_VALUE => {type: ::Thrift::Types::BOOL, name: 'bool_value'}, THRIFT_FIELD_INDEX_LIST_VALUE => {type: ::Thrift::Types::STRUCT, name: 'list_value', class: ::Thrift::Types::Value::ListValue}, THRIFT_FIELD_INDEX_MAP_VALUE => {type: ::Thrift::Types::STRUCT, name: 'map_value', class: ::Thrift::Types::Value::MapValue}, THRIFT_FIELD_INDEX_STRUCT_VALUE => {type: ::Thrift::Types::STRUCT, name: 'struct_value', class: ::Thrift::Types::Value::StructValue} } def struct_fields; FIELDS; end def validate raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil? end ::Thrift::Union.generate_accessors self ::Thrift.register_struct_type self end end end end