Skip to content

Commit

Permalink
feat: add None default value to nullable response properties (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot authored Jan 4, 2024
1 parent 82a7085 commit a3c577c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
16 changes: 8 additions & 8 deletions src/finch/types/hris/company.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,25 +56,25 @@ class Company(BaseModel):
id: str
"""A stable Finch `id` (UUID v4) for the company."""

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

departments: Optional[List[Optional[Department]]]
departments: Optional[List[Optional[Department]]] = None
"""The array of company departments."""

ein: Optional[str]
ein: Optional[str] = None
"""The employer identification number."""

entity: Optional[Entity]
entity: Optional[Entity] = None
"""The entity type object."""

legal_name: Optional[str]
legal_name: Optional[str] = None
"""The legal name of the company."""

locations: Optional[List[Optional[Location]]]
locations: Optional[List[Optional[Location]]] = None

primary_email: Optional[str]
primary_email: Optional[str] = None
"""The email of the main administrator on the account."""

primary_phone_number: Optional[str]
primary_phone_number: Optional[str] = None
"""The phone number of the main administrator on the account. Format: `XXXXXXXXXX`"""
10 changes: 5 additions & 5 deletions src/finch/types/hris/company_benefit.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
class CompanyBenefit(BaseModel):
benefit_id: str

company_contribution: Optional[BenefitContribution]
company_contribution: Optional[BenefitContribution] = None

description: Optional[str]
description: Optional[str] = None

employee_deduction: Optional[BenefitContribution]
employee_deduction: Optional[BenefitContribution] = None

frequency: Optional[BenefitFrequency]
frequency: Optional[BenefitFrequency] = None

type: Optional[BenefitType]
type: Optional[BenefitType] = None
"""Type of benefit."""
6 changes: 3 additions & 3 deletions src/finch/types/jobs/automated_async_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class AutomatedAsyncJob(BaseModel):
completed_at: Optional[datetime]
completed_at: Optional[datetime] = None
"""The datetime the job completed."""

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

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

started_at: Optional[datetime]
started_at: Optional[datetime] = None
"""The datetime a job entered into the job queue."""

status: Literal["pending", "in_progress", "complete", "error", "reauth_error", "permissions_error"]
Expand Down
2 changes: 1 addition & 1 deletion src/finch/types/jobs/manual_async_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


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

job_id: str
Expand Down
10 changes: 5 additions & 5 deletions src/finch/types/request_forwarding_forward_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@


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

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

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


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

headers: Optional[object]
headers: Optional[object] = None
"""
The HTTP headers of the forwarded request’s response, exactly as received from
the underlying integration’s API.
Expand Down

0 comments on commit a3c577c

Please sign in to comment.