Class: Merge::Ats::ScheduledInterview
- Inherits:
-
Object
- Object
- Merge::Ats::ScheduledInterview
- Defined in:
- lib/merge_ruby_client/ats/types/scheduled_interview.rb
Overview
# The ScheduledInterview Object
### Description
The `ScheduledInterview` object is used to represent a scheduled interview for a
given candidate’s application to a job. An `Application` can have multiple
`ScheduledInterview`s depending on the particular hiring process.
### Usage Example
Fetch from the `LIST ScheduledInterviews` endpoint and filter by `interviewers`
to show all office locations.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#application ⇒ Merge::Ats::ScheduledInterviewApplication
readonly
The application being interviewed.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
-
#end_at ⇒ DateTime
readonly
When the interview was ended.
- #field_mappings ⇒ Hash{String => Object} readonly
- #id ⇒ String readonly
-
#interviewers ⇒ Array<Merge::Ats::ScheduledInterviewInterviewersItem>
readonly
Array of ‘RemoteUser` IDs.
-
#job_interview_stage ⇒ Merge::Ats::ScheduledInterviewJobInterviewStage
readonly
The stage of the interview.
-
#location ⇒ String
readonly
The interview’s location.
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
-
#organizer ⇒ Merge::Ats::ScheduledInterviewOrganizer
readonly
The user organizing the interview.
-
#remote_created_at ⇒ DateTime
readonly
When the third party’s interview was created.
- #remote_data ⇒ Array<Merge::Ats::RemoteData> readonly
-
#remote_id ⇒ String
readonly
The third-party API ID of the matching object.
-
#remote_updated_at ⇒ DateTime
readonly
When the third party’s interview was updated.
-
#remote_was_deleted ⇒ Boolean
readonly
Indicates whether or not this object has been deleted in the third party platform.
-
#start_at ⇒ DateTime
readonly
When the interview was started.
-
#status ⇒ Merge::Ats::ScheduledInterviewStatusEnum
readonly
The interview’s status.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::ScheduledInterview
Deserialize a JSON object to an instance of ScheduledInterview.
-
.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, application: OMIT, job_interview_stage: OMIT, organizer: OMIT, interviewers: OMIT, location: OMIT, start_at: OMIT, end_at: OMIT, remote_created_at: OMIT, remote_updated_at: OMIT, status: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Ats::ScheduledInterview constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of ScheduledInterview to a JSON object.
Constructor Details
#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, application: OMIT, job_interview_stage: OMIT, organizer: OMIT, interviewers: OMIT, location: OMIT, start_at: OMIT, end_at: OMIT, remote_created_at: OMIT, remote_updated_at: OMIT, status: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Ats::ScheduledInterview
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 93 def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, application: OMIT, job_interview_stage: OMIT, organizer: OMIT, interviewers: OMIT, location: OMIT, start_at: OMIT, end_at: OMIT, remote_created_at: OMIT, remote_updated_at: OMIT, 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 @application = application if application != OMIT @job_interview_stage = job_interview_stage if job_interview_stage != OMIT @organizer = organizer if organizer != OMIT @interviewers = interviewers if interviewers != OMIT @location = location if location != OMIT @start_at = start_at if start_at != OMIT @end_at = end_at if end_at != OMIT @remote_created_at = remote_created_at if remote_created_at != OMIT @remote_updated_at = remote_updated_at if remote_updated_at != OMIT @status = status if 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, "application": application, "job_interview_stage": job_interview_stage, "organizer": organizer, "interviewers": interviewers, "location": location, "start_at": start_at, "end_at": end_at, "remote_created_at": remote_created_at, "remote_updated_at": remote_updated_at, "status": 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.
63 64 65 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 63 def additional_properties @additional_properties end |
#application ⇒ Merge::Ats::ScheduledInterviewApplication (readonly)
Returns The application being interviewed.
33 34 35 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 33 def application @application 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/scheduled_interview.rb', line 29 def created_at @created_at end |
#end_at ⇒ DateTime (readonly)
Returns When the interview was ended.
45 46 47 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 45 def end_at @end_at end |
#field_mappings ⇒ Hash{String => Object} (readonly)
59 60 61 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 59 def field_mappings @field_mappings end |
#id ⇒ String (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 25 def id @id end |
#interviewers ⇒ Array<Merge::Ats::ScheduledInterviewInterviewersItem> (readonly)
Returns Array of ‘RemoteUser` IDs.
39 40 41 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 39 def interviewers @interviewers end |
#job_interview_stage ⇒ Merge::Ats::ScheduledInterviewJobInterviewStage (readonly)
Returns The stage of the interview.
35 36 37 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 35 def job_interview_stage @job_interview_stage end |
#location ⇒ String (readonly)
Returns The interview’s location.
41 42 43 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 41 def location @location 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/scheduled_interview.rb', line 31 def modified_at @modified_at end |
#organizer ⇒ Merge::Ats::ScheduledInterviewOrganizer (readonly)
Returns The user organizing the interview.
37 38 39 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 37 def organizer @organizer end |
#remote_created_at ⇒ DateTime (readonly)
Returns When the third party’s interview was created.
47 48 49 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 47 def remote_created_at @remote_created_at end |
#remote_data ⇒ Array<Merge::Ats::RemoteData> (readonly)
61 62 63 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 61 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/scheduled_interview.rb', line 27 def remote_id @remote_id end |
#remote_updated_at ⇒ DateTime (readonly)
Returns When the third party’s interview was updated.
49 50 51 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 49 def remote_updated_at @remote_updated_at end |
#remote_was_deleted ⇒ Boolean (readonly)
Returns Indicates whether or not this object has been deleted in the third party platform.
57 58 59 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 57 def remote_was_deleted @remote_was_deleted end |
#start_at ⇒ DateTime (readonly)
Returns When the interview was started.
43 44 45 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 43 def start_at @start_at end |
#status ⇒ Merge::Ats::ScheduledInterviewStatusEnum (readonly)
Returns The interview’s status.
-
‘SCHEDULED` - SCHEDULED
-
‘AWAITING_FEEDBACK` - AWAITING_FEEDBACK
-
‘COMPLETE` - COMPLETE.
54 55 56 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 54 def status @status end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ats::ScheduledInterview
Deserialize a JSON object to an instance of ScheduledInterview
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 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 199 200 201 202 203 204 205 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 140 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["application"].nil? application = nil else application = parsed_json["application"].to_json application = Merge::Ats::ScheduledInterviewApplication.from_json(json_object: application) end if parsed_json["job_interview_stage"].nil? job_interview_stage = nil else job_interview_stage = parsed_json["job_interview_stage"].to_json job_interview_stage = Merge::Ats::ScheduledInterviewJobInterviewStage.from_json(json_object: job_interview_stage) end if parsed_json["organizer"].nil? organizer = nil else organizer = parsed_json["organizer"].to_json organizer = Merge::Ats::ScheduledInterviewOrganizer.from_json(json_object: organizer) end interviewers = parsed_json["interviewers"]&.map do |item| item = item.to_json Merge::Ats::ScheduledInterviewInterviewersItem.from_json(json_object: item) end location = parsed_json["location"] start_at = (DateTime.parse(parsed_json["start_at"]) unless parsed_json["start_at"].nil?) end_at = (DateTime.parse(parsed_json["end_at"]) unless parsed_json["end_at"].nil?) remote_created_at = unless parsed_json["remote_created_at"].nil? DateTime.parse(parsed_json["remote_created_at"]) end remote_updated_at = unless parsed_json["remote_updated_at"].nil? DateTime.parse(parsed_json["remote_updated_at"]) end status = parsed_json["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, application: application, job_interview_stage: job_interview_stage, organizer: organizer, interviewers: interviewers, location: location, start_at: start_at, end_at: end_at, remote_created_at: remote_created_at, remote_updated_at: remote_updated_at, status: 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.
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 220 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.application.nil? || Merge::Ats::ScheduledInterviewApplication.validate_raw(obj: obj.application) obj.job_interview_stage.nil? || Merge::Ats::ScheduledInterviewJobInterviewStage.validate_raw(obj: obj.job_interview_stage) obj.organizer.nil? || Merge::Ats::ScheduledInterviewOrganizer.validate_raw(obj: obj.organizer) obj.interviewers&.is_a?(Array) != false || raise("Passed value for field obj.interviewers is not the expected type, validation failed.") obj.location&.is_a?(String) != false || raise("Passed value for field obj.location is not the expected type, validation failed.") obj.start_at&.is_a?(DateTime) != false || raise("Passed value for field obj.start_at is not the expected type, validation failed.") obj.end_at&.is_a?(DateTime) != false || raise("Passed value for field obj.end_at is not the expected type, validation failed.") obj.remote_created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.remote_created_at is not the expected type, validation failed.") obj.remote_updated_at&.is_a?(DateTime) != false || raise("Passed value for field obj.remote_updated_at is not the expected type, validation failed.") obj.status&.is_a?(Merge::Ats::ScheduledInterviewStatusEnum) != false || raise("Passed value for field obj.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 ScheduledInterview to a JSON object
210 211 212 |
# File 'lib/merge_ruby_client/ats/types/scheduled_interview.rb', line 210 def to_json(*_args) @_field_set&.to_json end |