Skip to content

Commit 482f1c0

Browse files
committed
update applicant and get logs fix
1 parent 713f709 commit 482f1c0

6 files changed

Lines changed: 19 additions & 12 deletions

File tree

huntflow_api_client/entities/applicants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ async def patch(
108108
response = await self._api.request(
109109
"PATCH",
110110
f"/accounts/{account_id}/applicants/{applicant_id}",
111-
json=data.jsonable_dict(exclude_none=True),
111+
json=data.jsonable_dict(exclude_none=True, exclude_unset=True),
112112
)
113113
return ApplicantItem.model_validate(response.json())
114114

huntflow_api_client/models/common.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
EmailContactType,
1111
EventReminderMultiplier,
1212
MemberType,
13-
VacancyState,
13+
VacancyState, CalendarEventStatus,
1414
)
1515

1616
_FieldSet: typing_extensions.TypeAlias = "Set[int] | Set[str] | Dict[int, Any] | Dict[str, Any]"
@@ -234,14 +234,21 @@ class CalendarEventReminder(BaseModel):
234234
method: CalendarEventReminderMethod = Field(..., description="Reminder method")
235235

236236

237-
class CalendarEventAttendee(BaseModel):
237+
class CalendarEventAttendeeRequest(BaseModel):
238238
member: Optional[PositiveInt] = Field(None, description="Coworker ID")
239239
name: Optional[str] = Field(None, description="Attendee name", alias="displayName")
240240
email: EmailStr = Field(..., description="Attendee email")
241241

242242
model_config = ConfigDict(populate_by_name=True)
243243

244244

245+
class CalendarEventAttendeeResponse(CalendarEventAttendeeRequest):
246+
status: Optional[CalendarEventStatus] = Field(
247+
None,
248+
alias="responseStatus",
249+
)
250+
251+
245252
class SurveyQuestionaryRespondent(BaseModel):
246253
applicant_id: int = Field(..., description="Applicant ID")
247254

huntflow_api_client/models/request/applicant_logs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
ApplicantLogIm,
99
ApplicantLogSms,
1010
ApplicantOffer,
11-
CalendarEventAttendee,
11+
CalendarEventAttendeeRequest,
1212
CalendarEventReminder,
1313
JsonRequestModel,
1414
)
@@ -25,7 +25,7 @@ class ApplicantLogCalendarEvent(BaseModel):
2525
event_type: CalendarEventType = Field(..., description="Calendar event type")
2626
description: Optional[str] = Field(None, description="Event description (comment)")
2727
calendar: PositiveInt = Field(..., description="Calendar ID")
28-
attendees: List[CalendarEventAttendee] = Field(
28+
attendees: List[CalendarEventAttendeeRequest] = Field(
2929
...,
3030
description="Event attendees (participants)",
3131
)

huntflow_api_client/models/request/applicants.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from huntflow_api_client.models.common import (
77
Applicant,
8-
CalendarEventAttendee,
8+
CalendarEventAttendeeRequest,
99
CalendarEventReminder,
1010
JsonRequestModel,
1111
)
@@ -48,7 +48,7 @@ class ApplicantCreateRequest(Applicant, JsonRequestModel):
4848
class ApplicantUpdateRequest(Applicant, JsonRequestModel):
4949
birthday: Optional[date] = Field(None, description="Date of birth")
5050
social: Optional[List[ApplicantSocial]] = Field(
51-
None,
51+
[],
5252
max_length=1,
5353
description="List of applicant's social accounts",
5454
)
@@ -67,7 +67,7 @@ class ApplicantEvent(BaseModel):
6767
event_type: CalendarEventType = Field(..., description="Calendar event type")
6868
description: Optional[str] = Field(None, description="Event description (comment)")
6969
calendar: PositiveInt = Field(..., description="Calendar ID")
70-
attendees: List[CalendarEventAttendee] = Field(
70+
attendees: List[CalendarEventAttendeeRequest] = Field(
7171
...,
7272
description="Event attendees (participants)",
7373
)

huntflow_api_client/models/response/applicant_logs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
from huntflow_api_client.models.common import (
77
ApplicantOffer,
8-
CalendarEventAttendee,
8+
CalendarEventAttendeeRequest,
99
File,
1010
PaginatedResponse,
11-
VacancyQuotaItem,
11+
VacancyQuotaItem, CalendarEventAttendeeResponse,
1212
)
1313
from huntflow_api_client.models.consts import (
1414
ApplicantLogType,
@@ -111,7 +111,7 @@ class ApplicantLogCalendarEvent(BaseModel):
111111
)
112112
foreign: Optional[str] = Field(None, description="Foreign ID of event")
113113
location: Optional[str] = Field(None, description="Event location")
114-
attendees: List[CalendarEventAttendee] = Field(
114+
attendees: List[CalendarEventAttendeeResponse] = Field(
115115
[],
116116
description="Event attendees (participants)",
117117
)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[project]
33
name = "huntflow-api-client"
4-
version = "0.1.4"
4+
version = "0.1.5"
55
description = "Huntflow API Client for Python"
66
authors = [
77
{name = "Developers huntflow", email = "developer@huntflow.ru"},

0 commit comments

Comments
 (0)