Class: NSFDemographics

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/user_profile_model_types.rb

Overview

A structure holding the NSF Demographic information.

Constant Summary collapse

AIRAVATAINTERNALUSERID =
1
GENDER =
2
USCITIZENSHIP =
3
ETHNICITIES =
4
RACES =
5
DISABILITIES =
6
FIELDS =
{
  AIRAVATAINTERNALUSERID => {:type => ::Thrift::Types::STRING, :name => 'airavataInternalUserId', :default => %q"DO_NOT_SET_AT_CLIENTS"},
  GENDER => {:type => ::Thrift::Types::STRING, :name => 'gender', :optional => true},
  USCITIZENSHIP => {:type => ::Thrift::Types::I32, :name => 'usCitizenship', :optional => true, :enum_class => ::USCitizenship},
  ETHNICITIES => {:type => ::Thrift::Types::LIST, :name => 'ethnicities', :element => {:type => ::Thrift::Types::I32, :enum_class => ::Ethnicity}, :optional => true},
  RACES => {:type => ::Thrift::Types::LIST, :name => 'races', :element => {:type => ::Thrift::Types::I32, :enum_class => ::Race}, :optional => true},
  DISABILITIES => {:type => ::Thrift::Types::LIST, :name => 'disabilities', :element => {:type => ::Thrift::Types::I32, :enum_class => ::Disability}, :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



85
# File 'lib/user_profile_model_types.rb', line 85

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


87
88
89
90
91
92
# File 'lib/user_profile_model_types.rb', line 87

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field airavataInternalUserId is unset!') unless @airavataInternalUserId
  unless @usCitizenship.nil? || ::USCitizenship::VALID_VALUES.include?(@usCitizenship)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field usCitizenship!')
  end
end