Skip to content

Commit a3c577c

Browse files
feat: add None default value to nullable response properties (#246)
1 parent 82a7085 commit a3c577c

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

src/finch/types/hris/company.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -56,25 +56,25 @@ class Company(BaseModel):
5656
id: str
5757
"""A stable Finch `id` (UUID v4) for the company."""
5858

59-
accounts: Optional[List[Account]]
59+
accounts: Optional[List[Account]] = None
6060
"""An array of bank account objects associated with the payroll/HRIS system."""
6161

62-
departments: Optional[List[Optional[Department]]]
62+
departments: Optional[List[Optional[Department]]] = None
6363
"""The array of company departments."""
6464

65-
ein: Optional[str]
65+
ein: Optional[str] = None
6666
"""The employer identification number."""
6767

68-
entity: Optional[Entity]
68+
entity: Optional[Entity] = None
6969
"""The entity type object."""
7070

71-
legal_name: Optional[str]
71+
legal_name: Optional[str] = None
7272
"""The legal name of the company."""
7373

74-
locations: Optional[List[Optional[Location]]]
74+
locations: Optional[List[Optional[Location]]] = None
7575

76-
primary_email: Optional[str]
76+
primary_email: Optional[str] = None
7777
"""The email of the main administrator on the account."""
7878

79-
primary_phone_number: Optional[str]
79+
primary_phone_number: Optional[str] = None
8080
"""The phone number of the main administrator on the account. Format: `XXXXXXXXXX`"""

src/finch/types/hris/company_benefit.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
class CompanyBenefit(BaseModel):
1414
benefit_id: str
1515

16-
company_contribution: Optional[BenefitContribution]
16+
company_contribution: Optional[BenefitContribution] = None
1717

18-
description: Optional[str]
18+
description: Optional[str] = None
1919

20-
employee_deduction: Optional[BenefitContribution]
20+
employee_deduction: Optional[BenefitContribution] = None
2121

22-
frequency: Optional[BenefitFrequency]
22+
frequency: Optional[BenefitFrequency] = None
2323

24-
type: Optional[BenefitType]
24+
type: Optional[BenefitType] = None
2525
"""Type of benefit."""

src/finch/types/jobs/automated_async_job.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
class AutomatedAsyncJob(BaseModel):
13-
completed_at: Optional[datetime]
13+
completed_at: Optional[datetime] = None
1414
"""The datetime the job completed."""
1515

1616
created_at: datetime
@@ -26,14 +26,14 @@ class AutomatedAsyncJob(BaseModel):
2626
job_url: str
2727
"""The url that can be used to retrieve the job status"""
2828

29-
scheduled_at: Optional[datetime]
29+
scheduled_at: Optional[datetime] = None
3030
"""The datetime a job is scheduled to be run.
3131
3232
For scheduled jobs, this datetime can be in the future if the job has not yet
3333
been enqueued. For ad-hoc jobs, this field will be null.
3434
"""
3535

36-
started_at: Optional[datetime]
36+
started_at: Optional[datetime] = None
3737
"""The datetime a job entered into the job queue."""
3838

3939
status: Literal["pending", "in_progress", "complete", "error", "reauth_error", "permissions_error"]

src/finch/types/jobs/manual_async_job.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
class ManualAsyncJob(BaseModel):
12-
body: Optional[List[object]]
12+
body: Optional[List[object]] = None
1313
"""Specific information about the job, such as individual statuses for batch jobs."""
1414

1515
job_id: str

src/finch/types/request_forwarding_forward_response.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010

1111

1212
class Request(BaseModel):
13-
data: Optional[str]
13+
data: Optional[str] = None
1414
"""The body that was specified for the forwarded request.
1515
1616
If a value was not specified in the original request, this value will be
1717
returned as null ; otherwise, this value will always be returned as a string.
1818
"""
1919

20-
headers: Optional[object]
20+
headers: Optional[object] = None
2121
"""The specified HTTP headers that were included in the forwarded request.
2222
2323
If no headers were specified, this will be returned as `null`.
@@ -29,7 +29,7 @@ class Request(BaseModel):
2929
Valid values include: `GET` , `POST` , `PUT` , `DELETE` , and `PATCH`.
3030
"""
3131

32-
params: Optional[object]
32+
params: Optional[object] = None
3333
"""The query parameters that were included in the forwarded request.
3434
3535
If no query parameters were specified, this will be returned as `null`.
@@ -40,14 +40,14 @@ class Request(BaseModel):
4040

4141

4242
class RequestForwardingForwardResponse(BaseModel):
43-
data: Optional[str]
43+
data: Optional[str] = None
4444
"""
4545
A string representation of the HTTP response body of the forwarded request’s
4646
response received from the underlying integration’s API. This field may be null
4747
in the case where the upstream system’s response is empty.
4848
"""
4949

50-
headers: Optional[object]
50+
headers: Optional[object] = None
5151
"""
5252
The HTTP headers of the forwarded request’s response, exactly as received from
5353
the underlying integration’s API.

0 commit comments

Comments
 (0)