Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion huntflow_api_client/entities/applicants.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ async def patch(
response = await self._api.request(
"PATCH",
f"/accounts/{account_id}/applicants/{applicant_id}",
json=data.jsonable_dict(exclude_none=True),
json=data.jsonable_dict(exclude_unset=True),
)
return ApplicantItem.model_validate(response.json())

Expand Down
10 changes: 9 additions & 1 deletion huntflow_api_client/models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from huntflow_api_client.models.consts import (
CalendarEventReminderMethod,
CalendarEventStatus,
EmailContactType,
EventReminderMultiplier,
MemberType,
Expand Down Expand Up @@ -234,14 +235,21 @@ class CalendarEventReminder(BaseModel):
method: CalendarEventReminderMethod = Field(..., description="Reminder method")


class CalendarEventAttendee(BaseModel):
class CalendarEventAttendeeRequest(BaseModel):
member: Optional[PositiveInt] = Field(None, description="Coworker ID")
name: Optional[str] = Field(None, description="Attendee name", alias="displayName")
email: str = Field(..., description="Attendee email")

model_config = ConfigDict(populate_by_name=True)


class CalendarEventAttendeeResponse(CalendarEventAttendeeRequest):
status: Optional[CalendarEventStatus] = Field(
None,
alias="responseStatus",
)


class SurveyQuestionaryRespondent(BaseModel):
applicant_id: int = Field(..., description="Applicant ID")

Expand Down
4 changes: 2 additions & 2 deletions huntflow_api_client/models/request/applicant_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ApplicantLogIm,
ApplicantLogSms,
ApplicantOffer,
CalendarEventAttendee,
CalendarEventAttendeeRequest,
CalendarEventReminder,
JsonRequestModel,
)
Expand All @@ -25,7 +25,7 @@ class ApplicantLogCalendarEvent(BaseModel):
event_type: CalendarEventType = Field(..., description="Calendar event type")
description: Optional[str] = Field(None, description="Event description (comment)")
calendar: PositiveInt = Field(..., description="Calendar ID")
attendees: List[CalendarEventAttendee] = Field(
attendees: List[CalendarEventAttendeeRequest] = Field(
...,
description="Event attendees (participants)",
)
Expand Down
4 changes: 2 additions & 2 deletions huntflow_api_client/models/request/applicants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from huntflow_api_client.models.common import (
Applicant,
CalendarEventAttendee,
CalendarEventAttendeeRequest,
CalendarEventReminder,
JsonRequestModel,
)
Expand Down Expand Up @@ -67,7 +67,7 @@ class ApplicantEvent(BaseModel):
event_type: CalendarEventType = Field(..., description="Calendar event type")
description: Optional[str] = Field(None, description="Event description (comment)")
calendar: PositiveInt = Field(..., description="Calendar ID")
attendees: List[CalendarEventAttendee] = Field(
attendees: List[CalendarEventAttendeeRequest] = Field(
...,
description="Event attendees (participants)",
)
Expand Down
4 changes: 2 additions & 2 deletions huntflow_api_client/models/response/applicant_logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from huntflow_api_client.models.common import (
ApplicantOffer,
CalendarEventAttendee,
CalendarEventAttendeeResponse,
File,
PaginatedResponse,
VacancyQuotaItem,
Expand Down Expand Up @@ -111,7 +111,7 @@ class ApplicantLogCalendarEvent(BaseModel):
)
foreign: Optional[str] = Field(None, description="Foreign ID of event")
location: Optional[str] = Field(None, description="Event location")
attendees: List[CalendarEventAttendee] = Field(
attendees: List[CalendarEventAttendeeResponse] = Field(
[],
description="Event attendees (participants)",
)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

[project]
name = "huntflow-api-client"
version = "2.13.0"
version = "2.13.1"
description = "Huntflow API Client for Python"
authors = [
{name = "Developers huntflow", email = "developer@huntflow.ru"},
Expand Down
4 changes: 3 additions & 1 deletion tests/test_entities/test_applicants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from typing import Any, Dict

from pytest_httpx import HTTPXMock
Expand Down Expand Up @@ -201,7 +202,7 @@
},
],
}
APPLICANT_PATCH_REQUEST: Dict[str, Any] = {"first_name": "Newname"}
APPLICANT_PATCH_REQUEST: Dict[str, Any] = {"first_name": "Newname", "social": []}
APPLICANT_PATCH_RESPONSE: Dict[str, Any] = {
"first_name": "Newname",
"last_name": "Doe",
Expand Down Expand Up @@ -332,6 +333,7 @@ async def test_patch_applicant(
) -> None:
httpx_mock.add_response(
url=f"{VERSIONED_BASE_URL}/accounts/{ACCOUNT_ID}/applicants/{APPLICANT_ID}",
match_content=json.dumps(APPLICANT_PATCH_REQUEST).encode(),
json=APPLICANT_PATCH_RESPONSE,
)
api_client = HuntflowAPI(BASE_URL, token_proxy=token_proxy)
Expand Down
Loading