Skip to content

Commit 631bcef

Browse files
authored
Merge pull request #115 from huntflow/DEV-22328_client_to_hfapi
[DEV-22328] - client to hfapi2
2 parents 48cc600 + 9d694b7 commit 631bcef

File tree

17 files changed

+68
-31
lines changed

17 files changed

+68
-31
lines changed

huntflow_api_client/entities/applicant_on_vacancy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,6 @@ async def move_applicant_to_child_vacancy(
7777
response = await self._api.request(
7878
"PUT",
7979
f"/accounts/{account_id}/applicants/vacancy/{vacancy_id}/split",
80-
json=data.jsonable_dict(exclude_none=True),
80+
json=data.jsonable_dict(exclude_unset=True),
8181
)
8282
return ApplicantVacancySplitResponse.model_validate(response.json())

huntflow_api_client/entities/applicants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
GetEntityMixin,
77
ListEntityMixin,
88
)
9-
from huntflow_api_client.models.consts import AgreementState, ApplicantSearchField
9+
from huntflow_api_client.models.consts import AgreementStateRequest, ApplicantSearchField
1010
from huntflow_api_client.models.request.applicants import (
1111
ApplicantCreateRequest,
1212
ApplicantUpdateRequest,
@@ -29,7 +29,7 @@ async def list(
2929
page: Optional[int] = 1,
3030
status: Optional[int] = None,
3131
vacancy_id: Optional[int] = None,
32-
agreement_state: Optional[AgreementState] = None,
32+
agreement_state: Optional[AgreementStateRequest] = None,
3333
) -> ApplicantListResponse:
3434
"""
3535
API method reference https://api.huntflow.ai/v2/docs#get-/accounts/-account_id-/applicants

huntflow_api_client/entities/dictionaries.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ async def create(
4343
:return: An object that contains the task ID of the delayed background update task
4444
"""
4545
path = f"/accounts/{account_id}/dictionaries"
46-
response = await self._api.request("POST", path, json=data.jsonable_dict(exclude_none=True))
46+
response = await self._api.request(
47+
"POST",
48+
path,
49+
json=data.jsonable_dict(exclude_unset=True),
50+
)
4751
return DictionaryTaskResponse.model_validate(response.json())
4852

4953
async def get(self, account_id: int, dict_code: str) -> DictionaryResponse:
@@ -75,5 +79,5 @@ async def update(
7579
:return: An object that contains the task ID of the delayed background update task
7680
"""
7781
path = f"/accounts/{account_id}/dictionaries/{dict_code}"
78-
response = await self._api.request("PUT", path, json=data.jsonable_dict(exclude_none=True))
82+
response = await self._api.request("PUT", path, json=data.jsonable_dict(exclude_unset=True))
7983
return DictionaryTaskResponse.model_validate(response.json())

huntflow_api_client/entities/multi_vacancies.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ async def create(
2626
response = await self._api.request(
2727
"POST",
2828
f"/accounts/{account_id}/multi-vacancies",
29-
json=data.jsonable_dict(exclude_none=True),
29+
json=data.jsonable_dict(exclude_unset=True),
3030
)
3131
return MultiVacancyResponse.model_validate(response.json())
3232

@@ -52,6 +52,6 @@ async def update(
5252
response = await self._api.request(
5353
method,
5454
f"/accounts/{account_id}/multi-vacancies/{vacancy_id}",
55-
json=data.jsonable_dict(exclude_none=True),
55+
json=data.jsonable_dict(exclude_unset=True),
5656
)
5757
return MultiVacancyResponse.model_validate(response.json())

huntflow_api_client/entities/production_calendars.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ async def get_non_working_days_in_period(
5555
calendar_id: int,
5656
deadline: datetime.date,
5757
start: Optional[datetime.date] = None,
58-
verbose: Optional[bool] = True,
58+
verbose: Optional[bool] = False,
5959
) -> NonWorkingDaysResponse:
6060
"""
6161
API method reference

huntflow_api_client/entities/resume.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async def update(
8383
response = await self._api.request(
8484
"PUT",
8585
f"/accounts/{account_id}/applicants/{applicant_id}/externals/{external_id}",
86-
json=data.jsonable_dict(exclude_none=True),
86+
json=data.jsonable_dict(),
8787
)
8888
return ApplicantResumeResponse.model_validate(response.json())
8989

huntflow_api_client/entities/tags.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async def create(
4343
response = await self._api.request(
4444
"POST",
4545
f"/accounts/{account_id}/tags",
46-
json=account_tag.jsonable_dict(exclude_none=True),
46+
json=account_tag.jsonable_dict(),
4747
)
4848
return AccountTagResponse.model_validate(response.json())
4949

@@ -65,7 +65,7 @@ async def update(
6565
response = await self._api.request(
6666
"PUT",
6767
f"/accounts/{account_id}/tags/{account_tag_id}",
68-
json=data.jsonable_dict(exclude_none=True),
68+
json=data.jsonable_dict(),
6969
)
7070
return AccountTagResponse.model_validate(response.json())
7171

@@ -112,7 +112,7 @@ async def update(
112112
response = await self._api.request(
113113
"POST",
114114
f"/accounts/{account_id}/applicants/{applicant_id}/tags",
115-
json=data.jsonable_dict(exclude_none=True),
115+
json=data.jsonable_dict(),
116116
)
117117
return ApplicantTagsListResponse.model_validate(response.json())
118118

huntflow_api_client/entities/vacancies.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async def create(self, account_id: int, data: VacancyCreateRequest) -> VacancyCr
9696
response = await self._api.request(
9797
"POST",
9898
f"/accounts/{account_id}/vacancies",
99-
json=data.jsonable_dict(exclude_none=True),
99+
json=data.jsonable_dict(exclude_unset=True),
100100
)
101101
return VacancyCreateResponse.model_validate(response.json())
102102

@@ -118,7 +118,7 @@ async def update(
118118
response = await self._api.request(
119119
"PUT",
120120
f"/accounts/{account_id}/vacancies/{vacancy_id}",
121-
json=data.jsonable_dict(exclude_none=True),
121+
json=data.jsonable_dict(exclude_unset=True),
122122
)
123123
return VacancyResponse.model_validate(response.json())
124124

@@ -150,7 +150,7 @@ async def patch(
150150
response = await self._api.request(
151151
"PATCH",
152152
f"/accounts/{account_id}/vacancies/{vacancy_id}",
153-
json=data.jsonable_dict(exclude_none=True),
153+
json=data.jsonable_dict(exclude_unset=True),
154154
)
155155
return VacancyResponse.model_validate(response.json())
156156

@@ -174,7 +174,7 @@ async def assign_coworker(
174174
response = await self._api.request(
175175
"PUT",
176176
f"/accounts/{account_id}/vacancies/{vacancy_id}/members/{account_member_id}",
177-
json=data.jsonable_dict(exclude_none=True),
177+
json=data.jsonable_dict(),
178178
)
179179
return StatusResponse.model_validate(response.json())
180180

@@ -304,7 +304,7 @@ async def close(self, account_id: int, vacancy_id: int, data: VacancyCloseReques
304304
await self._api.request(
305305
"POST",
306306
f"/accounts/{account_id}/vacancies/{vacancy_id}/state/close",
307-
json=data.jsonable_dict(exclude_none=True),
307+
json=data.jsonable_dict(),
308308
)
309309

310310
async def hold(self, account_id: int, vacancy_id: int, data: VacancyHoldRequest) -> None:
@@ -319,7 +319,7 @@ async def hold(self, account_id: int, vacancy_id: int, data: VacancyHoldRequest)
319319
await self._api.request(
320320
"POST",
321321
f"/accounts/{account_id}/vacancies/{vacancy_id}/state/hold",
322-
json=data.jsonable_dict(exclude_none=True),
322+
json=data.jsonable_dict(),
323323
)
324324

325325
async def resume(self, account_id: int, vacancy_id: int) -> None:

huntflow_api_client/entities/vacancy_requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ async def create(
7676
response = await self._api.request(
7777
"POST",
7878
path,
79-
json=request_data.jsonable_dict(exclude_none=True),
79+
json=request_data.jsonable_dict(exclude_unset=True),
8080
)
8181
return VacancyRequestResponse.model_validate(response.json())

huntflow_api_client/entities/webhooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def create(self, account_id: int, data: WebhookRequest) -> WebhookResponse
4141
:return: Information about the webhook
4242
"""
4343
path = f"/accounts/{account_id}/hooks"
44-
response = await self._api.request("POST", path, json=data.jsonable_dict(exclude_none=True))
44+
response = await self._api.request("POST", path, json=data.jsonable_dict())
4545
return WebhookResponse.model_validate(response.json())
4646

4747
async def delete(self, account_id: int, webhook_id: int) -> None:

0 commit comments

Comments
 (0)