Skip to content

Commit f7dfd51

Browse files
stainless-botRobertCraigie
authored andcommitted
style: prefer importing types directly instead of module names (#62)
1 parent 0ac3cc6 commit f7dfd51

13 files changed

+41
-40
lines changed

src/finch/types/ats/application.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from typing import Optional
44
from datetime import datetime
55

6+
from .stage import Stage
67
from ..._models import BaseModel
7-
from ...types.ats.stage import Stage
88

99
__all__ = ["Application", "RejectedReason"]
1010

src/finch/types/hris/benefits/individual_benefit.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing_extensions import Literal
55

66
from ...._models import BaseModel
7-
from ....types.hris import benfit_contribution
7+
from ..benfit_contribution import BenfitContribution
88

99
__all__ = ["IndividualBenefit", "Body"]
1010

@@ -21,9 +21,9 @@ class Body(BaseModel):
2121
for this individual.
2222
"""
2323

24-
company_contribution: Optional[benfit_contribution.BenfitContribution]
24+
company_contribution: Optional[BenfitContribution]
2525

26-
employee_deduction: Optional[benfit_contribution.BenfitContribution]
26+
employee_deduction: Optional[BenfitContribution]
2727

2828
hsa_contribution_limit: Optional[Literal["individual", "family"]]
2929
"""Type for HSA contribution limit if the benefit is a HSA."""

src/finch/types/hris/company.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6-
from ...types import location
76
from ..._models import BaseModel
7+
from ..location import Location
88

99
__all__ = ["Company", "Account", "Department", "DepartmentParent", "Entity"]
1010

@@ -69,7 +69,7 @@ class Company(BaseModel):
6969
legal_name: Optional[str]
7070
"""The legal name of the company."""
7171

72-
locations: Optional[List[Optional[location.Location]]]
72+
locations: Optional[List[Optional[Location]]]
7373

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

src/finch/types/hris/company_benefit.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@
33
from typing import Optional
44

55
from ..._models import BaseModel
6-
from ...types.hris import benefit_type, benefit_frequency, benfit_contribution
6+
from .benefit_type import BenefitType
7+
from .benefit_frequency import BenefitFrequency
8+
from .benfit_contribution import BenfitContribution
79

810
__all__ = ["CompanyBenefit"]
911

1012

1113
class CompanyBenefit(BaseModel):
1214
benefit_id: str
1315

14-
company_contribution: Optional[benfit_contribution.BenfitContribution]
16+
company_contribution: Optional[BenfitContribution]
1517

1618
description: Optional[str]
1719

18-
employee_deduction: Optional[benfit_contribution.BenfitContribution]
20+
employee_deduction: Optional[BenfitContribution]
1921

20-
frequency: Optional[benefit_frequency.BenefitFrequency]
22+
frequency: Optional[BenefitFrequency]
2123

22-
type: Optional[benefit_type.BenefitType]
24+
type: Optional[BenefitType]
2325
"""Type of benefit."""

src/finch/types/hris/individual.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6-
from ...types import location
76
from ..._models import BaseModel
7+
from ..location import Location
88

99
__all__ = ["Individual", "Email", "PhoneNumber"]
1010

@@ -46,7 +46,7 @@ class Individual(BaseModel):
4646
preferred_name: Optional[str]
4747
"""The preferred name of the individual."""
4848

49-
residence: Optional[location.Location]
49+
residence: Optional[Location]
5050

5151
ssn: Optional[str]
5252
"""Note: This property is only available if enabled for your account.

src/finch/types/hris/individual_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from typing import Optional
44

55
from ..._models import BaseModel
6-
from ...types.hris import individual
6+
from .individual import Individual
77

88
__all__ = ["IndividualResponse"]
99

1010

1111
class IndividualResponse(BaseModel):
12-
body: Optional[individual.Individual]
12+
body: Optional[Individual]
1313

1414
code: Optional[int]
1515

src/finch/types/hris/individuals/employment_data.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
from pydantic import Field as FieldInfo
77

8-
from ....types import income
8+
from ...income import Income
99
from ...._models import BaseModel
10-
from ....types.income import Income
11-
from ....types.location import Location
10+
from ...location import Location
1211

1312
__all__ = ["EmploymentData", "Department", "Employment", "Manager"]
1413

@@ -53,7 +52,7 @@ class EmploymentData(BaseModel):
5352
first_name: Optional[str]
5453
"""The legal first name of the individual."""
5554

56-
income_history: Optional[List[Optional[income.Income]]]
55+
income_history: Optional[List[Optional[Income]]]
5756
"""The array of income history."""
5857

5958
income: Optional[Income]

src/finch/types/hris/individuals/employment_data_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from typing import Optional
44

55
from ...._models import BaseModel
6-
from ....types.hris.individuals import employment_data
6+
from .employment_data import EmploymentData
77

88
__all__ = ["EmploymentDataResponse"]
99

1010

1111
class EmploymentDataResponse(BaseModel):
12-
body: Optional[employment_data.EmploymentData]
12+
body: Optional[EmploymentData]
1313

1414
code: Optional[int]
1515

src/finch/types/hris/pay_statement.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from typing import List, Optional
44
from typing_extensions import Literal
55

6-
from ...types import money
6+
from ..money import Money
77
from ..._models import BaseModel
8-
from ...types.hris import benefit_type
8+
from .benefit_type import BenefitType
99

1010
__all__ = ["PayStatement", "Earning", "EmployeeDeduction", "EmployerContribution", "Tax"]
1111

@@ -60,7 +60,7 @@ class EmployeeDeduction(BaseModel):
6060
pre_tax: Optional[bool]
6161
"""Boolean indicating if the deduction is pre-tax."""
6262

63-
type: Optional[benefit_type.BenefitType]
63+
type: Optional[BenefitType]
6464
"""Type of benefit."""
6565

6666

@@ -74,7 +74,7 @@ class EmployerContribution(BaseModel):
7474
name: Optional[str]
7575
"""The contribution name from the pay statement."""
7676

77-
type: Optional[benefit_type.BenefitType]
77+
type: Optional[BenefitType]
7878
"""Type of benefit."""
7979

8080

@@ -104,12 +104,12 @@ class PayStatement(BaseModel):
104104

105105
employer_contributions: Optional[List[Optional[EmployerContribution]]]
106106

107-
gross_pay: Optional[money.Money]
107+
gross_pay: Optional[Money]
108108

109109
individual_id: Optional[str]
110110
"""A stable Finch `id` (UUID v4) for an individual in the company"""
111111

112-
net_pay: Optional[money.Money]
112+
net_pay: Optional[Money]
113113

114114
payment_method: Optional[Literal["check", "direct_deposit"]]
115115
"""The payment method."""

src/finch/types/hris/pay_statement_response.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from typing import Optional
44

55
from ..._models import BaseModel
6-
from ...types.hris import pay_statement_response_body
6+
from .pay_statement_response_body import PayStatementResponseBody
77

88
__all__ = ["PayStatementResponse"]
99

1010

1111
class PayStatementResponse(BaseModel):
12-
body: Optional[pay_statement_response_body.PayStatementResponseBody]
12+
body: Optional[PayStatementResponseBody]
1313

1414
code: Optional[int]
1515

src/finch/types/hris/pay_statement_response_body.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
from typing import List, Optional
44

5+
from ..paging import Paging
56
from ..._models import BaseModel
6-
from ...types.hris import pay_statement
7-
from ...types.paging import Paging
7+
from .pay_statement import PayStatement
88

99
__all__ = ["PayStatementResponseBody"]
1010

1111

1212
class PayStatementResponseBody(BaseModel):
1313
paging: Optional[Paging]
1414

15-
pay_statements: Optional[List[pay_statement.PayStatement]]
15+
pay_statements: Optional[List[PayStatement]]
1616
"""The array of pay statements for the current payment."""

src/finch/types/hris/payment.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import List, Optional
44

5-
from ...types import money
5+
from ..money import Money
66
from ..._models import BaseModel
77

88
__all__ = ["Payment", "PayPeriod"]
@@ -18,20 +18,20 @@ class Payment(BaseModel):
1818
id: Optional[str]
1919
"""The unique id for the payment."""
2020

21-
company_debit: Optional[money.Money]
21+
company_debit: Optional[Money]
2222

2323
debit_date: Optional[str]
2424

25-
employee_taxes: Optional[money.Money]
25+
employee_taxes: Optional[Money]
2626

27-
employer_taxes: Optional[money.Money]
27+
employer_taxes: Optional[Money]
2828

29-
gross_pay: Optional[money.Money]
29+
gross_pay: Optional[Money]
3030

3131
individual_ids: Optional[List[str]]
3232
"""Array of every individual on this payment."""
3333

34-
net_pay: Optional[money.Money]
34+
net_pay: Optional[Money]
3535

3636
pay_date: Optional[str]
3737

src/finch/types/hris/supported_benefit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from typing_extensions import Literal
55

66
from ..._models import BaseModel
7-
from ...types.hris import benefit_type
7+
from .benefit_type import BenefitType
88

99
__all__ = ["SupportedBenefit"]
1010

@@ -43,5 +43,5 @@ class SupportedBenefit(BaseModel):
4343
values for HSA benefits.
4444
"""
4545

46-
type: Optional[benefit_type.BenefitType]
46+
type: Optional[BenefitType]
4747
"""Type of benefit."""

0 commit comments

Comments
 (0)