-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathschemas.py
More file actions
393 lines (360 loc) · 14.6 KB
/
schemas.py
File metadata and controls
393 lines (360 loc) · 14.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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
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
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
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
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
import typing as t
from pydantic import BaseModel, Field
class LocationFields(BaseModel):
category: t.Optional[str]
city: t.Optional[str]
city_district: t.Optional[str]
country: t.Optional[str]
country_region: t.Optional[str]
entrance: t.Optional[str]
house: t.Optional[str]
house_number: t.Optional[str]
island: t.Optional[str]
level: t.Optional[str]
near: t.Optional[str]
po_box: t.Optional[str]
postcode: t.Optional[str]
road: t.Optional[str]
staircase: t.Optional[str]
state: t.Optional[str]
state_district: t.Optional[str]
suburb: t.Optional[str]
text: t.Optional[str]
unit: t.Optional[str]
world_region: t.Optional[str]
class Location(BaseModel):
text: t.Optional[str] = Field(None, description="Location text address.")
lat: t.Optional[float] = Field(
None, description="Geocentric latitude of the Location."
)
lng: t.Optional[float] = Field(
None, description="Geocentric longitude of the Location."
)
_fields: t.Optional[LocationFields] = Field(
None,
alias="fields",
description="Other location attributes like country, country_code etc",
)
class GeneralEntitySchema(BaseModel):
name: str = Field(..., description="Identification name of the Object")
value: t.Optional[str] = Field(
None, description="Value associated to the Object's name"
)
class Label(BaseModel):
board_key: str = Field(
description="Identification key of the Board containing the target Job."
)
job_key: str = Field(description="Identification key of the Job.")
job_reference: str = Field(description="Custom identifier of the Job.")
stage: t.Literal["yes", "no", "later"] = Field(
description=(
"Stage associated to the Profile following the action of a recruiter (yes,"
" no, later)."
)
)
date_stage: str = Field(
None, description="Date of the stage edit action. type: ('datetime ISO 8601')"
)
rating: t.Optional[t.Literal[1, 2, 3, 4, 5]] = Field(
description=(
"Rating associated to the Profile following the action of a recruiter (from"
" 1 to 5)."
)
)
date_rating: str = Field(
None, description="Date of the rating action. type: ('datetime ISO 8601')"
)
class Skill(BaseModel):
name: str = Field(..., description="Identification name of the skill")
type: t.Optional[str] = Field(None, description="Type of the skill. hard or soft")
value: t.Optional[str] = Field(None, description="Value associated to the skill")
# Job
class Section(BaseModel):
name: t.Optional[str] = Field(
None,
description="Identification name of a Section of the Job. Example: culture",
)
title: t.Optional[str] = Field(
None, description="Display Title of a Section. Example: Corporate Culture"
)
description: t.Optional[str] = Field(
None, description="Text description of a Section: Example: Our values areNone"
)
class RangesFloat(BaseModel):
name: t.Optional[str] = Field(
None,
description=(
"Identification name of a Range of floats attached "
"to the Job. Example: salary"
),
)
value_min: t.Optional[float] = Field(None, description="Min value. Example: 500.")
value_max: t.Optional[float] = Field(None, description="Max value. Example: 100.")
unit: t.Optional[str] = Field(
None, description="Unit of the value. Example: euros."
)
class RangesDate(BaseModel):
name: t.Optional[str] = Field(
None,
description=(
"Identification name of a Range of dates attached"
" to the Job. Example: availability."
),
)
value_min: t.Optional[str] = Field(
None, description="Min value in datetime ISO 8601, Example: 500."
)
value_max: t.Optional[str] = Field(
None, description="Max value in datetime ISO 8601, Example: 1000"
)
class Board(BaseModel):
key: str = Field(..., description="Identification key of the Board.")
name: str = Field(..., description="Name of the Board.")
type: str = Field(..., description="Type of the Board, Example: api, folder")
subtype: str = Field(
..., description="Subtype of the Board, Example: python, excel"
)
environment: str = Field(
..., description="Environment of the Board, Example: production, staging, test"
)
class HrFlowJob(BaseModel):
key: str = Field(None, description="Identification key of the Job.")
reference: t.Optional[str] = Field(
None, description="Custom identifier of the Job."
)
name: str = Field(..., description="Job title.")
board_key: str = Field(
..., description="Identification key of the Board attached to the Job."
)
location: Location = Field(..., description="Job location object.")
sections: t.List[Section] = Field(None, description="Job custom sections.")
culture: t.Optional[str] = Field(
None, description="Describes the company's values, work environment, and ethos."
)
benefits: t.Optional[str] = Field(
None, description="Lists the perks and advantages offered to employees."
)
responsibilities: t.Optional[str] = Field(
None, description="Outlines the duties and tasks expected from the role."
)
requirements: t.Optional[str] = Field(
None,
description="Specifies the qualifications and skills needed for the position.",
)
interviews: t.Optional[str] = Field(
None, description="Provides information about the interview process and stages."
)
url: t.Optional[str] = Field(None, description="Job post original URL.")
summary: t.Optional[str] = Field(None, description="Brief summary of the Job.")
board: t.Optional[Board]
archived_at: t.Optional[str] = Field(
None,
description=(
"type: datetime ISO8601, Archive date of the Job. "
"The value is null for unarchived Jobs."
),
)
updated_at: str = Field(
None, description="type: datetime ISO8601, Last update date of the Job."
)
created_at: t.Optional[str] = Field(
None, description="type: datetime ISO8601, Creation date of the Job."
)
skills: t.Optional[t.List[Skill]] = Field(
None, description="List of skills of the Job."
)
languages: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of spoken languages of the Job"
)
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of certifications of the Job."
)
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of courses of the Job"
)
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of tasks of the Job"
)
tags: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of tags of the Job"
)
metadatas: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of metadatas of the Job"
)
ranges_float: t.Optional[t.List[RangesFloat]] = Field(
None, description="List of ranges of floats"
)
ranges_date: t.Optional[t.List[RangesDate]] = Field(
None, description="List of ranges of dates"
)
# Profile
class Url(BaseModel):
type: t.Optional[
t.Literal["from_resume", "linkedin", "twitter", "facebook", "github"]
]
url: t.Optional[str]
class ProfileInfo(BaseModel):
full_name: t.Optional[str] = Field(None, description="Profile full name")
first_name: t.Optional[str] = Field(None, description="Profile first name")
last_name: t.Optional[str] = Field(None, description="Profile last name")
email: t.Optional[str] = Field(None, description="Profile email")
phone: t.Optional[str] = Field(None, description="Profile phone number")
date_birth: t.Optional[str] = Field(None, description="Profile date of birth")
location: t.Optional[Location] = Field(None, description="Profile location object")
urls: t.Optional[t.List[Url]] = Field(
None, description="Profile social networks and URLs"
)
picture: t.Optional[str] = Field(None, description="Profile picture url")
gender: t.Optional[str] = Field(None, description="Profile gender")
summary: t.Optional[str] = Field(None, description="Profile summary text")
class Experience(BaseModel):
key: t.Optional[str] = Field(
None, description="Identification key of the Experience."
)
company: t.Optional[str] = Field(
None, description="Company name of the Experience."
)
logo: t.Optional[str] = Field(None, description="Logo of the Company.")
title: t.Optional[str] = Field(None, description="Title of the Experience.")
description: t.Optional[str] = Field(
None, description="Description of the Experience."
)
location: t.Optional[Location] = Field(
None, description="Location object of the Experience."
)
date_start: t.Optional[str] = Field(
None, description="Start date of the experience. type: ('datetime ISO 8601')"
)
date_end: t.Optional[str] = Field(
None, description="End date of the experience. type: ('datetime ISO 8601')"
)
skills: t.Optional[t.List[Skill]] = Field(
None, description="List of skills of the Experience."
)
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of certifications of the Experience."
)
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of courses of the Experience."
)
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of tasks of the Experience."
)
languages: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of spoken languages of the profile"
)
interests: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of interests of the Experience."
)
class Education(BaseModel):
key: t.Optional[str] = Field(
None, description="Identification key of the Education."
)
school: t.Optional[str] = Field(None, description="School name of the Education.")
logo: t.Optional[str] = Field(None, description="Logo of the School.")
title: t.Optional[str] = Field(None, description="Title of the Education.")
description: t.Optional[str] = Field(
None, description="Description of the Education."
)
location: t.Optional[Location] = Field(
None, description="Location object of the Education."
)
date_start: t.Optional[str] = Field(
None, description="Start date of the Education. type: ('datetime ISO 8601')"
)
date_end: t.Optional[str] = Field(
None, description="End date of the Education. type: ('datetime ISO 8601')"
)
skills: t.Optional[t.List[Skill]] = Field(
None, description="List of skills of the Education."
)
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of certifications of the Education."
)
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of courses of the Education."
)
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of tasks of the Education."
)
languages: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of spoken languages of the profile"
)
interests: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of interests of the Experience."
)
class Attachment(BaseModel):
type: t.Optional[str]
alt: t.Optional[str]
file_size: t.Optional[str]
file_name: t.Optional[str]
original_file_name: t.Optional[str]
extension: t.Optional[str]
public_url: t.Optional[str]
updated_at: t.Optional[str]
created_at: t.Optional[str]
class HrFlowProfile(BaseModel):
key: str = Field(None, description="Identification key of the Profile.")
reference: t.Optional[str] = Field(
None, description="Custom identifier of the Profile."
)
info: ProfileInfo = Field(..., description="Object containing the Profile's info.")
text_language: t.Optional[str] = Field(
None, description="Code language of the Profile. type: string code ISO 639-1"
)
text: str = Field(..., description="Full text of the Profile..")
archived_at: t.Optional[str] = Field(
None,
description=(
"type: datetime ISO8601, Archive date of the Profile."
" The value is null for unarchived Profiles."
),
)
updated_at: str = Field(
None, description="type: datetime ISO8601, Last update date of the Profile."
)
created_at: str = Field(
None, description="type: datetime ISO8601, Creation date of the Profile."
)
experiences_duration: float = Field(
None, description="Total number of years of experience."
)
educations_duration: float = Field(
None, description="Total number of years of education."
)
experiences: t.Optional[t.List[Experience]] = Field(
None, description="List of experiences of the Profile."
)
educations: t.Optional[t.List[Education]] = Field(
None, description="List of educations of the Profile."
)
attachments: t.List[Attachment] = Field(
None, description="List of documents attached to the Profile."
)
skills: t.Optional[t.List[Skill]] = Field(
None, description="List of skills of the Profile."
)
languages: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of spoken languages of the profile"
)
certifications: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of certifications of the Profile."
)
courses: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of courses of the Profile."
)
tasks: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of tasks of the Profile."
)
interests: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of interests of the Profile."
)
tags: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of tags of the Profile."
)
metadatas: t.Optional[t.List[GeneralEntitySchema]] = Field(
None, description="List of metadatas of the Profile."
)
labels: t.Optional[t.List[Label]] = Field(
None, description="List of labels of the Profile."
)