Class: Merge::Ats::Eeoc
- Inherits:
-
Object
- Object
- Merge::Ats::Eeoc
- Defined in:
- lib/merge_ruby_client/ats/types/eeoc.rb
Overview
# The EEOC Object
### Description
The `EEOC` object is used to represent the Equal Employment Opportunity
Commission information for a candidate (race, gender, veteran status, disability
status).
### Usage Example
Fetch from the `LIST EEOCs` endpoint and filter by `candidate` to show all EEOC
information for a candidate.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#candidate ⇒ Merge::Ats::EeocCandidate
readonly
The candidate being represented.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
-
#disability_status ⇒ Merge::Ats::DisabilityStatusEnum
readonly
The candidate’s disability status.
- #field_mappings ⇒ Hash{String => Object} readonly
-
#gender ⇒ Merge::Ats::GenderEnum
readonly
The candidate’s gender.
- #id ⇒ String readonly
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
-
#race ⇒ Merge::Ats::RaceEnum
readonly
The candidate’s race.
- #remote_data ⇒ Array<Merge::Ats::RemoteData> readonly
-
#remote_id ⇒ String
readonly
The third-party API ID of the matching object.
-
#remote_was_deleted ⇒ Boolean
readonly
Indicates whether or not this object has been deleted in the third party platform.
-
#submitted_at ⇒ DateTime
readonly
When the information was submitted.
-
#veteran_status ⇒ Merge::Ats::VeteranStatusEnum
readonly
The candidate’s veteran status.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::Eeoc
Deserialize a JSON object to an instance of Eeoc.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, candidate: OMIT, submitted_at: OMIT, race: OMIT, gender: OMIT, veteran_status: OMIT, disability_status: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Ats::Eeoc constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Eeoc to a JSON object.
Constructor Details
#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, candidate: OMIT, submitted_at: OMIT, race: OMIT, gender: OMIT, veteran_status: OMIT, disability_status: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Ats::Eeoc
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 119 def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, candidate: OMIT, submitted_at: OMIT, race: OMIT, gender: OMIT, veteran_status: OMIT, disability_status: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) @id = id if id != OMIT @remote_id = remote_id if remote_id != OMIT @created_at = created_at if created_at != OMIT @modified_at = modified_at if modified_at != OMIT @candidate = candidate if candidate != OMIT @submitted_at = submitted_at if submitted_at != OMIT @race = race if race != OMIT @gender = gender if gender != OMIT @veteran_status = veteran_status if veteran_status != OMIT @disability_status = disability_status if disability_status != OMIT @remote_was_deleted = remote_was_deleted if remote_was_deleted != OMIT @field_mappings = field_mappings if field_mappings != OMIT @remote_data = remote_data if remote_data != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "remote_id": remote_id, "created_at": created_at, "modified_at": modified_at, "candidate": candidate, "submitted_at": submitted_at, "race": race, "gender": gender, "veteran_status": veteran_status, "disability_status": disability_status, "remote_was_deleted": remote_was_deleted, "field_mappings": field_mappings, "remote_data": remote_data }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
74 75 76 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 74 def additional_properties @additional_properties end |
#candidate ⇒ Merge::Ats::EeocCandidate (readonly)
Returns The candidate being represented.
33 34 35 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 33 def candidate @candidate end |
#created_at ⇒ DateTime (readonly)
Returns The datetime that this object was created by Merge.
29 30 31 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 29 def created_at @created_at end |
#disability_status ⇒ Merge::Ats::DisabilityStatusEnum (readonly)
Returns The candidate’s disability status.
-
‘YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY` -
YES_I_HAVE_A_DISABILITY_OR_PREVIOUSLY_HAD_A_DISABILITY
-
‘NO_I_DONT_HAVE_A_DISABILITY` - NO_I_DONT_HAVE_A_DISABILITY
-
‘I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER.
65 66 67 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 65 def disability_status @disability_status end |
#field_mappings ⇒ Hash{String => Object} (readonly)
70 71 72 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 70 def field_mappings @field_mappings end |
#gender ⇒ Merge::Ats::GenderEnum (readonly)
Returns The candidate’s gender.
-
‘MALE` - MALE
-
‘FEMALE` - FEMALE
-
‘NON-BINARY` - NON-BINARY
-
‘OTHER` - OTHER
-
‘DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY.
53 54 55 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 53 def gender @gender end |
#id ⇒ String (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 25 def id @id end |
#modified_at ⇒ DateTime (readonly)
Returns The datetime that this object was modified by Merge.
31 32 33 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 31 def modified_at @modified_at end |
#race ⇒ Merge::Ats::RaceEnum (readonly)
Returns The candidate’s race.
-
‘AMERICAN_INDIAN_OR_ALASKAN_NATIVE` - AMERICAN_INDIAN_OR_ALASKAN_NATIVE
-
‘ASIAN` - ASIAN
-
‘BLACK_OR_AFRICAN_AMERICAN` - BLACK_OR_AFRICAN_AMERICAN
-
‘HISPANIC_OR_LATINO` - HISPANIC_OR_LATINO
-
‘WHITE` - WHITE
-
‘NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER` -
NATIVE_HAWAIIAN_OR_OTHER_PACIFIC_ISLANDER
-
‘TWO_OR_MORE_RACES` - TWO_OR_MORE_RACES
-
‘DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY.
46 47 48 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 46 def race @race end |
#remote_data ⇒ Array<Merge::Ats::RemoteData> (readonly)
72 73 74 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 72 def remote_data @remote_data end |
#remote_id ⇒ String (readonly)
Returns The third-party API ID of the matching object.
27 28 29 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 27 def remote_id @remote_id end |
#remote_was_deleted ⇒ Boolean (readonly)
Returns Indicates whether or not this object has been deleted in the third party platform.
68 69 70 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 68 def remote_was_deleted @remote_was_deleted end |
#submitted_at ⇒ DateTime (readonly)
Returns When the information was submitted.
35 36 37 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 35 def submitted_at @submitted_at end |
#veteran_status ⇒ Merge::Ats::VeteranStatusEnum (readonly)
Returns The candidate’s veteran status.
-
‘I_AM_NOT_A_PROTECTED_VETERAN` - I_AM_NOT_A_PROTECTED_VETERAN
-
‘I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN` -
I_IDENTIFY_AS_ONE_OR_MORE_OF_THE_CLASSIFICATIONS_OF_A_PROTECTED_VETERAN
-
‘I_DONT_WISH_TO_ANSWER` - I_DONT_WISH_TO_ANSWER.
59 60 61 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 59 def veteran_status @veteran_status end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ats::Eeoc
Deserialize a JSON object to an instance of Eeoc
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 158 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] remote_id = parsed_json["remote_id"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) modified_at = (DateTime.parse(parsed_json["modified_at"]) unless parsed_json["modified_at"].nil?) if parsed_json["candidate"].nil? candidate = nil else candidate = parsed_json["candidate"].to_json candidate = Merge::Ats::EeocCandidate.from_json(json_object: candidate) end submitted_at = (DateTime.parse(parsed_json["submitted_at"]) unless parsed_json["submitted_at"].nil?) race = parsed_json["race"] gender = parsed_json["gender"] veteran_status = parsed_json["veteran_status"] disability_status = parsed_json["disability_status"] remote_was_deleted = parsed_json["remote_was_deleted"] field_mappings = parsed_json["field_mappings"] remote_data = parsed_json["remote_data"]&.map do |item| item = item.to_json Merge::Ats::RemoteData.from_json(json_object: item) end new( id: id, remote_id: remote_id, created_at: created_at, modified_at: modified_at, candidate: candidate, submitted_at: submitted_at, race: race, gender: gender, veteran_status: veteran_status, disability_status: disability_status, remote_was_deleted: remote_was_deleted, field_mappings: field_mappings, remote_data: remote_data, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 213 def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.remote_id&.is_a?(String) != false || raise("Passed value for field obj.remote_id is not the expected type, validation failed.") obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.") obj.candidate.nil? || Merge::Ats::EeocCandidate.validate_raw(obj: obj.candidate) obj.submitted_at&.is_a?(DateTime) != false || raise("Passed value for field obj.submitted_at is not the expected type, validation failed.") obj.race&.is_a?(Merge::Ats::RaceEnum) != false || raise("Passed value for field obj.race is not the expected type, validation failed.") obj.gender&.is_a?(Merge::Ats::GenderEnum) != false || raise("Passed value for field obj.gender is not the expected type, validation failed.") obj.veteran_status&.is_a?(Merge::Ats::VeteranStatusEnum) != false || raise("Passed value for field obj.veteran_status is not the expected type, validation failed.") obj.disability_status&.is_a?(Merge::Ats::DisabilityStatusEnum) != false || raise("Passed value for field obj.disability_status is not the expected type, validation failed.") obj.remote_was_deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.remote_was_deleted is not the expected type, validation failed.") obj.field_mappings&.is_a?(Hash) != false || raise("Passed value for field obj.field_mappings is not the expected type, validation failed.") obj.remote_data&.is_a?(Array) != false || raise("Passed value for field obj.remote_data is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Eeoc to a JSON object
203 204 205 |
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 203 def to_json(*_args) @_field_set&.to_json end |