Class: Merge::Ats::Job
- Inherits:
-
Object
- Object
- Merge::Ats::Job
- Defined in:
- lib/merge_ruby_client/ats/types/job.rb
Overview
# The Job Object
### Description
The `Job` object can be used to track any jobs that are currently or will be
open/closed for applications.
### Usage Example
Fetch from the `LIST Jobs` endpoint to show all job postings.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#code ⇒ String
readonly
The job’s code.
-
#confidential ⇒ Boolean
readonly
Whether the job is confidential.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
-
#departments ⇒ Array<Merge::Ats::JobDepartmentsItem>
readonly
IDs of ‘Department` objects for this `Job`.
-
#description ⇒ String
readonly
The job’s description.
- #field_mappings ⇒ Hash{String => Object} readonly
-
#hiring_managers ⇒ Array<Merge::Ats::JobHiringManagersItem>
readonly
IDs of ‘RemoteUser` objects that serve as hiring managers for this `Job`.
- #id ⇒ String readonly
- #job_posting_urls ⇒ Array<Merge::Ats::Url> readonly
-
#job_postings ⇒ Array<String>
readonly
IDs of ‘JobPosting` objects that serve as job postings for this `Job`.
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
-
#name ⇒ String
readonly
The job’s name.
-
#offices ⇒ Array<Merge::Ats::JobOfficesItem>
readonly
IDs of ‘Office` objects for this `Job`.
-
#recruiters ⇒ Array<Merge::Ats::JobRecruitersItem>
readonly
IDs of ‘RemoteUser` objects that serve as recruiters for this `Job`.
-
#remote_created_at ⇒ DateTime
readonly
When the third party’s job 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 job was updated.
-
#remote_was_deleted ⇒ Boolean
readonly
Indicates whether or not this object has been deleted in the third party platform.
-
#status ⇒ Merge::Ats::JobStatusEnum
readonly
The job’s status.
-
#type ⇒ Merge::Ats::JobTypeEnum
readonly
The job’s type.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Ats::Job
Deserialize a JSON object to an instance of Job.
-
.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, name: OMIT, description: OMIT, code: OMIT, status: OMIT, type: OMIT, job_postings: OMIT, job_posting_urls: OMIT, remote_created_at: OMIT, remote_updated_at: OMIT, confidential: OMIT, departments: OMIT, offices: OMIT, hiring_managers: OMIT, recruiters: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Ats::Job constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Job to a JSON object.
Constructor Details
#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, name: OMIT, description: OMIT, code: OMIT, status: OMIT, type: OMIT, job_postings: OMIT, job_posting_urls: OMIT, remote_created_at: OMIT, remote_updated_at: OMIT, confidential: OMIT, departments: OMIT, offices: OMIT, hiring_managers: OMIT, recruiters: OMIT, remote_was_deleted: OMIT, field_mappings: OMIT, remote_data: OMIT, additional_properties: nil) ⇒ Merge::Ats::Job
117 118 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 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 117 def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, name: OMIT, description: OMIT, code: OMIT, status: OMIT, type: OMIT, job_postings: OMIT, job_posting_urls: OMIT, remote_created_at: OMIT, remote_updated_at: OMIT, confidential: OMIT, departments: OMIT, offices: OMIT, hiring_managers: OMIT, recruiters: 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 @name = name if name != OMIT @description = description if description != OMIT @code = code if code != OMIT @status = status if status != OMIT @type = type if type != OMIT @job_postings = job_postings if job_postings != OMIT @job_posting_urls = job_posting_urls if job_posting_urls != OMIT @remote_created_at = remote_created_at if remote_created_at != OMIT @remote_updated_at = remote_updated_at if remote_updated_at != OMIT @confidential = confidential if confidential != OMIT @departments = departments if departments != OMIT @offices = offices if offices != OMIT @hiring_managers = hiring_managers if hiring_managers != OMIT @recruiters = recruiters if recruiters != 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, "name": name, "description": description, "code": code, "status": status, "type": type, "job_postings": job_postings, "job_posting_urls": job_posting_urls, "remote_created_at": remote_created_at, "remote_updated_at": remote_updated_at, "confidential": confidential, "departments": departments, "offices": offices, "hiring_managers": hiring_managers, "recruiters": recruiters, "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.
77 78 79 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 77 def additional_properties @additional_properties end |
#code ⇒ String (readonly)
Returns The job’s code. Typically an additional identifier used to reference the particular job that is displayed on the ATS.
38 39 40 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 38 def code @code end |
#confidential ⇒ Boolean (readonly)
Returns Whether the job is confidential.
60 61 62 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 60 def confidential @confidential 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/job.rb', line 29 def created_at @created_at end |
#departments ⇒ Array<Merge::Ats::JobDepartmentsItem> (readonly)
Returns IDs of ‘Department` objects for this `Job`.
62 63 64 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 62 def departments @departments end |
#description ⇒ String (readonly)
Returns The job’s description.
35 36 37 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 35 def description @description end |
#field_mappings ⇒ Hash{String => Object} (readonly)
73 74 75 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 73 def field_mappings @field_mappings end |
#hiring_managers ⇒ Array<Merge::Ats::JobHiringManagersItem> (readonly)
Returns IDs of ‘RemoteUser` objects that serve as hiring managers for this `Job`.
66 67 68 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 66 def hiring_managers @hiring_managers end |
#id ⇒ String (readonly)
25 26 27 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 25 def id @id end |
#job_posting_urls ⇒ Array<Merge::Ats::Url> (readonly)
54 55 56 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 54 def job_posting_urls @job_posting_urls end |
#job_postings ⇒ Array<String> (readonly)
Returns IDs of ‘JobPosting` objects that serve as job postings for this `Job`.
52 53 54 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 52 def job_postings @job_postings 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/job.rb', line 31 def modified_at @modified_at end |
#name ⇒ String (readonly)
Returns The job’s name.
33 34 35 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 33 def name @name end |
#offices ⇒ Array<Merge::Ats::JobOfficesItem> (readonly)
Returns IDs of ‘Office` objects for this `Job`.
64 65 66 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 64 def offices @offices end |
#recruiters ⇒ Array<Merge::Ats::JobRecruitersItem> (readonly)
Returns IDs of ‘RemoteUser` objects that serve as recruiters for this `Job`.
68 69 70 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 68 def recruiters @recruiters end |
#remote_created_at ⇒ DateTime (readonly)
Returns When the third party’s job was created.
56 57 58 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 56 def remote_created_at @remote_created_at end |
#remote_data ⇒ Array<Merge::Ats::RemoteData> (readonly)
75 76 77 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 75 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/job.rb', line 27 def remote_id @remote_id end |
#remote_updated_at ⇒ DateTime (readonly)
Returns When the third party’s job was updated.
58 59 60 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 58 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.
71 72 73 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 71 def remote_was_deleted @remote_was_deleted end |
#status ⇒ Merge::Ats::JobStatusEnum (readonly)
Returns The job’s status.
-
‘OPEN` - OPEN
-
‘CLOSED` - CLOSED
-
‘DRAFT` - DRAFT
-
‘ARCHIVED` - ARCHIVED
-
‘PENDING` - PENDING.
45 46 47 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 45 def status @status end |
#type ⇒ Merge::Ats::JobTypeEnum (readonly)
Returns The job’s type.
-
‘POSTING` - POSTING
-
‘REQUISITION` - REQUISITION
-
‘PROFILE` - PROFILE.
50 51 52 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 50 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Ats::Job
Deserialize a JSON object to an instance of Job
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 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 172 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?) name = parsed_json["name"] description = parsed_json["description"] code = parsed_json["code"] status = parsed_json["status"] type = parsed_json["type"] job_postings = parsed_json["job_postings"] job_posting_urls = parsed_json["job_posting_urls"]&.map do |item| item = item.to_json Merge::Ats::Url.from_json(json_object: item) end 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 confidential = parsed_json["confidential"] departments = parsed_json["departments"]&.map do |item| item = item.to_json Merge::Ats::JobDepartmentsItem.from_json(json_object: item) end offices = parsed_json["offices"]&.map do |item| item = item.to_json Merge::Ats::JobOfficesItem.from_json(json_object: item) end hiring_managers = parsed_json["hiring_managers"]&.map do |item| item = item.to_json Merge::Ats::JobHiringManagersItem.from_json(json_object: item) end recruiters = parsed_json["recruiters"]&.map do |item| item = item.to_json Merge::Ats::JobRecruitersItem.from_json(json_object: item) end 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, name: name, description: description, code: code, status: status, type: type, job_postings: job_postings, job_posting_urls: job_posting_urls, remote_created_at: remote_created_at, remote_updated_at: remote_updated_at, confidential: confidential, departments: departments, offices: offices, hiring_managers: hiring_managers, recruiters: recruiters, 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.
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 257 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.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.code&.is_a?(String) != false || raise("Passed value for field obj.code is not the expected type, validation failed.") obj.status&.is_a?(Merge::Ats::JobStatusEnum) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.type&.is_a?(Merge::Ats::JobTypeEnum) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.job_postings&.is_a?(Array) != false || raise("Passed value for field obj.job_postings is not the expected type, validation failed.") obj.job_posting_urls&.is_a?(Array) != false || raise("Passed value for field obj.job_posting_urls 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.confidential&.is_a?(Boolean) != false || raise("Passed value for field obj.confidential is not the expected type, validation failed.") obj.departments&.is_a?(Array) != false || raise("Passed value for field obj.departments is not the expected type, validation failed.") obj.offices&.is_a?(Array) != false || raise("Passed value for field obj.offices is not the expected type, validation failed.") obj.hiring_managers&.is_a?(Array) != false || raise("Passed value for field obj.hiring_managers is not the expected type, validation failed.") obj.recruiters&.is_a?(Array) != false || raise("Passed value for field obj.recruiters 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 Job to a JSON object
247 248 249 |
# File 'lib/merge_ruby_client/ats/types/job.rb', line 247 def to_json(*_args) @_field_set&.to_json end |