Class: Merge::Ats::Eeoc

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • id (String) (defaults to: OMIT)
  • remote_id (String) (defaults to: OMIT)

    The third-party API ID of the matching object.

  • created_at (DateTime) (defaults to: OMIT)

    The datetime that this object was created by Merge.

  • modified_at (DateTime) (defaults to: OMIT)

    The datetime that this object was modified by Merge.

  • candidate (Merge::Ats::EeocCandidate) (defaults to: OMIT)

    The candidate being represented.

  • submitted_at (DateTime) (defaults to: OMIT)

    When the information was submitted.

  • race (Merge::Ats::RaceEnum) (defaults to: OMIT)

    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

  • gender (Merge::Ats::GenderEnum) (defaults to: OMIT)

    The candidate’s gender.

    • ‘MALE` - MALE

    • ‘FEMALE` - FEMALE

    • ‘NON-BINARY` - NON-BINARY

    • ‘OTHER` - OTHER

    • ‘DECLINE_TO_SELF_IDENTIFY` - DECLINE_TO_SELF_IDENTIFY

  • veteran_status (Merge::Ats::VeteranStatusEnum) (defaults to: OMIT)

    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

  • disability_status (Merge::Ats::DisabilityStatusEnum) (defaults to: OMIT)

    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

  • remote_was_deleted (Boolean) (defaults to: OMIT)

    Indicates whether or not this object has been deleted in the third party platform.

  • field_mappings (Hash{String => Object}) (defaults to: OMIT)
  • remote_data (Array<Merge::Ats::RemoteData>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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 =  if  != 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": ,
    "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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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

#candidateMerge::Ats::EeocCandidate (readonly)

Returns The candidate being represented.

Returns:



33
34
35
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 33

def candidate
  @candidate
end

#created_atDateTime (readonly)

Returns The datetime that this object was created by Merge.

Returns:

  • (DateTime)

    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_statusMerge::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.

Returns:

  • (Merge::Ats::DisabilityStatusEnum)

    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_mappingsHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


70
71
72
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 70

def field_mappings
  @field_mappings
end

#genderMerge::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.

Returns:

  • (Merge::Ats::GenderEnum)

    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

#idString (readonly)

Returns:

  • (String)


25
26
27
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 25

def id
  @id
end

#modified_atDateTime (readonly)

Returns The datetime that this object was modified by Merge.

Returns:

  • (DateTime)

    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

#raceMerge::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.

Returns:

  • (Merge::Ats::RaceEnum)

    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_dataArray<Merge::Ats::RemoteData> (readonly)

Returns:



72
73
74
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 72

def remote_data
  @remote_data
end

#remote_idString (readonly)

Returns The third-party API ID of the matching object.

Returns:

  • (String)

    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_deletedBoolean (readonly)

Returns Indicates whether or not this object has been deleted in the third party platform.

Returns:

  • (Boolean)

    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_atDateTime (readonly)

Returns When the information was submitted.

Returns:

  • (DateTime)

    When the information was submitted.



35
36
37
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 35

def 
  @submitted_at
end

#veteran_statusMerge::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.

Returns:

  • (Merge::Ats::VeteranStatusEnum)

    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

Parameters:

  • json_object (String)

Returns:



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
   = (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: ,
    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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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.&.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

Returns:

  • (String)


203
204
205
# File 'lib/merge_ruby_client/ats/types/eeoc.rb', line 203

def to_json(*_args)
  @_field_set&.to_json
end