#
# Autogenerated by Thrift Compiler (0.8.0)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#


module MaritalStatus
  SINGLE = 0
  MARRIED = 1
  DIVORCED = 2
  UPSIDEDOWN = 3
  ITS_COMPLICATED = 4
  VALUE_MAP = {0 => "SINGLE", 1 => "MARRIED", 2 => "DIVORCED", 3 => "UPSIDEDOWN", 4 => "ITS_COMPLICATED"}
  VALID_VALUES = Set.new([SINGLE, MARRIED, DIVORCED, UPSIDEDOWN, ITS_COMPLICATED]).freeze
end

module Status
  ON = 0
  OFF = 1
  DEAD = 2
  ALIVE = 3
  VALUE_MAP = {0 => "ON", 1 => "OFF", 2 => "DEAD", 3 => "ALIVE"}
  VALID_VALUES = Set.new([ON, OFF, DEAD, ALIVE]).freeze
end

class UserProfile
  include ::Thrift::Struct, ::Thrift::Struct_Union
  UID = 1
  NAME = 2
  BLURB = 3

  FIELDS = {
    UID => {:type => ::Thrift::Types::I32, :name => 'uid'},
    NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
    BLURB => {:type => ::Thrift::Types::STRING, :name => 'blurb'}
  }

  def struct_fields; FIELDS; end

  def validate
  end

  ::Thrift::Struct.generate_accessors self
end

class UserStatus
  include ::Thrift::Struct, ::Thrift::Struct_Union
  PROFILE = 1
  ACTIVE = 2

  FIELDS = {
    PROFILE => {:type => ::Thrift::Types::STRUCT, :name => 'profile', :class => UserProfile},
    ACTIVE => {:type => ::Thrift::Types::BOOL, :name => 'active'}
  }

  def struct_fields; FIELDS; end

  def validate
  end

  ::Thrift::Struct.generate_accessors self
end

class UserRelationship
  include ::Thrift::Struct, ::Thrift::Struct_Union
  USER = 1
  STATUS = 2

  FIELDS = {
    USER => {:type => ::Thrift::Types::I32, :name => 'user'},
    STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :enum_class => MaritalStatus}
  }

  def struct_fields; FIELDS; end

  def validate
    unless @status.nil? || MaritalStatus::VALID_VALUES.include?(@status)
      raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field status!')
    end
  end

  ::Thrift::Struct.generate_accessors self
end

class UserFriends
  include ::Thrift::Struct, ::Thrift::Struct_Union
  USER = 1
  FRIENDS = 2

  FIELDS = {
    USER => {:type => ::Thrift::Types::I32, :name => 'user'},
    FRIENDS => {:type => ::Thrift::Types::LIST, :name => 'friends', :element => {:type => ::Thrift::Types::I32}}
  }

  def struct_fields; FIELDS; end

  def validate
  end

  ::Thrift::Struct.generate_accessors self
end

class RockTooHard < ::Thrift::Exception
  include ::Thrift::Struct, ::Thrift::Struct_Union
  VOLUME = 1

  FIELDS = {
    VOLUME => {:type => ::Thrift::Types::I32, :name => 'volume'}
  }

  def struct_fields; FIELDS; end

  def validate
  end

  ::Thrift::Struct.generate_accessors self
end

