diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index dde6ef46..79316e6b 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,36 +1,36 @@ -speakeasyVersion: 1.517.2 +speakeasyVersion: 1.525.2 sources: Gusto-App-Int-OAS: sourceNamespace: gusto-app-int-oas - sourceRevisionDigest: sha256:b155250d5ddcad485d89d5b51618fa39031994601ae08e0cef641f00215821c2 - sourceBlobDigest: sha256:d43514bdc7385e9cafdfcccb16143f19a69dbfb439308d29418d4dc1f4a4a097 + sourceRevisionDigest: sha256:146394ace1f2364d29972b713f4c983469873146b72b8e440e4c85a116118413 + sourceBlobDigest: sha256:928c472ebcc8603189dec96605686c09586dbc5e8f76169a7ca59a1c3cf777d5 tags: - latest - - speakeasy-sdk-regen-1741652581 + - speakeasy-sdk-regen-1742257375 - "2024-04-01" Gusto-OAS: sourceNamespace: gusto-oas - sourceRevisionDigest: sha256:ab3219793f9926f9bde07908ba3bd93460f529c3d0f5f9ff1f280f1bcc7d55dd - sourceBlobDigest: sha256:f18d9b14a709a15ad96fedfab7063e6f63c8d5403b1a7bb46a69e3b629e2fb83 + sourceRevisionDigest: sha256:058c4e660dd4b27a1cd8a068429a5239a71a1b5b365fde8544362ffcf28c2939 + sourceBlobDigest: sha256:4c5a52b64a2132d394b1fae941027466dcf804b8de2d8e7995eeb16a6f9a2392 tags: - latest - - speakeasy-sdk-regen-1741652581 + - speakeasy-sdk-regen-1742257375 - "2024-04-01" targets: gusto: source: Gusto-OAS sourceNamespace: gusto-oas - sourceRevisionDigest: sha256:ab3219793f9926f9bde07908ba3bd93460f529c3d0f5f9ff1f280f1bcc7d55dd - sourceBlobDigest: sha256:f18d9b14a709a15ad96fedfab7063e6f63c8d5403b1a7bb46a69e3b629e2fb83 + sourceRevisionDigest: sha256:058c4e660dd4b27a1cd8a068429a5239a71a1b5b365fde8544362ffcf28c2939 + sourceBlobDigest: sha256:4c5a52b64a2132d394b1fae941027466dcf804b8de2d8e7995eeb16a6f9a2392 codeSamplesNamespace: gusto-oas-python-code-samples - codeSamplesRevisionDigest: sha256:85a10727ff7b024f8ca9a6777bb29b85425361e87f7a88b71d8a242b1f164867 + codeSamplesRevisionDigest: sha256:a02d9747808931b1ac9832630609b77df58001e95aae6f66f0d0b535b2e5a243 gusto-app-int: source: Gusto-App-Int-OAS sourceNamespace: gusto-app-int-oas - sourceRevisionDigest: sha256:b155250d5ddcad485d89d5b51618fa39031994601ae08e0cef641f00215821c2 - sourceBlobDigest: sha256:d43514bdc7385e9cafdfcccb16143f19a69dbfb439308d29418d4dc1f4a4a097 + sourceRevisionDigest: sha256:146394ace1f2364d29972b713f4c983469873146b72b8e440e4c85a116118413 + sourceBlobDigest: sha256:928c472ebcc8603189dec96605686c09586dbc5e8f76169a7ca59a1c3cf777d5 codeSamplesNamespace: gusto-app-int-oas-python-code-samples - codeSamplesRevisionDigest: sha256:b8e645374c892ebf00061bd1b4b4501959f513881ded0c46e467fdbccd910a8a + codeSamplesRevisionDigest: sha256:f13e0c32f6a3382d3dd1046c8ba164778440942d263cb02d201f05578c89462c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/RELEASES.md b/RELEASES.md index aad6c00f..be6471b1 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -48,4 +48,14 @@ Based on: ### Generated - [python v0.2.1] gusto_app_int ### Releases -- [PyPI v0.2.1] https://pypi.org/project/gusto_app_integration/0.2.1 - gusto_app_int \ No newline at end of file +- [PyPI v0.2.1] https://pypi.org/project/gusto_app_integration/0.2.1 - gusto_app_int + +## 2025-03-28 00:23:17 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.525.2 (2.562.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.2.2] gusto_app_int +### Releases +- [PyPI v0.2.2] https://pypi.org/project/gusto_app_integration/0.2.2 - gusto_app_int \ No newline at end of file diff --git a/gusto_app_int/.speakeasy/gen.lock b/gusto_app_int/.speakeasy/gen.lock index a3a886c9..b5ebc4fe 100644 --- a/gusto_app_int/.speakeasy/gen.lock +++ b/gusto_app_int/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 307f4640-0d05-4c9e-b275-cb7fc716aa23 management: - docChecksum: e5dbf5a9cf30d9ea940fe694fe20aab8 + docChecksum: 78dbfa21931768c6fe27a77e45ba47a1 docVersion: "2024-04-01" - speakeasyVersion: 1.517.2 - generationVersion: 2.548.5 - releaseVersion: 0.2.1 - configChecksum: 6f1f3a37d8e261faae78f02ba148f837 + speakeasyVersion: 1.525.2 + generationVersion: 2.562.3 + releaseVersion: 0.2.2 + configChecksum: c99a9a504eb21dcd8712f151b9512847 repoURL: https://github.com/Gusto/gusto-python-client.git repoSubDirectory: gusto_app_int installationURL: https://github.com/Gusto/gusto-python-client.git#subdirectory=gusto_app_int @@ -16,7 +16,7 @@ features: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 constsAndDefaults: 1.0.5 - core: 5.12.3 + core: 5.12.4 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 enumUnions: 0.1.0 @@ -274,11 +274,12 @@ generatedFiles: - docs/models/payrolltype.md - docs/models/payrolltypes.md - docs/models/payrollwithholdingpayperiodtype.md - - docs/models/payschedule.md - docs/models/payscheduleassignment.md - docs/models/payscheduleassignmentdepartment.md - docs/models/payscheduleassignmentemployee.md - docs/models/payschedulefrequency.md + - docs/models/payschedulelist.md + - docs/models/payscheduleobject.md - docs/models/payscheduletype.md - docs/models/postdepartmentsrequest.md - docs/models/postdepartmentsrequestbody.md @@ -443,6 +444,7 @@ generatedFiles: - docs/models/versionheader.md - docs/models/wagetype.md - docs/models/webhooksubscription.md + - docs/models/withholdingpayperiod.md - docs/models/ytdbenefitamountsfromdifferentcompany.md - docs/sdks/companies/README.md - docs/sdks/companybenefits/README.md @@ -612,11 +614,12 @@ generatedFiles: - src/gusto_app_integration/models/off_cycle_reason_type.py - src/gusto_app_integration/models/paid_time_off.py - src/gusto_app_integration/models/pay_period.py - - src/gusto_app_integration/models/pay_schedule.py - src/gusto_app_integration/models/pay_schedule_assignment.py - src/gusto_app_integration/models/pay_schedule_assignment_department.py - src/gusto_app_integration/models/pay_schedule_assignment_employee.py - src/gusto_app_integration/models/pay_schedule_frequency.py + - src/gusto_app_integration/models/pay_schedule_list.py + - src/gusto_app_integration/models/pay_schedule_object.py - src/gusto_app_integration/models/payroll.py - src/gusto_app_integration/models/payroll_company_taxes_type.py - src/gusto_app_integration/models/payroll_credit_blockers_type.py @@ -992,7 +995,7 @@ examples: X-Gusto-API-Version: "2024-04-01" responses: "200": - application/json: [{"uuid": "2097fe08-407a-46d7-b35c-a32402a2355e", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "Engineering department pay schedule", "auto_pilot": false, "active": true}, {"uuid": "8fc9f556-74fa-4271-97f6-4bfbfc5a5352", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Sales", "custom_name": "Sales department monthly schedule", "auto_pilot": false, "active": false}, {"uuid": "0e07d35a-af11-4123-bfcb-4dd5f2f12ee1", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Staff", "custom_name": "Staff department pay schedule", "auto_pilot": true, "active": false}] + application/json: [{"uuid": "2097fe08-407a-46d7-b35c-a32402a2355e", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "Engineering department pay schedule", "auto_pilot": false, "active": true, "version": "68934a3e9455fa72420237eb05902327"}, {"uuid": "8fc9f556-74fa-4271-97f6-4bfbfc5a5352", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Sales", "custom_name": "Sales department monthly schedule", "auto_pilot": false, "active": false, "version": "68934a3e9455fa72420237eb05902320"}, {"uuid": "0e07d35a-af11-4123-bfcb-4dd5f2f12ee1", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Staff", "custom_name": "Staff department pay schedule", "auto_pilot": true, "active": false, "version": "68934a3e9455fa72420237eb05902323"}] get-v1-companies-company_id-pay_schedules-pay_schedule_id: Example: parameters: @@ -1003,7 +1006,7 @@ examples: X-Gusto-API-Version: "2024-04-01" responses: "200": - application/json: {"uuid": "f2a69c38-e2f9-4e31-b5c5-4754fc60a052", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "A new monthly pay schedule", "auto_pilot": false, "active": true} + application/json: {"uuid": "f2a69c38-e2f9-4e31-b5c5-4754fc60a052", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "A new monthly pay schedule", "auto_pilot": false, "active": true, "version": "68934a3e9455fa72420237eb05902327"} get-v1-companies-company_id-pay_periods: Example: parameters: diff --git a/gusto_app_int/.speakeasy/gen.yaml b/gusto_app_int/.speakeasy/gen.yaml index 2961a3e3..ab321c60 100644 --- a/gusto_app_int/.speakeasy/gen.yaml +++ b/gusto_app_int/.speakeasy/gen.yaml @@ -15,7 +15,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true python: - version: 0.2.1 + version: 0.2.2 additionalDependencies: dev: {} main: {} diff --git a/gusto_app_int/docs/models/payschedule.md b/gusto_app_int/docs/models/payschedulelist.md similarity index 92% rename from gusto_app_int/docs/models/payschedule.md rename to gusto_app_int/docs/models/payschedulelist.md index eca96279..08d4693b 100644 --- a/gusto_app_int/docs/models/payschedule.md +++ b/gusto_app_int/docs/models/payschedulelist.md @@ -1,4 +1,4 @@ -# PaySchedule +# PayScheduleList The representation of a pay schedule. @@ -8,6 +8,7 @@ The representation of a pay schedule. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `uuid` | *str* | :heavy_check_mark: | The unique identifier of the pay schedule in Gusto. | +| `version` | *str* | :heavy_check_mark: | The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. | | `frequency` | [Optional[models.PayScheduleFrequency]](../models/payschedulefrequency.md) | :heavy_minus_sign: | The frequency that employees on this pay schedule are paid with Gusto. | | `anchor_pay_date` | *Optional[str]* | :heavy_minus_sign: | The first date that employees on this pay schedule are paid with Gusto. | | `anchor_end_of_pay_period` | *Optional[str]* | :heavy_minus_sign: | The last date of the first pay period. This can be the same date as the anchor pay date. | diff --git a/gusto_app_int/docs/models/payscheduleobject.md b/gusto_app_int/docs/models/payscheduleobject.md new file mode 100644 index 00000000..194811cd --- /dev/null +++ b/gusto_app_int/docs/models/payscheduleobject.md @@ -0,0 +1,20 @@ +# PayScheduleObject + +The representation of a pay schedule. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `uuid` | *str* | :heavy_check_mark: | The unique identifier of the pay schedule in Gusto. | +| `version` | *str* | :heavy_check_mark: | The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. | +| `frequency` | [Optional[models.PayScheduleFrequency]](../models/payschedulefrequency.md) | :heavy_minus_sign: | The frequency that employees on this pay schedule are paid with Gusto. | +| `anchor_pay_date` | *Optional[str]* | :heavy_minus_sign: | The first date that employees on this pay schedule are paid with Gusto. | +| `anchor_end_of_pay_period` | *Optional[str]* | :heavy_minus_sign: | The last date of the first pay period. This can be the same date as the anchor pay date. | +| `day_1` | *OptionalNullable[int]* | :heavy_minus_sign: | An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies. | +| `day_2` | *OptionalNullable[int]* | :heavy_minus_sign: | An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the "Twice per month" frequency. For semi-monthly pay schedules, this field should be set to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | This field will be hourly when the pay schedule is for hourly employees, salaried when the pay schedule is for salaried employees, the department name if pay schedule is by department, and null when the pay schedule is for all employees. | +| `custom_name` | *Optional[str]* | :heavy_minus_sign: | A custom name for a pay schedule, defaults to the pay frequency description. | +| `auto_pilot` | *Optional[bool]* | :heavy_minus_sign: | With Autopilot® enabled, payroll will run automatically one day before your payroll deadlines. | +| `active` | *Optional[bool]* | :heavy_minus_sign: | Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned. | \ No newline at end of file diff --git a/gusto_app_int/docs/models/putv1companiescompanyidpayrollsrequestbody.md b/gusto_app_int/docs/models/putv1companiescompanyidpayrollsrequestbody.md index b137f4fa..39a1f6cc 100644 --- a/gusto_app_int/docs/models/putv1companiescompanyidpayrollsrequestbody.md +++ b/gusto_app_int/docs/models/putv1companiescompanyidpayrollsrequestbody.md @@ -3,6 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `employee_compensations` | List[[models.EmployeeCompensations](../models/employeecompensations.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `employee_compensations` | List[[models.EmployeeCompensations](../models/employeecompensations.md)] | :heavy_check_mark: | N/A | +| `withholding_pay_period` | [Optional[models.WithholdingPayPeriod]](../models/withholdingpayperiod.md) | :heavy_minus_sign: | The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. | +| `skip_regular_deductions` | *Optional[bool]* | :heavy_minus_sign: | Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. | +| `fixed_withholding_rate` | *Optional[bool]* | :heavy_minus_sign: | Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. | \ No newline at end of file diff --git a/gusto_app_int/docs/models/withholdingpayperiod.md b/gusto_app_int/docs/models/withholdingpayperiod.md new file mode 100644 index 00000000..6340d69e --- /dev/null +++ b/gusto_app_int/docs/models/withholdingpayperiod.md @@ -0,0 +1,16 @@ +# WithholdingPayPeriod + +The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `EVERY_WEEK` | Every week | +| `EVERY_OTHER_WEEK` | Every other week | +| `TWICE_PER_MONTH` | Twice per month | +| `MONTHLY` | Monthly | +| `QUARTERLY` | Quarterly | +| `SEMIANNUALLY` | Semiannually | +| `ANNUALLY` | Annually | \ No newline at end of file diff --git a/gusto_app_int/docs/sdks/payrolls/README.md b/gusto_app_int/docs/sdks/payrolls/README.md index 4d5aa59a..8c805b55 100644 --- a/gusto_app_int/docs/sdks/payrolls/README.md +++ b/gusto_app_int/docs/sdks/payrolls/README.md @@ -149,13 +149,16 @@ with GustoAppIntegration( ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | The UUID of the company | -| `payroll_id` | *str* | :heavy_check_mark: | The UUID of the payroll | -| `employee_compensations` | List[[models.EmployeeCompensations](../../models/employeecompensations.md)] | :heavy_check_mark: | N/A | -| `x_gusto_api_version` | [Optional[models.VersionHeader]](../../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | The UUID of the company | +| `payroll_id` | *str* | :heavy_check_mark: | The UUID of the payroll | +| `employee_compensations` | List[[models.EmployeeCompensations](../../models/employeecompensations.md)] | :heavy_check_mark: | N/A | +| `x_gusto_api_version` | [Optional[models.VersionHeader]](../../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | +| `withholding_pay_period` | [Optional[models.WithholdingPayPeriod]](../../models/withholdingpayperiod.md) | :heavy_minus_sign: | The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. | +| `skip_regular_deductions` | *Optional[bool]* | :heavy_minus_sign: | Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. | +| `fixed_withholding_rate` | *Optional[bool]* | :heavy_minus_sign: | Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/gusto_app_int/docs/sdks/payschedules/README.md b/gusto_app_int/docs/sdks/payschedules/README.md index 53ee2a65..fdb35d73 100644 --- a/gusto_app_int/docs/sdks/payschedules/README.md +++ b/gusto_app_int/docs/sdks/payschedules/README.md @@ -46,7 +46,7 @@ with GustoAppIntegration( ### Response -**[List[models.PaySchedule]](../../models/.md)** +**[List[models.PayScheduleList]](../../models/.md)** ### Errors @@ -88,7 +88,7 @@ with GustoAppIntegration( ### Response -**[models.PaySchedule](../../models/payschedule.md)** +**[models.PayScheduleObject](../../models/payscheduleobject.md)** ### Errors diff --git a/gusto_app_int/pylintrc b/gusto_app_int/pylintrc index 097b0a80..e8cd3e85 100644 --- a/gusto_app_int/pylintrc +++ b/gusto_app_int/pylintrc @@ -457,7 +457,8 @@ disable=raw-checker-failed, relative-beyond-top-level, consider-using-with, wildcard-import, - unused-wildcard-import + unused-wildcard-import, + too-many-return-statements # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -658,4 +659,4 @@ init-import=no # List of qualified module names which can have objects that can redefine # builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/gusto_app_int/pyproject.toml b/gusto_app_int/pyproject.toml index 7be5ff8a..7c35c5bb 100644 --- a/gusto_app_int/pyproject.toml +++ b/gusto_app_int/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gusto_app_integration" -version = "0.2.1" +version = "0.2.2" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" diff --git a/gusto_app_int/src/gusto_app_integration/_version.py b/gusto_app_int/src/gusto_app_integration/_version.py index aa208c72..7b1d3aaf 100644 --- a/gusto_app_int/src/gusto_app_integration/_version.py +++ b/gusto_app_int/src/gusto_app_integration/_version.py @@ -3,11 +3,11 @@ import importlib.metadata __title__: str = "gusto_app_integration" -__version__: str = "0.2.1" +__version__: str = "0.2.2" __openapi_doc_version__: str = "2024-04-01" -__gen_version__: str = "2.548.5" +__gen_version__: str = "2.562.3" __user_agent__: str = ( - "speakeasy-sdk/python 0.2.1 2.548.5 2024-04-01 gusto_app_integration" + "speakeasy-sdk/python 0.2.2 2.562.3 2024-04-01 gusto_app_integration" ) try: diff --git a/gusto_app_int/src/gusto_app_integration/models/__init__.py b/gusto_app_int/src/gusto_app_integration/models/__init__.py index 1bb6e3c7..abeaeb99 100644 --- a/gusto_app_int/src/gusto_app_integration/models/__init__.py +++ b/gusto_app_int/src/gusto_app_integration/models/__init__.py @@ -553,7 +553,6 @@ PayPeriodTypedDict, PayrollType, ) -from .pay_schedule import PaySchedule, PayScheduleTypedDict from .pay_schedule_assignment import ( PayScheduleAssignment, PayScheduleAssignmentTypedDict, @@ -568,6 +567,8 @@ PayScheduleAssignmentEmployeeTypedDict, ) from .pay_schedule_frequency import PayScheduleFrequency +from .pay_schedule_list import PayScheduleList, PayScheduleListTypedDict +from .pay_schedule_object import PayScheduleObject, PayScheduleObjectTypedDict from .payroll import Payroll, PayrollTypedDict from .payroll_company_taxes_type import ( PayrollCompanyTaxesType, @@ -831,6 +832,7 @@ PutV1CompaniesCompanyIDPayrollsRequestBody, PutV1CompaniesCompanyIDPayrollsRequestBodyTypedDict, PutV1CompaniesCompanyIDPayrollsRequestTypedDict, + WithholdingPayPeriod, ) from .put_v1_companiesop import ( PutV1CompaniesRequest, @@ -1363,7 +1365,6 @@ "PayPeriodPayroll", "PayPeriodPayrollTypedDict", "PayPeriodTypedDict", - "PaySchedule", "PayScheduleAssignment", "PayScheduleAssignmentDepartment", "PayScheduleAssignmentDepartmentTypedDict", @@ -1371,8 +1372,11 @@ "PayScheduleAssignmentEmployeeTypedDict", "PayScheduleAssignmentTypedDict", "PayScheduleFrequency", + "PayScheduleList", + "PayScheduleListTypedDict", + "PayScheduleObject", + "PayScheduleObjectTypedDict", "PayScheduleType", - "PayScheduleTypedDict", "PaymentMethod", "PaymentPeriod", "PaymentUnit", @@ -1713,6 +1717,7 @@ "WageType", "WebhookSubscription", "WebhookSubscriptionTypedDict", + "WithholdingPayPeriod", "YtdBenefitAmountsFromDifferentCompany", "YtdBenefitAmountsFromDifferentCompanyTypedDict", ] diff --git a/gusto_app_int/src/gusto_app_integration/models/pay_schedule.py b/gusto_app_int/src/gusto_app_integration/models/pay_schedule_list.py similarity index 92% rename from gusto_app_int/src/gusto_app_integration/models/pay_schedule.py rename to gusto_app_int/src/gusto_app_integration/models/pay_schedule_list.py index 2d8e501c..bd2e7b2c 100644 --- a/gusto_app_int/src/gusto_app_integration/models/pay_schedule.py +++ b/gusto_app_int/src/gusto_app_integration/models/pay_schedule_list.py @@ -14,11 +14,13 @@ from typing_extensions import NotRequired, TypedDict -class PayScheduleTypedDict(TypedDict): +class PayScheduleListTypedDict(TypedDict): r"""The representation of a pay schedule.""" uuid: str r"""The unique identifier of the pay schedule in Gusto.""" + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" frequency: NotRequired[PayScheduleFrequency] r"""The frequency that employees on this pay schedule are paid with Gusto.""" anchor_pay_date: NotRequired[str] @@ -39,12 +41,15 @@ class PayScheduleTypedDict(TypedDict): r"""Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned.""" -class PaySchedule(BaseModel): +class PayScheduleList(BaseModel): r"""The representation of a pay schedule.""" uuid: str r"""The unique identifier of the pay schedule in Gusto.""" + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" + frequency: Optional[PayScheduleFrequency] = None r"""The frequency that employees on this pay schedule are paid with Gusto.""" diff --git a/gusto_app_int/src/gusto_app_integration/models/pay_schedule_object.py b/gusto_app_int/src/gusto_app_integration/models/pay_schedule_object.py new file mode 100644 index 00000000..5eb19abb --- /dev/null +++ b/gusto_app_int/src/gusto_app_integration/models/pay_schedule_object.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pay_schedule_frequency import PayScheduleFrequency +from gusto_app_integration.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PayScheduleObjectTypedDict(TypedDict): + r"""The representation of a pay schedule.""" + + uuid: str + r"""The unique identifier of the pay schedule in Gusto.""" + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" + frequency: NotRequired[PayScheduleFrequency] + r"""The frequency that employees on this pay schedule are paid with Gusto.""" + anchor_pay_date: NotRequired[str] + r"""The first date that employees on this pay schedule are paid with Gusto.""" + anchor_end_of_pay_period: NotRequired[str] + r"""The last date of the first pay period. This can be the same date as the anchor pay date.""" + day_1: NotRequired[Nullable[int]] + r"""An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies.""" + day_2: NotRequired[Nullable[int]] + r"""An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the \"Twice per month\" frequency. For semi-monthly pay schedules, this field should be set to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies.""" + name: NotRequired[Nullable[str]] + r"""This field will be hourly when the pay schedule is for hourly employees, salaried when the pay schedule is for salaried employees, the department name if pay schedule is by department, and null when the pay schedule is for all employees.""" + custom_name: NotRequired[str] + r"""A custom name for a pay schedule, defaults to the pay frequency description.""" + auto_pilot: NotRequired[bool] + r"""With Autopilot® enabled, payroll will run automatically one day before your payroll deadlines.""" + active: NotRequired[bool] + r"""Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned.""" + + +class PayScheduleObject(BaseModel): + r"""The representation of a pay schedule.""" + + uuid: str + r"""The unique identifier of the pay schedule in Gusto.""" + + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" + + frequency: Optional[PayScheduleFrequency] = None + r"""The frequency that employees on this pay schedule are paid with Gusto.""" + + anchor_pay_date: Optional[str] = None + r"""The first date that employees on this pay schedule are paid with Gusto.""" + + anchor_end_of_pay_period: Optional[str] = None + r"""The last date of the first pay period. This can be the same date as the anchor pay date.""" + + day_1: OptionalNullable[int] = UNSET + r"""An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies.""" + + day_2: OptionalNullable[int] = UNSET + r"""An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the \"Twice per month\" frequency. For semi-monthly pay schedules, this field should be set to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies.""" + + name: OptionalNullable[str] = UNSET + r"""This field will be hourly when the pay schedule is for hourly employees, salaried when the pay schedule is for salaried employees, the department name if pay schedule is by department, and null when the pay schedule is for all employees.""" + + custom_name: Optional[str] = None + r"""A custom name for a pay schedule, defaults to the pay frequency description.""" + + auto_pilot: Optional[bool] = None + r"""With Autopilot® enabled, payroll will run automatically one day before your payroll deadlines.""" + + active: Optional[bool] = None + r"""Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "frequency", + "anchor_pay_date", + "anchor_end_of_pay_period", + "day_1", + "day_2", + "name", + "custom_name", + "auto_pilot", + "active", + ] + nullable_fields = ["day_1", "day_2", "name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/gusto_app_int/src/gusto_app_integration/models/put_v1_companies_company_id_payrollsop.py b/gusto_app_int/src/gusto_app_integration/models/put_v1_companies_company_id_payrollsop.py index 112125f6..473e8bf6 100644 --- a/gusto_app_int/src/gusto_app_integration/models/put_v1_companies_company_id_payrollsop.py +++ b/gusto_app_int/src/gusto_app_integration/models/put_v1_companies_company_id_payrollsop.py @@ -146,13 +146,40 @@ class EmployeeCompensations(BaseModel): r"""An array of all paid time off the employee is eligible for this pay period. Each paid time off object can be the name or the specific policy_uuid.""" +class WithholdingPayPeriod(str, Enum): + r"""The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls.""" + + EVERY_WEEK = "Every week" + EVERY_OTHER_WEEK = "Every other week" + TWICE_PER_MONTH = "Twice per month" + MONTHLY = "Monthly" + QUARTERLY = "Quarterly" + SEMIANNUALLY = "Semiannually" + ANNUALLY = "Annually" + + class PutV1CompaniesCompanyIDPayrollsRequestBodyTypedDict(TypedDict): employee_compensations: List[EmployeeCompensationsTypedDict] + withholding_pay_period: NotRequired[WithholdingPayPeriod] + r"""The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls.""" + skip_regular_deductions: NotRequired[bool] + r"""Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls.""" + fixed_withholding_rate: NotRequired[bool] + r"""Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls.""" class PutV1CompaniesCompanyIDPayrollsRequestBody(BaseModel): employee_compensations: List[EmployeeCompensations] + withholding_pay_period: Optional[WithholdingPayPeriod] = None + r"""The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls.""" + + skip_regular_deductions: Optional[bool] = None + r"""Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls.""" + + fixed_withholding_rate: Optional[bool] = None + r"""Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls.""" + class PutV1CompaniesCompanyIDPayrollsRequestTypedDict(TypedDict): company_id: str diff --git a/gusto_app_int/src/gusto_app_integration/payrolls.py b/gusto_app_int/src/gusto_app_integration/payrolls.py index 3b282822..b80ca43c 100644 --- a/gusto_app_int/src/gusto_app_integration/payrolls.py +++ b/gusto_app_int/src/gusto_app_integration/payrolls.py @@ -508,6 +508,9 @@ def update( x_gusto_api_version: Optional[ models.VersionHeader ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + withholding_pay_period: Optional[models.WithholdingPayPeriod] = None, + skip_regular_deductions: Optional[bool] = None, + fixed_withholding_rate: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -526,6 +529,9 @@ def update( :param payroll_id: The UUID of the payroll :param employee_compensations: :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param withholding_pay_period: The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. + :param skip_regular_deductions: Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. + :param fixed_withholding_rate: Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -549,6 +555,9 @@ def update( employee_compensations=utils.get_pydantic_model( employee_compensations, List[models.EmployeeCompensations] ), + withholding_pay_period=withholding_pay_period, + skip_regular_deductions=skip_regular_deductions, + fixed_withholding_rate=fixed_withholding_rate, ), ) @@ -635,6 +644,9 @@ async def update_async( x_gusto_api_version: Optional[ models.VersionHeader ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + withholding_pay_period: Optional[models.WithholdingPayPeriod] = None, + skip_regular_deductions: Optional[bool] = None, + fixed_withholding_rate: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -653,6 +665,9 @@ async def update_async( :param payroll_id: The UUID of the payroll :param employee_compensations: :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param withholding_pay_period: The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. + :param skip_regular_deductions: Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. + :param fixed_withholding_rate: Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -676,6 +691,9 @@ async def update_async( employee_compensations=utils.get_pydantic_model( employee_compensations, List[models.EmployeeCompensations] ), + withholding_pay_period=withholding_pay_period, + skip_regular_deductions=skip_regular_deductions, + fixed_withholding_rate=fixed_withholding_rate, ), ) diff --git a/gusto_app_int/src/gusto_app_integration/payschedules.py b/gusto_app_int/src/gusto_app_integration/payschedules.py index 825e4013..24ba02cf 100644 --- a/gusto_app_int/src/gusto_app_integration/payschedules.py +++ b/gusto_app_int/src/gusto_app_integration/payschedules.py @@ -21,7 +21,7 @@ def list( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.PaySchedule]: + ) -> List[models.PayScheduleList]: r"""Get the pay schedules for a company The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -91,7 +91,7 @@ def list( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, List[models.PaySchedule]) + return utils.unmarshal_json(http_res.text, List[models.PayScheduleList]) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -125,7 +125,7 @@ async def list_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.PaySchedule]: + ) -> List[models.PayScheduleList]: r"""Get the pay schedules for a company The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -195,7 +195,7 @@ async def list_async( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, List[models.PaySchedule]) + return utils.unmarshal_json(http_res.text, List[models.PayScheduleList]) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -228,7 +228,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.PaySchedule: + ) -> models.PayScheduleObject: r"""Get a pay schedule The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -296,7 +296,7 @@ def get( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.PaySchedule) + return utils.unmarshal_json(http_res.text, models.PayScheduleObject) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -329,7 +329,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.PaySchedule: + ) -> models.PayScheduleObject: r"""Get a pay schedule The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -397,7 +397,7 @@ async def get_async( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.PaySchedule) + return utils.unmarshal_json(http_res.text, models.PayScheduleObject) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/gusto_embedded/.speakeasy/gen.lock b/gusto_embedded/.speakeasy/gen.lock index e7bfb24b..39efbb71 100644 --- a/gusto_embedded/.speakeasy/gen.lock +++ b/gusto_embedded/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: f70034eb-4870-4b8d-aeb4-4c71b6c1ec45 management: - docChecksum: 1929f7ebdf0e349f2d49338559dc6e43 + docChecksum: 29004e8f8da002dc3badd2a54c0d18f3 docVersion: "2024-04-01" - speakeasyVersion: 1.517.2 - generationVersion: 2.548.5 - releaseVersion: 0.2.1 - configChecksum: a78c6cb032e152722eaedd43224e57c6 + speakeasyVersion: 1.525.2 + generationVersion: 2.562.3 + releaseVersion: 0.2.2 + configChecksum: 09952e3da8ac446bf4af2a35bc91a639 repoURL: https://github.com/Gusto/gusto-python-client.git repoSubDirectory: gusto_embedded installationURL: https://github.com/Gusto/gusto-python-client.git#subdirectory=gusto_embedded @@ -16,7 +16,7 @@ features: additionalDependencies: 1.0.0 additionalProperties: 1.0.1 constsAndDefaults: 1.0.5 - core: 5.12.3 + core: 5.12.4 defaultEnabledRetries: 0.2.0 deprecations: 3.0.2 devContainers: 3.0.0 @@ -106,6 +106,7 @@ generatedFiles: - docs/models/companyonboardingstatus.md - docs/models/companypaidtimeoff.md - docs/models/companystatus.md + - docs/models/companysuspension.md - docs/models/compensation.md - docs/models/compensations.md - docs/models/contractor.md @@ -270,6 +271,7 @@ generatedFiles: - docs/models/getcompaniescompanyuuidpaidholidaysrequest.md - docs/models/getcompaniescompanyuuidpaidholidaysrequestbody.md - docs/models/getcompaniescompanyuuidreporttemplatesreporttyperequest.md + - docs/models/getcompaniescompanyuuidsuspensionsrequest.md - docs/models/getcompaniescompanyuuidtimeoffpoliciesrequest.md - docs/models/getcompaniescompanyuuidwireinrequestuuidrequest.md - docs/models/getcompaniesdepartmentsrequest.md @@ -423,6 +425,7 @@ generatedFiles: - docs/models/juneteenth.md - docs/models/key.md - docs/models/laborday.md + - docs/models/leavingfor.md - docs/models/liabilityselections.md - docs/models/licensee.md - docs/models/limitoption.md @@ -494,7 +497,6 @@ generatedFiles: - docs/models/payrolltype.md - docs/models/payrolltypes.md - docs/models/payrollwithholdingpayperiodtype.md - - docs/models/payschedule.md - docs/models/payscheduleassignment.md - docs/models/payscheduleassignmentbody.md - docs/models/payscheduleassignmentbodytype.md @@ -508,6 +510,8 @@ generatedFiles: - docs/models/payschedulecreateupdate.md - docs/models/payschedulefrequency.md - docs/models/payschedulefrequencycreateupdate.md + - docs/models/payschedulelist.md + - docs/models/payscheduleobject.md - docs/models/payscheduletype.md - docs/models/plaidstatus.md - docs/models/policytype.md @@ -529,6 +533,9 @@ generatedFiles: - docs/models/postcompaniescompanyuuidreportspaymentmethod.md - docs/models/postcompaniescompanyuuidreportsrequest.md - docs/models/postcompaniescompanyuuidreportsrequestbody.md + - docs/models/postcompaniescompanyuuidsuspensionsreconciletaxmethod.md + - docs/models/postcompaniescompanyuuidsuspensionsrequest.md + - docs/models/postcompaniescompanyuuidsuspensionsrequestbody.md - docs/models/postcompaniescompanyuuidtimeoffpoliciesaccrualmethod.md - docs/models/postcompaniescompanyuuidtimeoffpoliciesrequest.md - docs/models/postcompaniescompanyuuidtimeoffpoliciesrequestbody.md @@ -706,6 +713,7 @@ generatedFiles: - docs/models/putv1companiescompanyidpayrollspayrollidsubmitresponsebody.md - docs/models/putv1companiescompanyidpayrollsrequest.md - docs/models/putv1companiescompanyidpayrollsrequestbody.md + - docs/models/putv1companiescompanyidpayrollswithholdingpayperiod.md - docs/models/putv1companiescompanyidpayschedulespayscheduleidfrequency.md - docs/models/putv1companiescompanyidpayschedulespayscheduleidrequest.md - docs/models/putv1companiescompanyidpayschedulespayscheduleidrequestbody.md @@ -783,6 +791,7 @@ generatedFiles: - docs/models/putv1employeesemployeeidrehirerequestbody.md - docs/models/putv1employeesemployeeidstatetaxesrequest.md - docs/models/putv1employeesemployeeidstatetaxesrequestbody.md + - docs/models/putv1employeesemployeeidstatetaxesvalue.md - docs/models/putv1employeesrequest.md - docs/models/putv1employeesrequestbody.md - docs/models/putv1externalpayrollbenefits.md @@ -840,7 +849,9 @@ generatedFiles: - docs/models/queryparaminclude.md - docs/models/questions.md - docs/models/ratetype.md + - docs/models/reason.md - docs/models/recipienttype.md + - docs/models/reconciletaxmethod.md - docs/models/recoverycase.md - docs/models/recoverycasestatus.md - docs/models/redebitrecoverycaserequest.md @@ -874,6 +885,7 @@ generatedFiles: - docs/models/taxes.md - docs/models/taxliabilitiesselections.md - docs/models/taxpayertype.md + - docs/models/taxrefunds.md - docs/models/taxrequirement.md - docs/models/taxrequirementmetadata.md - docs/models/taxrequirementmetadataoptions.md @@ -964,6 +976,7 @@ generatedFiles: - docs/sdks/recoverycases/README.md - docs/sdks/reports/README.md - docs/sdks/signatories/README.md + - docs/sdks/suspensions/README.md - docs/sdks/taxrequirements/README.md - docs/sdks/timeoffpolicies/README.md - docs/sdks/webhooks/README.md @@ -1038,6 +1051,7 @@ generatedFiles: - src/gusto_embedded/models/company_custom_field.py - src/gusto_embedded/models/company_custom_field_list.py - src/gusto_embedded/models/company_onboarding_status.py + - src/gusto_embedded/models/company_suspension.py - src/gusto_embedded/models/compensation.py - src/gusto_embedded/models/contractor.py - src/gusto_embedded/models/contractor_address.py @@ -1118,6 +1132,7 @@ generatedFiles: - src/gusto_embedded/models/get_companies_company_uuid_holiday_pay_policyop.py - src/gusto_embedded/models/get_companies_company_uuid_paid_holidaysop.py - src/gusto_embedded/models/get_companies_company_uuid_report_templates_report_typeop.py + - src/gusto_embedded/models/get_companies_company_uuid_suspensionsop.py - src/gusto_embedded/models/get_companies_company_uuid_time_off_policiesop.py - src/gusto_embedded/models/get_companies_company_uuid_wire_in_request_uuidop.py - src/gusto_embedded/models/get_companies_departmentsop.py @@ -1248,7 +1263,6 @@ generatedFiles: - src/gusto_embedded/models/paid_holidays.py - src/gusto_embedded/models/paid_time_off.py - src/gusto_embedded/models/pay_period.py - - src/gusto_embedded/models/pay_schedule.py - src/gusto_embedded/models/pay_schedule_assignment.py - src/gusto_embedded/models/pay_schedule_assignment_body.py - src/gusto_embedded/models/pay_schedule_assignment_department.py @@ -1260,6 +1274,8 @@ generatedFiles: - src/gusto_embedded/models/pay_schedule_create_update.py - src/gusto_embedded/models/pay_schedule_frequency.py - src/gusto_embedded/models/pay_schedule_frequency_create_update.py + - src/gusto_embedded/models/pay_schedule_list.py + - src/gusto_embedded/models/pay_schedule_object.py - src/gusto_embedded/models/payment_configs.py - src/gusto_embedded/models/payment_method_bank_account.py - src/gusto_embedded/models/payment_speed_param.py @@ -1285,6 +1301,7 @@ generatedFiles: - src/gusto_embedded/models/payroll_withholding_pay_period_type.py - src/gusto_embedded/models/post_companies_company_uuid_holiday_pay_policyop.py - src/gusto_embedded/models/post_companies_company_uuid_reportsop.py + - src/gusto_embedded/models/post_companies_company_uuid_suspensionsop.py - src/gusto_embedded/models/post_companies_company_uuid_time_off_policiesop.py - src/gusto_embedded/models/post_companies_payroll_skip_company_uuidop.py - src/gusto_embedded/models/post_departmentsop.py @@ -1427,6 +1444,7 @@ generatedFiles: - src/gusto_embedded/sdk.py - src/gusto_embedded/sdkconfiguration.py - src/gusto_embedded/signatories.py + - src/gusto_embedded/suspensions.py - src/gusto_embedded/taxrequirements.py - src/gusto_embedded/timeoffpolicies.py - src/gusto_embedded/types/__init__.py @@ -2126,6 +2144,8 @@ examples: responses: "201": application/json: {"uuid": "f8c653dc-0094-41fb-8670-45d6399afade", "first_name": "Bob", "last_name": "Johnson", "title": "Owner", "phone": "4239879876", "email": "olin.okuneva@denesik.us", "birthday": "2002-10-31", "is_admin": false, "has_ssn": true, "version": "49ea586f528411f5cfadfd54452b2423", "identity_verification_status": "Skipped", "home_address": {"street_1": "524 Roob Divide", "street_2": "Suite 565", "city": "San Francisco", "state": "CA", "zip": "94107", "country": "USA"}} + "200": + application/json: {"uuid": "f8c653dc-0094-41fb-8670-45d6399afade", "first_name": "Bob", "last_name": "Johnson", "title": "Owner", "phone": "4239879876", "email": "olin.okuneva@denesik.us", "birthday": "2002-10-31", "is_admin": false, "has_ssn": true, "version": "49ea586f528411f5cfadfd54452b2423", "identity_verification_status": "Skipped", "home_address": {"street_1": "524 Roob Divide", "street_2": "Suite 565", "city": "San Francisco", "state": "CA", "zip": "94107", "country": "USA"}} Basic: parameters: path: @@ -2862,7 +2882,7 @@ examples: X-Gusto-API-Version: "2024-04-01" responses: "200": - application/json: [{"uuid": "2097fe08-407a-46d7-b35c-a32402a2355e", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "Engineering department pay schedule", "auto_pilot": false, "active": true}, {"uuid": "8fc9f556-74fa-4271-97f6-4bfbfc5a5352", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Sales", "custom_name": "Sales department monthly schedule", "auto_pilot": false, "active": false}, {"uuid": "0e07d35a-af11-4123-bfcb-4dd5f2f12ee1", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Staff", "custom_name": "Staff department pay schedule", "auto_pilot": true, "active": false}] + application/json: [{"uuid": "2097fe08-407a-46d7-b35c-a32402a2355e", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "Engineering department pay schedule", "auto_pilot": false, "active": true, "version": "68934a3e9455fa72420237eb05902327"}, {"uuid": "8fc9f556-74fa-4271-97f6-4bfbfc5a5352", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Sales", "custom_name": "Sales department monthly schedule", "auto_pilot": false, "active": false, "version": "68934a3e9455fa72420237eb05902320"}, {"uuid": "0e07d35a-af11-4123-bfcb-4dd5f2f12ee1", "frequency": "Monthly", "anchor_pay_date": "2020-05-31", "day_1": 31, "day_2": null, "name": "Staff", "custom_name": "Staff department pay schedule", "auto_pilot": true, "active": false, "version": "68934a3e9455fa72420237eb05902323"}] get-v1-companies-company_id-pay_schedules-preview: Example: parameters: @@ -2887,7 +2907,7 @@ examples: X-Gusto-API-Version: "2024-04-01" responses: "200": - application/json: {"uuid": "f2a69c38-e2f9-4e31-b5c5-4754fc60a052", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "A new monthly pay schedule", "auto_pilot": false, "active": true} + application/json: {"uuid": "f2a69c38-e2f9-4e31-b5c5-4754fc60a052", "frequency": "Twice per month", "anchor_pay_date": "2020-05-15", "anchor_end_of_pay_period": "2020-05-08", "day_1": 15, "day_2": 31, "name": "Engineering", "custom_name": "A new monthly pay schedule", "auto_pilot": false, "active": true, "version": "68934a3e9455fa72420237eb05902327"} put-v1-companies-company_id-pay_schedules-pay_schedule_id: Example: parameters: @@ -4165,7 +4185,7 @@ examples: header: X-Gusto-API-Version: "2024-04-01" requestBody: - application/json: {"states": [{"state": "CA", "questions": [{"key": "filing_status", "answers": [{"value": "M", "valid_from": "2010-01-01", "valid_up_to": null}]}, {"key": "withholding_allowance", "answers": [{"value": "2", "valid_from": "2010-01-01", "valid_up_to": null}]}, {"key": "additional_withholding", "answers": [{"value": "25.0", "valid_from": "2010-01-01", "valid_up_to": null}]}, {"key": "file_new_hire_report", "answers": [{"value": "true", "valid_from": "2010-01-01", "valid_up_to": null}]}]}]} + application/json: {"states": [{"state": "CA", "questions": [{"key": "filing_status", "answers": [{"value": "M", "valid_from": "2010-01-01", "valid_up_to": null}]}, {"key": "withholding_allowance", "answers": [{"value": 2, "valid_from": "2010-01-01", "valid_up_to": null}]}, {"key": "additional_withholding", "answers": [{"value": "25.0", "valid_from": "2010-01-01", "valid_up_to": null}]}, {"key": "file_new_hire_report", "answers": [{"value": true, "valid_from": "2010-01-01", "valid_up_to": null}]}]}]} responses: "200": application/json: [{"employee_uuid": "", "state": "Minnesota", "questions": [{"label": "", "description": "airbrush convalesce behind within frequent acidly sans accredit", "key": "", "input_question_format": {"type": ""}, "answers": []}, {"label": "", "description": "fuel confusion amused ugh", "key": "", "input_question_format": {"type": ""}, "answers": []}]}, {"employee_uuid": "", "state": "Oregon", "questions": [{"label": "", "description": "ugh after regularly toe", "key": "", "input_question_format": {"type": ""}, "answers": [{}, {}, {}]}]}] @@ -8101,5 +8121,65 @@ examples: responses: "200": application/json: [{"uuid": "c5fdae57-5483-4529-9aae-f0edceed92d4", "status": "rfi", "origination_bank": "JP Morgan Chase", "origination_bank_address": "1 Chase Plaza, New York, NY 10081", "recipient_name": "Gusto, Inc", "recipient_address": "525 20th Street, San Francisco, CA 94107", "recipient_account_number": "21911761", "recipient_routing_number": "5773243", "additional_notes": "Additional Notes", "bank_name": "Chase", "date_sent": "2024-06-10T00:00:00Z", "unique_tracking_code": "1trvxwxp57zf", "payment_type": "Payroll,", "payment_uuid": "payroll", "amount_sent": "1054693.52", "requested_amount": "1054693.52", "wire_in_deadline": "2024-06-21T18:00:00Z"}] + get-companies-company_uuid-suspensions: + speakeasy-default-get-companies-company-uuid-suspensions: + parameters: + path: + company_uuid: "" + header: + X-Gusto-API-Version: "2024-04-01" + responses: + "200": + application/json: [{}, {}, {}] + post-companies-company_uuid-suspensions: + Leaving to join another payroll provider: + parameters: + path: + company_uuid: "" + header: + X-Gusto-API-Version: "2024-04-01" + requestBody: + application/json: {"file_quarterly_forms": true, "file_yearly_forms": true, "reconcile_tax_method": "pay_taxes", "reason": "switching_provider", "leaving_for": "other"} + Company is shutting down: + parameters: + path: + company_uuid: "" + header: + X-Gusto-API-Version: "2024-04-01" + requestBody: + application/json: {"file_quarterly_forms": true, "file_yearly_forms": true, "reconcile_tax_method": "pay_taxes", "reason": "shutting_down"} + Basic: + parameters: + path: + company_uuid: "" + header: + X-Gusto-API-Version: "2024-04-01" + requestBody: + application/json: {"file_quarterly_forms": false, "file_yearly_forms": false, "reconcile_tax_method": "refund_taxes", "reason": "acquired"} + responses: + "422": + application/json: {"errors": [{"error_key": "base", "category": "payroll_blocker", "message": "Company must complete all onboarding requirements in order to run payroll.", "metadata": {"key": "needs_onboarding"}}]} + Resource: + parameters: + path: + company_uuid: "" + header: + X-Gusto-API-Version: "2024-04-01" + requestBody: + application/json: {"file_quarterly_forms": false, "file_yearly_forms": false, "reconcile_tax_method": "refund_taxes", "reason": "switching_provider"} + responses: + "422": + application/json: {"errors": [{"error_key": "first_name", "category": "invalid_attribute_value", "message": "First name is required"}, {"error_key": "date_of_birth", "category": "invalid_attribute_value", "message": "Date of birth is not a valid date"}]} + Nested: + parameters: + path: + company_uuid: "" + header: + X-Gusto-API-Version: "2024-04-01" + requestBody: + application/json: {"file_quarterly_forms": false, "file_yearly_forms": false, "reconcile_tax_method": "pay_taxes", "reason": "no_more_employees"} + responses: + "422": + application/json: {"errors": [{"error_key": "contractor_payments", "category": "nested_errors", "metadata": {"contractor_uuid": "72ae4617-daa9-4ed7-85e0-18ed5d0ee835"}}, {"error_key": "contractor_payments", "category": "nested_errors", "metadata": {"contractor_uuid": "2d7bf62c-babf-4a12-8292-340e2d9cab28"}}]} examplesVersion: 1.0.0 generatedTests: {} diff --git a/gusto_embedded/.speakeasy/gen.yaml b/gusto_embedded/.speakeasy/gen.yaml index 675cf87f..f5e078fd 100644 --- a/gusto_embedded/.speakeasy/gen.yaml +++ b/gusto_embedded/.speakeasy/gen.yaml @@ -18,7 +18,7 @@ generation: oAuth2ClientCredentialsEnabled: true oAuth2PasswordEnabled: true python: - version: 0.2.1 + version: 0.2.2 additionalDependencies: dev: {} main: {} diff --git a/gusto_embedded/README-PYPI.md b/gusto_embedded/README-PYPI.md index 63a26bd4..0bb2daf5 100644 --- a/gusto_embedded/README-PYPI.md +++ b/gusto_embedded/README-PYPI.md @@ -304,6 +304,11 @@ with Gusto() as gusto: * [finish_onboarding](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/companies/README.md#finish_onboarding) - Finish company onboarding * [get_custom_fields](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/companies/README.md#get_custom_fields) - Get the custom fields of a company +#### [companies.suspensions](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/suspensions/README.md) + +* [get](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/suspensions/README.md#get) - Get suspensions for this company +* [suspend](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/suspensions/README.md#suspend) - Suspend a company's account + ### [company_attachment](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/companyattachmentsdk/README.md) * [get_download_url](https://github.com/Gusto/gusto-python-client/blob/master/docs/sdks/companyattachmentsdk/README.md#get_download_url) - Get a temporary url to download the Company Attachment file diff --git a/gusto_embedded/README.md b/gusto_embedded/README.md index 690eee08..a8dfecaa 100644 --- a/gusto_embedded/README.md +++ b/gusto_embedded/README.md @@ -304,6 +304,11 @@ with Gusto() as gusto: * [finish_onboarding](docs/sdks/companies/README.md#finish_onboarding) - Finish company onboarding * [get_custom_fields](docs/sdks/companies/README.md#get_custom_fields) - Get the custom fields of a company +#### [companies.suspensions](docs/sdks/suspensions/README.md) + +* [get](docs/sdks/suspensions/README.md#get) - Get suspensions for this company +* [suspend](docs/sdks/suspensions/README.md#suspend) - Suspend a company's account + ### [company_attachment](docs/sdks/companyattachmentsdk/README.md) * [get_download_url](docs/sdks/companyattachmentsdk/README.md#get_download_url) - Get a temporary url to download the Company Attachment file diff --git a/gusto_embedded/docs/models/answers.md b/gusto_embedded/docs/models/answers.md index 146ac18a..84f48f86 100644 --- a/gusto_embedded/docs/models/answers.md +++ b/gusto_embedded/docs/models/answers.md @@ -3,8 +3,8 @@ ## Fields -| Field | Type | Required | Description | -| ----------------------- | ----------------------- | ----------------------- | ----------------------- | -| `value` | *str* | :heavy_check_mark: | N/A | -| `valid_from` | *str* | :heavy_check_mark: | N/A | -| `valid_up_to` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | +| `value` | [Nullable[models.PutV1EmployeesEmployeeIDStateTaxesValue]](../models/putv1employeesemployeeidstatetaxesvalue.md) | :heavy_check_mark: | N/A | +| `valid_from` | *str* | :heavy_check_mark: | N/A | +| `valid_up_to` | *OptionalNullable[Any]* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/gusto_embedded/docs/models/companysuspension.md b/gusto_embedded/docs/models/companysuspension.md new file mode 100644 index 00000000..5d71ddc3 --- /dev/null +++ b/gusto_embedded/docs/models/companysuspension.md @@ -0,0 +1,19 @@ +# CompanySuspension + +Record representing the suspension of a company's Gusto account. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `uuid` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for this suspension. | +| `company_uuid` | *Optional[str]* | :heavy_minus_sign: | Unique identifier for the company which is suspended. | +| `effective_date` | *Optional[str]* | :heavy_minus_sign: | Date that the suspension took effect. | +| `leaving_for` | *Optional[str]* | :heavy_minus_sign: | Which competitor the company is joining instead. Only required if `reason` is `'switching_provider'`. | +| `reason` | *Optional[str]* | :heavy_minus_sign: | Explanation for why the company's account was suspended. | +| `reconcile_tax_method` | [Optional[models.ReconcileTaxMethod]](../models/reconciletaxmethod.md) | :heavy_minus_sign: | How Gusto will handle taxes already collected. | +| `file_quarterly_forms` | *Optional[bool]* | :heavy_minus_sign: | Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company
is suspending their account, and how taxes are being reconciled.
| +| `file_yearly_forms` | *Optional[bool]* | :heavy_minus_sign: | Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company
is suspending their account, and how taxes are being reconciled.
| +| `comments` | *Optional[str]* | :heavy_minus_sign: | User-supplied comments describing why then are suspending their account. | +| `tax_refunds` | [Optional[models.TaxRefunds]](../models/taxrefunds.md) | :heavy_minus_sign: | Describes the taxes which are refundable to the company for this suspension. These may be refunded, or paid
by Gusto, depending on the value in `reconcile_tax_method`.
| \ No newline at end of file diff --git a/gusto_embedded/docs/models/employeefederaltax.md b/gusto_embedded/docs/models/employeefederaltax.md index cb9f25bf..f50f54e6 100644 --- a/gusto_embedded/docs/models/employeefederaltax.md +++ b/gusto_embedded/docs/models/employeefederaltax.md @@ -8,7 +8,7 @@ Example response | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `version` | *str* | :heavy_check_mark: | The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. | -| `filing_status` | *str* | :heavy_check_mark: | It determines which tax return form an individual will use and is an important factor in computing taxable income. One of:
- Single
- Married
- Head of Household
- Exempt from withholding
- Married, but withhold as Single (does not apply to rev_2020_w4 form) | +| `filing_status` | *Nullable[str]* | :heavy_check_mark: | It determines which tax return form an individual will use and is an important factor in computing taxable income. One of:
- Single
- Married
- Head of Household
- Exempt from withholding
- Married, but withhold as Single (does not apply to rev_2020_w4 form) | | `extra_withholding` | *Nullable[str]* | :heavy_check_mark: | An employee can request an additional amount to be withheld from each paycheck. | | `two_jobs` | *Nullable[bool]* | :heavy_check_mark: | If there are only two jobs (i.e., you and your spouse each have a job, or you have two), you can set it to true. | | `dependents_amount` | *Nullable[str]* | :heavy_check_mark: | A dependent is a person other than the taxpayer or spouse who entitles the taxpayer to claim a dependency exemption. | diff --git a/gusto_embedded/docs/models/getcompaniescompanyuuidsuspensionsrequest.md b/gusto_embedded/docs/models/getcompaniescompanyuuidsuspensionsrequest.md new file mode 100644 index 00000000..fb8b708d --- /dev/null +++ b/gusto_embedded/docs/models/getcompaniescompanyuuidsuspensionsrequest.md @@ -0,0 +1,9 @@ +# GetCompaniesCompanyUUIDSuspensionsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_uuid` | *str* | :heavy_check_mark: | The UUID of the company | +| `x_gusto_api_version` | [Optional[models.VersionHeader]](../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | \ No newline at end of file diff --git a/gusto_embedded/docs/models/leavingfor.md b/gusto_embedded/docs/models/leavingfor.md new file mode 100644 index 00000000..5c06701d --- /dev/null +++ b/gusto_embedded/docs/models/leavingfor.md @@ -0,0 +1,30 @@ +# LeavingFor + +Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`. + + +## Values + +| Name | Value | +| ------------------------------- | ------------------------------- | +| `APD` | apd | +| `ADP_TOTAL_SOURCE` | adp_total_source | +| `ACCOUNTANT` | accountant | +| `BAMBOO_HR` | bamboo_hr | +| `BANK_OR_FINANCIAL_INSTITUTION` | bank_or_financial_institution | +| `CHECK` | check | +| `INSPERITY` | insperity | +| `INTUIT_OR_QUICKBOOKS` | intuit_or_quickbooks | +| `JUSTWORKS` | justworks | +| `MANUAL` | manual | +| `NAMELY` | namely | +| `ONPAY` | onpay | +| `OTHER` | other | +| `PATRIOT` | patriot | +| `PAYCOM` | paycom | +| `PAYLOCITY` | paylocity | +| `RIPPLING` | rippling | +| `SQUARE` | square | +| `SUREPAYROLL` | surepayroll | +| `TRINET` | trinet | +| `ZENEFITS` | zenefits | \ No newline at end of file diff --git a/gusto_embedded/docs/models/payschedule.md b/gusto_embedded/docs/models/payschedulelist.md similarity index 92% rename from gusto_embedded/docs/models/payschedule.md rename to gusto_embedded/docs/models/payschedulelist.md index eca96279..08d4693b 100644 --- a/gusto_embedded/docs/models/payschedule.md +++ b/gusto_embedded/docs/models/payschedulelist.md @@ -1,4 +1,4 @@ -# PaySchedule +# PayScheduleList The representation of a pay schedule. @@ -8,6 +8,7 @@ The representation of a pay schedule. | Field | Type | Required | Description | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `uuid` | *str* | :heavy_check_mark: | The unique identifier of the pay schedule in Gusto. | +| `version` | *str* | :heavy_check_mark: | The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. | | `frequency` | [Optional[models.PayScheduleFrequency]](../models/payschedulefrequency.md) | :heavy_minus_sign: | The frequency that employees on this pay schedule are paid with Gusto. | | `anchor_pay_date` | *Optional[str]* | :heavy_minus_sign: | The first date that employees on this pay schedule are paid with Gusto. | | `anchor_end_of_pay_period` | *Optional[str]* | :heavy_minus_sign: | The last date of the first pay period. This can be the same date as the anchor pay date. | diff --git a/gusto_embedded/docs/models/payscheduleobject.md b/gusto_embedded/docs/models/payscheduleobject.md new file mode 100644 index 00000000..194811cd --- /dev/null +++ b/gusto_embedded/docs/models/payscheduleobject.md @@ -0,0 +1,20 @@ +# PayScheduleObject + +The representation of a pay schedule. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `uuid` | *str* | :heavy_check_mark: | The unique identifier of the pay schedule in Gusto. | +| `version` | *str* | :heavy_check_mark: | The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field. | +| `frequency` | [Optional[models.PayScheduleFrequency]](../models/payschedulefrequency.md) | :heavy_minus_sign: | The frequency that employees on this pay schedule are paid with Gusto. | +| `anchor_pay_date` | *Optional[str]* | :heavy_minus_sign: | The first date that employees on this pay schedule are paid with Gusto. | +| `anchor_end_of_pay_period` | *Optional[str]* | :heavy_minus_sign: | The last date of the first pay period. This can be the same date as the anchor pay date. | +| `day_1` | *OptionalNullable[int]* | :heavy_minus_sign: | An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies. | +| `day_2` | *OptionalNullable[int]* | :heavy_minus_sign: | An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the "Twice per month" frequency. For semi-monthly pay schedules, this field should be set to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies. | +| `name` | *OptionalNullable[str]* | :heavy_minus_sign: | This field will be hourly when the pay schedule is for hourly employees, salaried when the pay schedule is for salaried employees, the department name if pay schedule is by department, and null when the pay schedule is for all employees. | +| `custom_name` | *Optional[str]* | :heavy_minus_sign: | A custom name for a pay schedule, defaults to the pay frequency description. | +| `auto_pilot` | *Optional[bool]* | :heavy_minus_sign: | With Autopilot® enabled, payroll will run automatically one day before your payroll deadlines. | +| `active` | *Optional[bool]* | :heavy_minus_sign: | Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned. | \ No newline at end of file diff --git a/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsreconciletaxmethod.md b/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsreconciletaxmethod.md new file mode 100644 index 00000000..57147ab2 --- /dev/null +++ b/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsreconciletaxmethod.md @@ -0,0 +1,11 @@ +# PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod + +How Gusto will handle taxes already collected. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `PAY_TAXES` | pay_taxes | +| `REFUND_TAXES` | refund_taxes | \ No newline at end of file diff --git a/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsrequest.md b/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsrequest.md new file mode 100644 index 00000000..67f1e68e --- /dev/null +++ b/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsrequest.md @@ -0,0 +1,10 @@ +# PostCompaniesCompanyUUIDSuspensionsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_uuid` | *str* | :heavy_check_mark: | The UUID of the company | +| `request_body` | [models.PostCompaniesCompanyUUIDSuspensionsRequestBody](../models/postcompaniescompanyuuidsuspensionsrequestbody.md) | :heavy_check_mark: | N/A | +| `x_gusto_api_version` | [Optional[models.VersionHeader]](../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | \ No newline at end of file diff --git a/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsrequestbody.md b/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsrequestbody.md new file mode 100644 index 00000000..ce66319f --- /dev/null +++ b/gusto_embedded/docs/models/postcompaniescompanyuuidsuspensionsrequestbody.md @@ -0,0 +1,13 @@ +# PostCompaniesCompanyUUIDSuspensionsRequestBody + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `file_quarterly_forms` | *bool* | :heavy_check_mark: | Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. | +| `file_yearly_forms` | *bool* | :heavy_check_mark: | Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. | +| `reconcile_tax_method` | [models.PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod](../models/postcompaniescompanyuuidsuspensionsreconciletaxmethod.md) | :heavy_check_mark: | How Gusto will handle taxes already collected. | +| `reason` | [models.Reason](../models/reason.md) | :heavy_check_mark: | Explanation for why the company is suspending their account.

> 🚧 FEIN or entity type changes require Customer Support
>
> If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. | +| `comments` | *Optional[str]* | :heavy_minus_sign: | User-supplied comments describing why they are suspending their account. | +| `leaving_for` | [Optional[models.LeavingFor]](../models/leavingfor.md) | :heavy_minus_sign: | Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`. | \ No newline at end of file diff --git a/gusto_embedded/docs/models/putv1companiescompanyidpayrollsrequestbody.md b/gusto_embedded/docs/models/putv1companiescompanyidpayrollsrequestbody.md index 7f655f5f..e89b2855 100644 --- a/gusto_embedded/docs/models/putv1companiescompanyidpayrollsrequestbody.md +++ b/gusto_embedded/docs/models/putv1companiescompanyidpayrollsrequestbody.md @@ -3,6 +3,9 @@ ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -| `employee_compensations` | List[[models.PutV1CompaniesCompanyIDPayrollsEmployeeCompensations](../models/putv1companiescompanyidpayrollsemployeecompensations.md)] | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `employee_compensations` | List[[models.PutV1CompaniesCompanyIDPayrollsEmployeeCompensations](../models/putv1companiescompanyidpayrollsemployeecompensations.md)] | :heavy_check_mark: | N/A | +| `withholding_pay_period` | [Optional[models.PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod]](../models/putv1companiescompanyidpayrollswithholdingpayperiod.md) | :heavy_minus_sign: | The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. | +| `skip_regular_deductions` | *Optional[bool]* | :heavy_minus_sign: | Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. | +| `fixed_withholding_rate` | *Optional[bool]* | :heavy_minus_sign: | Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. | \ No newline at end of file diff --git a/gusto_embedded/docs/models/putv1companiescompanyidpayrollswithholdingpayperiod.md b/gusto_embedded/docs/models/putv1companiescompanyidpayrollswithholdingpayperiod.md new file mode 100644 index 00000000..b958ed95 --- /dev/null +++ b/gusto_embedded/docs/models/putv1companiescompanyidpayrollswithholdingpayperiod.md @@ -0,0 +1,16 @@ +# PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod + +The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. + + +## Values + +| Name | Value | +| ------------------ | ------------------ | +| `EVERY_WEEK` | Every week | +| `EVERY_OTHER_WEEK` | Every other week | +| `TWICE_PER_MONTH` | Twice per month | +| `MONTHLY` | Monthly | +| `QUARTERLY` | Quarterly | +| `SEMIANNUALLY` | Semiannually | +| `ANNUALLY` | Annually | \ No newline at end of file diff --git a/gusto_embedded/docs/models/putv1employeesemployeeidstatetaxesvalue.md b/gusto_embedded/docs/models/putv1employeesemployeeidstatetaxesvalue.md new file mode 100644 index 00000000..cd324977 --- /dev/null +++ b/gusto_embedded/docs/models/putv1employeesemployeeidstatetaxesvalue.md @@ -0,0 +1,23 @@ +# PutV1EmployeesEmployeeIDStateTaxesValue + + +## Supported Types + +### `str` + +```python +value: str = /* values here */ +``` + +### `float` + +```python +value: float = /* values here */ +``` + +### `bool` + +```python +value: bool = /* values here */ +``` + diff --git a/gusto_embedded/docs/models/reason.md b/gusto_embedded/docs/models/reason.md new file mode 100644 index 00000000..e569f3a3 --- /dev/null +++ b/gusto_embedded/docs/models/reason.md @@ -0,0 +1,18 @@ +# Reason + +Explanation for why the company is suspending their account. + +> 🚧 FEIN or entity type changes require Customer Support +> +> If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `SWITCHING_PROVIDER` | switching_provider | +| `SHUTTING_DOWN` | shutting_down | +| `ACQUIRED` | acquired | +| `NO_MORE_EMPLOYEES` | no_more_employees | +| `CHANGING_EIN_OR_ENTITY_TYPE` | changing_ein_or_entity_type | \ No newline at end of file diff --git a/gusto_embedded/docs/models/reconciletaxmethod.md b/gusto_embedded/docs/models/reconciletaxmethod.md new file mode 100644 index 00000000..38662ebc --- /dev/null +++ b/gusto_embedded/docs/models/reconciletaxmethod.md @@ -0,0 +1,11 @@ +# ReconcileTaxMethod + +How Gusto will handle taxes already collected. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `PAY_TAXES` | pay_taxes | +| `REFUND_TAXES` | refund_taxes | \ No newline at end of file diff --git a/gusto_embedded/docs/models/taxrefunds.md b/gusto_embedded/docs/models/taxrefunds.md new file mode 100644 index 00000000..2b5cecae --- /dev/null +++ b/gusto_embedded/docs/models/taxrefunds.md @@ -0,0 +1,13 @@ +# TaxRefunds + +Describes the taxes which are refundable to the company for this suspension. These may be refunded, or paid +by Gusto, depending on the value in `reconcile_tax_method`. + + + +## Fields + +| Field | Type | Required | Description | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `amount` | *Optional[str]* | :heavy_minus_sign: | Dollar amount. | +| `description` | *Optional[str]* | :heavy_minus_sign: | What kind of tax this is. | \ No newline at end of file diff --git a/gusto_embedded/docs/sdks/employeetaxsetup/README.md b/gusto_embedded/docs/sdks/employeetaxsetup/README.md index a124aa91..360fd58f 100644 --- a/gusto_embedded/docs/sdks/employeetaxsetup/README.md +++ b/gusto_embedded/docs/sdks/employeetaxsetup/README.md @@ -194,7 +194,7 @@ with Gusto( "key": "withholding_allowance", "answers": [ { - "value": "2", + "value": 2, "valid_from": "2010-01-01", "valid_up_to": None, }, @@ -214,7 +214,7 @@ with Gusto( "key": "file_new_hire_report", "answers": [ { - "value": "true", + "value": True, "valid_from": "2010-01-01", "valid_up_to": None, }, diff --git a/gusto_embedded/docs/sdks/payrolls/README.md b/gusto_embedded/docs/sdks/payrolls/README.md index a26a34c1..0a12abe6 100644 --- a/gusto_embedded/docs/sdks/payrolls/README.md +++ b/gusto_embedded/docs/sdks/payrolls/README.md @@ -270,13 +270,16 @@ with Gusto( ### Parameters -| Parameter | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `company_id` | *str* | :heavy_check_mark: | The UUID of the company | -| `payroll_id` | *str* | :heavy_check_mark: | The UUID of the payroll | -| `employee_compensations` | List[[models.PutV1CompaniesCompanyIDPayrollsEmployeeCompensations](../../models/putv1companiescompanyidpayrollsemployeecompensations.md)] | :heavy_check_mark: | N/A | -| `x_gusto_api_version` | [Optional[models.VersionHeader]](../../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | -| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_id` | *str* | :heavy_check_mark: | The UUID of the company | +| `payroll_id` | *str* | :heavy_check_mark: | The UUID of the payroll | +| `employee_compensations` | List[[models.PutV1CompaniesCompanyIDPayrollsEmployeeCompensations](../../models/putv1companiescompanyidpayrollsemployeecompensations.md)] | :heavy_check_mark: | N/A | +| `x_gusto_api_version` | [Optional[models.VersionHeader]](../../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | +| `withholding_pay_period` | [Optional[models.PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod]](../../models/putv1companiescompanyidpayrollswithholdingpayperiod.md) | :heavy_minus_sign: | The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. | +| `skip_regular_deductions` | *Optional[bool]* | :heavy_minus_sign: | Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. | +| `fixed_withholding_rate` | *Optional[bool]* | :heavy_minus_sign: | Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | ### Response diff --git a/gusto_embedded/docs/sdks/payschedules/README.md b/gusto_embedded/docs/sdks/payschedules/README.md index 9a0945e2..18abedca 100644 --- a/gusto_embedded/docs/sdks/payschedules/README.md +++ b/gusto_embedded/docs/sdks/payschedules/README.md @@ -106,7 +106,7 @@ with Gusto( ### Response -**[List[models.PaySchedule]](../../models/.md)** +**[List[models.PayScheduleList]](../../models/.md)** ### Errors @@ -197,7 +197,7 @@ with Gusto( ### Response -**[models.PaySchedule](../../models/payschedule.md)** +**[models.PayScheduleObject](../../models/payscheduleobject.md)** ### Errors diff --git a/gusto_embedded/docs/sdks/suspensions/README.md b/gusto_embedded/docs/sdks/suspensions/README.md new file mode 100644 index 00000000..a04e096b --- /dev/null +++ b/gusto_embedded/docs/sdks/suspensions/README.md @@ -0,0 +1,105 @@ +# Suspensions +(*companies.suspensions*) + +## Overview + +### Available Operations + +* [get](#get) - Get suspensions for this company +* [suspend](#suspend) - Suspend a company's account + +## get + +Get existing suspension records for this company. A company may have multiple suspension records if they have suspended their Gusto account more than once. + +> 📘 To check if company is already suspended +> +> To determine if a company is _currently_ suspended, use the `is_suspended` and `company_status` fields in the [Get a company](https://docs.gusto.com/embedded-payroll/reference/get-v1-companies) endpoint. + +scope: `company_suspensions:read` + +### Example Usage + +```python +from gusto_embedded import Gusto +import os + + +with Gusto( + company_access_auth=os.getenv("GUSTO_COMPANY_ACCESS_AUTH", ""), +) as gusto: + + res = gusto.companies.suspensions.get(company_uuid="") + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_uuid` | *str* | :heavy_check_mark: | The UUID of the company | +| `x_gusto_api_version` | [Optional[models.VersionHeader]](../../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[List[models.CompanySuspension]](../../models/.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| models.APIError | 4XX, 5XX | \*/\* | + +## suspend + +Use this endpoint to suspend a company. After suspension, company will no longer be able to run payroll but will retain access to their information, such as retrieving employee info or retrieving past payrolls. + +scope: `company_suspensions:write` + +### Example Usage + +```python +import gusto_embedded +from gusto_embedded import Gusto +import os + + +with Gusto( + company_access_auth=os.getenv("GUSTO_COMPANY_ACCESS_AUTH", ""), +) as gusto: + + res = gusto.companies.suspensions.suspend(company_uuid="", file_quarterly_forms=True, file_yearly_forms=True, reconcile_tax_method=gusto_embedded.PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod.PAY_TAXES, reason=gusto_embedded.Reason.SWITCHING_PROVIDER, leaving_for=gusto_embedded.LeavingFor.OTHER) + + # Handle response + print(res) + +``` + +### Parameters + +| Parameter | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `company_uuid` | *str* | :heavy_check_mark: | The UUID of the company | +| `file_quarterly_forms` | *bool* | :heavy_check_mark: | Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. | +| `file_yearly_forms` | *bool* | :heavy_check_mark: | Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. | +| `reconcile_tax_method` | [models.PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod](../../models/postcompaniescompanyuuidsuspensionsreconciletaxmethod.md) | :heavy_check_mark: | How Gusto will handle taxes already collected. | +| `reason` | [models.Reason](../../models/reason.md) | :heavy_check_mark: | Explanation for why the company is suspending their account.

> 🚧 FEIN or entity type changes require Customer Support
>
> If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. | +| `x_gusto_api_version` | [Optional[models.VersionHeader]](../../models/versionheader.md) | :heavy_minus_sign: | Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. | +| `comments` | *Optional[str]* | :heavy_minus_sign: | User-supplied comments describing why they are suspending their account. | +| `leaving_for` | [Optional[models.LeavingFor]](../../models/leavingfor.md) | :heavy_minus_sign: | Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`. | +| `retries` | [Optional[utils.RetryConfig]](../../models/utils/retryconfig.md) | :heavy_minus_sign: | Configuration to override the default retry behavior of the client. | + +### Response + +**[models.CompanySuspension](../../models/companysuspension.md)** + +### Errors + +| Error Type | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| models.UnprocessableEntityErrorObject | 422 | application/json | +| models.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/gusto_embedded/pylintrc b/gusto_embedded/pylintrc index d3b064b5..bfa9a880 100644 --- a/gusto_embedded/pylintrc +++ b/gusto_embedded/pylintrc @@ -459,7 +459,8 @@ disable=raw-checker-failed, relative-beyond-top-level, consider-using-with, wildcard-import, - unused-wildcard-import + unused-wildcard-import, + too-many-return-statements # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option @@ -660,4 +661,4 @@ init-import=no # List of qualified module names which can have objects that can redefine # builtins. -redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io +redefining-builtins-modules=six.moves,past.builtins,future.builtins,builtins,io \ No newline at end of file diff --git a/gusto_embedded/pyproject.toml b/gusto_embedded/pyproject.toml index 5cacd389..f2bcf715 100644 --- a/gusto_embedded/pyproject.toml +++ b/gusto_embedded/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "gusto_embedded" -version = "0.2.1" +version = "0.2.2" description = "Python Client SDK Generated by Speakeasy." authors = [{ name = "Speakeasy" },] readme = "README-PYPI.md" diff --git a/gusto_embedded/src/gusto_embedded/_version.py b/gusto_embedded/src/gusto_embedded/_version.py index e82bad64..94813ad7 100644 --- a/gusto_embedded/src/gusto_embedded/_version.py +++ b/gusto_embedded/src/gusto_embedded/_version.py @@ -3,10 +3,10 @@ import importlib.metadata __title__: str = "gusto_embedded" -__version__: str = "0.2.1" +__version__: str = "0.2.2" __openapi_doc_version__: str = "2024-04-01" -__gen_version__: str = "2.548.5" -__user_agent__: str = "speakeasy-sdk/python 0.2.1 2.548.5 2024-04-01 gusto_embedded" +__gen_version__: str = "2.562.3" +__user_agent__: str = "speakeasy-sdk/python 0.2.2 2.562.3 2024-04-01 gusto_embedded" try: if __package__ is not None: diff --git a/gusto_embedded/src/gusto_embedded/companies.py b/gusto_embedded/src/gusto_embedded/companies.py index 9b77b167..e6c30857 100644 --- a/gusto_embedded/src/gusto_embedded/companies.py +++ b/gusto_embedded/src/gusto_embedded/companies.py @@ -1,14 +1,26 @@ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from .basesdk import BaseSDK +from .sdkconfiguration import SDKConfiguration from gusto_embedded import models, utils from gusto_embedded._hooks import HookContext +from gusto_embedded.suspensions import Suspensions from gusto_embedded.types import OptionalNullable, UNSET from gusto_embedded.utils import get_security_from_env from typing import Any, List, Mapping, Optional, Union class Companies(BaseSDK): + suspensions: Suspensions + + def __init__(self, sdk_config: SDKConfiguration) -> None: + BaseSDK.__init__(self, sdk_config) + self.sdk_configuration = sdk_config + self._init_sdks() + + def _init_sdks(self): + self.suspensions = Suspensions(self.sdk_configuration) + def create_partner_managed( self, *, diff --git a/gusto_embedded/src/gusto_embedded/models/__init__.py b/gusto_embedded/src/gusto_embedded/models/__init__.py index 18bc57fa..d9c0275c 100644 --- a/gusto_embedded/src/gusto_embedded/models/__init__.py +++ b/gusto_embedded/src/gusto_embedded/models/__init__.py @@ -134,6 +134,13 @@ OnboardingStepTypedDict, Requirements, ) +from .company_suspension import ( + CompanySuspension, + CompanySuspensionTypedDict, + ReconcileTaxMethod, + TaxRefunds, + TaxRefundsTypedDict, +) from .compensation import ( Compensation, CompensationTypedDict, @@ -529,6 +536,10 @@ GetCompaniesCompanyUUIDReportTemplatesReportTypeRequest, GetCompaniesCompanyUUIDReportTemplatesReportTypeRequestTypedDict, ) +from .get_companies_company_uuid_suspensionsop import ( + GetCompaniesCompanyUUIDSuspensionsRequest, + GetCompaniesCompanyUUIDSuspensionsRequestTypedDict, +) from .get_companies_company_uuid_time_off_policiesop import ( GetCompaniesCompanyUUIDTimeOffPoliciesRequest, GetCompaniesCompanyUUIDTimeOffPoliciesRequestTypedDict, @@ -1099,7 +1110,6 @@ PayPeriodTypedDict, PayrollType, ) -from .pay_schedule import PaySchedule, PayScheduleTypedDict from .pay_schedule_assignment import ( PayScheduleAssignment, PayScheduleAssignmentTypedDict, @@ -1145,6 +1155,8 @@ ) from .pay_schedule_frequency import PayScheduleFrequency from .pay_schedule_frequency_create_update import PayScheduleFrequencyCreateUpdate +from .pay_schedule_list import PayScheduleList, PayScheduleListTypedDict +from .pay_schedule_object import PayScheduleObject, PayScheduleObjectTypedDict from .payment_configs import PaymentConfigs, PaymentConfigsTypedDict from .payment_method_bank_account import ( PaymentMethodBankAccount, @@ -1287,6 +1299,15 @@ PostCompaniesCompanyUUIDReportsRequestBodyTypedDict, PostCompaniesCompanyUUIDReportsRequestTypedDict, ) +from .post_companies_company_uuid_suspensionsop import ( + LeavingFor, + PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod, + PostCompaniesCompanyUUIDSuspensionsRequest, + PostCompaniesCompanyUUIDSuspensionsRequestBody, + PostCompaniesCompanyUUIDSuspensionsRequestBodyTypedDict, + PostCompaniesCompanyUUIDSuspensionsRequestTypedDict, + Reason, +) from .post_companies_company_uuid_time_off_policiesop import ( PostCompaniesCompanyUUIDTimeOffPoliciesAccrualMethod, PostCompaniesCompanyUUIDTimeOffPoliciesRequest, @@ -1750,6 +1771,7 @@ PutV1CompaniesCompanyIDPayrollsRequestBody, PutV1CompaniesCompanyIDPayrollsRequestBodyTypedDict, PutV1CompaniesCompanyIDPayrollsRequestTypedDict, + PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod, ) from .put_v1_companies_company_uuid_signatories_signatory_uuidop import ( PutV1CompaniesCompanyUUIDSignatoriesSignatoryUUIDHomeAddress, @@ -1946,6 +1968,8 @@ PutV1EmployeesEmployeeIDStateTaxesRequestBody, PutV1EmployeesEmployeeIDStateTaxesRequestBodyTypedDict, PutV1EmployeesEmployeeIDStateTaxesRequestTypedDict, + PutV1EmployeesEmployeeIDStateTaxesValue, + PutV1EmployeesEmployeeIDStateTaxesValueTypedDict, Questions, QuestionsTypedDict, States, @@ -2290,6 +2314,8 @@ "CompanyPaidTimeOff", "CompanyPaidTimeOffTypedDict", "CompanyStatus", + "CompanySuspension", + "CompanySuspensionTypedDict", "CompanyTypedDict", "Compensation", "CompensationTypedDict", @@ -2584,6 +2610,8 @@ "GetCompaniesCompanyUUIDPaidHolidaysRequestTypedDict", "GetCompaniesCompanyUUIDReportTemplatesReportTypeRequest", "GetCompaniesCompanyUUIDReportTemplatesReportTypeRequestTypedDict", + "GetCompaniesCompanyUUIDSuspensionsRequest", + "GetCompaniesCompanyUUIDSuspensionsRequestTypedDict", "GetCompaniesCompanyUUIDTimeOffPoliciesRequest", "GetCompaniesCompanyUUIDTimeOffPoliciesRequestTypedDict", "GetCompaniesCompanyUUIDWireInRequestUUIDRequest", @@ -2878,6 +2906,7 @@ "Key", "LaborDay", "LaborDayTypedDict", + "LeavingFor", "LiabilitySelections", "LiabilitySelectionsTypedDict", "Licensee", @@ -2928,7 +2957,6 @@ "PayPeriodTypedDict", "PayPeriods", "PayPeriodsTypedDict", - "PaySchedule", "PayScheduleAssignment", "PayScheduleAssignmentBody", "PayScheduleAssignmentBodyType", @@ -2951,8 +2979,11 @@ "PayScheduleCreateUpdateTypedDict", "PayScheduleFrequency", "PayScheduleFrequencyCreateUpdate", + "PayScheduleList", + "PayScheduleListTypedDict", + "PayScheduleObject", + "PayScheduleObjectTypedDict", "PayScheduleType", - "PayScheduleTypedDict", "PaymentConfigs", "PaymentConfigsTypedDict", "PaymentDirection", @@ -3060,6 +3091,11 @@ "PostCompaniesCompanyUUIDReportsRequestBody", "PostCompaniesCompanyUUIDReportsRequestBodyTypedDict", "PostCompaniesCompanyUUIDReportsRequestTypedDict", + "PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod", + "PostCompaniesCompanyUUIDSuspensionsRequest", + "PostCompaniesCompanyUUIDSuspensionsRequestBody", + "PostCompaniesCompanyUUIDSuspensionsRequestBodyTypedDict", + "PostCompaniesCompanyUUIDSuspensionsRequestTypedDict", "PostCompaniesCompanyUUIDTimeOffPoliciesAccrualMethod", "PostCompaniesCompanyUUIDTimeOffPoliciesRequest", "PostCompaniesCompanyUUIDTimeOffPoliciesRequestBody", @@ -3398,6 +3434,7 @@ "PutV1CompaniesCompanyIDPayrollsRequestBody", "PutV1CompaniesCompanyIDPayrollsRequestBodyTypedDict", "PutV1CompaniesCompanyIDPayrollsRequestTypedDict", + "PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod", "PutV1CompaniesCompanyUUIDSignatoriesSignatoryUUIDHomeAddress", "PutV1CompaniesCompanyUUIDSignatoriesSignatoryUUIDHomeAddressTypedDict", "PutV1CompaniesCompanyUUIDSignatoriesSignatoryUUIDRequest", @@ -3532,6 +3569,8 @@ "PutV1EmployeesEmployeeIDStateTaxesRequestBody", "PutV1EmployeesEmployeeIDStateTaxesRequestBodyTypedDict", "PutV1EmployeesEmployeeIDStateTaxesRequestTypedDict", + "PutV1EmployeesEmployeeIDStateTaxesValue", + "PutV1EmployeesEmployeeIDStateTaxesValueTypedDict", "PutV1EmployeesRequest", "PutV1EmployeesRequestBody", "PutV1EmployeesRequestBodyTypedDict", @@ -3641,7 +3680,9 @@ "Questions", "QuestionsTypedDict", "RateType", + "Reason", "RecipientType", + "ReconcileTaxMethod", "RecoveryCase", "RecoveryCaseStatus", "RecoveryCaseTypedDict", @@ -3696,6 +3737,8 @@ "TaxLiabilitiesSelections", "TaxLiabilitiesSelectionsTypedDict", "TaxPayerType", + "TaxRefunds", + "TaxRefundsTypedDict", "TaxRequirement", "TaxRequirementMetadata", "TaxRequirementMetadataOptions", diff --git a/gusto_embedded/src/gusto_embedded/models/company_suspension.py b/gusto_embedded/src/gusto_embedded/models/company_suspension.py new file mode 100644 index 00000000..a7d831de --- /dev/null +++ b/gusto_embedded/src/gusto_embedded/models/company_suspension.py @@ -0,0 +1,116 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from enum import Enum +from gusto_embedded.types import BaseModel +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class ReconcileTaxMethod(str, Enum): + r"""How Gusto will handle taxes already collected.""" + + PAY_TAXES = "pay_taxes" + REFUND_TAXES = "refund_taxes" + + +class TaxRefundsTypedDict(TypedDict): + r"""Describes the taxes which are refundable to the company for this suspension. These may be refunded, or paid + by Gusto, depending on the value in `reconcile_tax_method`. + + """ + + amount: NotRequired[str] + r"""Dollar amount.""" + description: NotRequired[str] + r"""What kind of tax this is.""" + + +class TaxRefunds(BaseModel): + r"""Describes the taxes which are refundable to the company for this suspension. These may be refunded, or paid + by Gusto, depending on the value in `reconcile_tax_method`. + + """ + + amount: Optional[str] = None + r"""Dollar amount.""" + + description: Optional[str] = None + r"""What kind of tax this is.""" + + +class CompanySuspensionTypedDict(TypedDict): + r"""Record representing the suspension of a company's Gusto account.""" + + uuid: NotRequired[str] + r"""Unique identifier for this suspension.""" + company_uuid: NotRequired[str] + r"""Unique identifier for the company which is suspended.""" + effective_date: NotRequired[str] + r"""Date that the suspension took effect.""" + leaving_for: NotRequired[str] + r"""Which competitor the company is joining instead. Only required if `reason` is `'switching_provider'`.""" + reason: NotRequired[str] + r"""Explanation for why the company's account was suspended.""" + reconcile_tax_method: NotRequired[ReconcileTaxMethod] + r"""How Gusto will handle taxes already collected.""" + file_quarterly_forms: NotRequired[bool] + r"""Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company + is suspending their account, and how taxes are being reconciled. + + """ + file_yearly_forms: NotRequired[bool] + r"""Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company + is suspending their account, and how taxes are being reconciled. + + """ + comments: NotRequired[str] + r"""User-supplied comments describing why then are suspending their account.""" + tax_refunds: NotRequired[TaxRefundsTypedDict] + r"""Describes the taxes which are refundable to the company for this suspension. These may be refunded, or paid + by Gusto, depending on the value in `reconcile_tax_method`. + + """ + + +class CompanySuspension(BaseModel): + r"""Record representing the suspension of a company's Gusto account.""" + + uuid: Optional[str] = None + r"""Unique identifier for this suspension.""" + + company_uuid: Optional[str] = None + r"""Unique identifier for the company which is suspended.""" + + effective_date: Optional[str] = None + r"""Date that the suspension took effect.""" + + leaving_for: Optional[str] = None + r"""Which competitor the company is joining instead. Only required if `reason` is `'switching_provider'`.""" + + reason: Optional[str] = None + r"""Explanation for why the company's account was suspended.""" + + reconcile_tax_method: Optional[ReconcileTaxMethod] = None + r"""How Gusto will handle taxes already collected.""" + + file_quarterly_forms: Optional[bool] = None + r"""Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company + is suspending their account, and how taxes are being reconciled. + + """ + + file_yearly_forms: Optional[bool] = None + r"""Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company + is suspending their account, and how taxes are being reconciled. + + """ + + comments: Optional[str] = None + r"""User-supplied comments describing why then are suspending their account.""" + + tax_refunds: Optional[TaxRefunds] = None + r"""Describes the taxes which are refundable to the company for this suspension. These may be refunded, or paid + by Gusto, depending on the value in `reconcile_tax_method`. + + """ diff --git a/gusto_embedded/src/gusto_embedded/models/employee_federal_tax.py b/gusto_embedded/src/gusto_embedded/models/employee_federal_tax.py index 83f81ef0..1e23c360 100644 --- a/gusto_embedded/src/gusto_embedded/models/employee_federal_tax.py +++ b/gusto_embedded/src/gusto_embedded/models/employee_federal_tax.py @@ -20,7 +20,7 @@ class EmployeeFederalTaxTypedDict(TypedDict): version: str r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" - filing_status: str + filing_status: Nullable[str] r"""It determines which tax return form an individual will use and is an important factor in computing taxable income. One of: - Single - Married @@ -55,7 +55,7 @@ class EmployeeFederalTax(BaseModel): version: str r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" - filing_status: str + filing_status: Nullable[str] r"""It determines which tax return form an individual will use and is an important factor in computing taxable income. One of: - Single - Married @@ -95,6 +95,7 @@ class EmployeeFederalTax(BaseModel): def serialize_model(self, handler): optional_fields = ["federal_withholding_allowance", "additional_withholding"] nullable_fields = [ + "filing_status", "extra_withholding", "two_jobs", "dependents_amount", diff --git a/gusto_embedded/src/gusto_embedded/models/get_companies_company_uuid_suspensionsop.py b/gusto_embedded/src/gusto_embedded/models/get_companies_company_uuid_suspensionsop.py new file mode 100644 index 00000000..bd0be735 --- /dev/null +++ b/gusto_embedded/src/gusto_embedded/models/get_companies_company_uuid_suspensionsop.py @@ -0,0 +1,30 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .versionheader import VersionHeader +from gusto_embedded.types import BaseModel +from gusto_embedded.utils import FieldMetadata, HeaderMetadata, PathParamMetadata +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class GetCompaniesCompanyUUIDSuspensionsRequestTypedDict(TypedDict): + company_uuid: str + r"""The UUID of the company""" + x_gusto_api_version: NotRequired[VersionHeader] + r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used.""" + + +class GetCompaniesCompanyUUIDSuspensionsRequest(BaseModel): + company_uuid: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The UUID of the company""" + + x_gusto_api_version: Annotated[ + Optional[VersionHeader], + pydantic.Field(alias="X-Gusto-API-Version"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01 + r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used.""" diff --git a/gusto_embedded/src/gusto_embedded/models/pay_schedule.py b/gusto_embedded/src/gusto_embedded/models/pay_schedule_list.py similarity index 92% rename from gusto_embedded/src/gusto_embedded/models/pay_schedule.py rename to gusto_embedded/src/gusto_embedded/models/pay_schedule_list.py index bfb4aec2..00dfd4e5 100644 --- a/gusto_embedded/src/gusto_embedded/models/pay_schedule.py +++ b/gusto_embedded/src/gusto_embedded/models/pay_schedule_list.py @@ -14,11 +14,13 @@ from typing_extensions import NotRequired, TypedDict -class PayScheduleTypedDict(TypedDict): +class PayScheduleListTypedDict(TypedDict): r"""The representation of a pay schedule.""" uuid: str r"""The unique identifier of the pay schedule in Gusto.""" + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" frequency: NotRequired[PayScheduleFrequency] r"""The frequency that employees on this pay schedule are paid with Gusto.""" anchor_pay_date: NotRequired[str] @@ -39,12 +41,15 @@ class PayScheduleTypedDict(TypedDict): r"""Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned.""" -class PaySchedule(BaseModel): +class PayScheduleList(BaseModel): r"""The representation of a pay schedule.""" uuid: str r"""The unique identifier of the pay schedule in Gusto.""" + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" + frequency: Optional[PayScheduleFrequency] = None r"""The frequency that employees on this pay schedule are paid with Gusto.""" diff --git a/gusto_embedded/src/gusto_embedded/models/pay_schedule_object.py b/gusto_embedded/src/gusto_embedded/models/pay_schedule_object.py new file mode 100644 index 00000000..b3c8b579 --- /dev/null +++ b/gusto_embedded/src/gusto_embedded/models/pay_schedule_object.py @@ -0,0 +1,118 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .pay_schedule_frequency import PayScheduleFrequency +from gusto_embedded.types import ( + BaseModel, + Nullable, + OptionalNullable, + UNSET, + UNSET_SENTINEL, +) +from pydantic import model_serializer +from typing import Optional +from typing_extensions import NotRequired, TypedDict + + +class PayScheduleObjectTypedDict(TypedDict): + r"""The representation of a pay schedule.""" + + uuid: str + r"""The unique identifier of the pay schedule in Gusto.""" + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" + frequency: NotRequired[PayScheduleFrequency] + r"""The frequency that employees on this pay schedule are paid with Gusto.""" + anchor_pay_date: NotRequired[str] + r"""The first date that employees on this pay schedule are paid with Gusto.""" + anchor_end_of_pay_period: NotRequired[str] + r"""The last date of the first pay period. This can be the same date as the anchor pay date.""" + day_1: NotRequired[Nullable[int]] + r"""An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies.""" + day_2: NotRequired[Nullable[int]] + r"""An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the \"Twice per month\" frequency. For semi-monthly pay schedules, this field should be set to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies.""" + name: NotRequired[Nullable[str]] + r"""This field will be hourly when the pay schedule is for hourly employees, salaried when the pay schedule is for salaried employees, the department name if pay schedule is by department, and null when the pay schedule is for all employees.""" + custom_name: NotRequired[str] + r"""A custom name for a pay schedule, defaults to the pay frequency description.""" + auto_pilot: NotRequired[bool] + r"""With Autopilot® enabled, payroll will run automatically one day before your payroll deadlines.""" + active: NotRequired[bool] + r"""Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned.""" + + +class PayScheduleObject(BaseModel): + r"""The representation of a pay schedule.""" + + uuid: str + r"""The unique identifier of the pay schedule in Gusto.""" + + version: str + r"""The current version of the object. See the [versioning guide](https://docs.gusto.com/embedded-payroll/docs/idempotency) for information on how to use this field.""" + + frequency: Optional[PayScheduleFrequency] = None + r"""The frequency that employees on this pay schedule are paid with Gusto.""" + + anchor_pay_date: Optional[str] = None + r"""The first date that employees on this pay schedule are paid with Gusto.""" + + anchor_end_of_pay_period: Optional[str] = None + r"""The last date of the first pay period. This can be the same date as the anchor pay date.""" + + day_1: OptionalNullable[int] = UNSET + r"""An integer between 1 and 31 indicating the first day of the month that employees are paid. This field is only relevant for pay schedules with the “Twice per month” and “Monthly” frequencies. It will be null for pay schedules with other frequencies.""" + + day_2: OptionalNullable[int] = UNSET + r"""An integer between 1 and 31 indicating the second day of the month that employees are paid. This field is the second pay date for pay schedules with the \"Twice per month\" frequency. For semi-monthly pay schedules, this field should be set to 31. For months shorter than 31 days, we will set the second pay date to the last day of the month. It will be null for pay schedules with other frequencies.""" + + name: OptionalNullable[str] = UNSET + r"""This field will be hourly when the pay schedule is for hourly employees, salaried when the pay schedule is for salaried employees, the department name if pay schedule is by department, and null when the pay schedule is for all employees.""" + + custom_name: Optional[str] = None + r"""A custom name for a pay schedule, defaults to the pay frequency description.""" + + auto_pilot: Optional[bool] = None + r"""With Autopilot® enabled, payroll will run automatically one day before your payroll deadlines.""" + + active: Optional[bool] = None + r"""Whether this pay schedule is associated with any employees. A pay schedule is inactive when it's unassigned.""" + + @model_serializer(mode="wrap") + def serialize_model(self, handler): + optional_fields = [ + "frequency", + "anchor_pay_date", + "anchor_end_of_pay_period", + "day_1", + "day_2", + "name", + "custom_name", + "auto_pilot", + "active", + ] + nullable_fields = ["day_1", "day_2", "name"] + null_default_fields = [] + + serialized = handler(self) + + m = {} + + for n, f in self.model_fields.items(): + k = f.alias or n + val = serialized.get(k) + serialized.pop(k, None) + + optional_nullable = k in optional_fields and k in nullable_fields + is_set = ( + self.__pydantic_fields_set__.intersection({n}) + or k in null_default_fields + ) # pylint: disable=no-member + + if val is not None and val != UNSET_SENTINEL: + m[k] = val + elif val != UNSET_SENTINEL and ( + not k in optional_fields or (optional_nullable and is_set) + ): + m[k] = val + + return m diff --git a/gusto_embedded/src/gusto_embedded/models/post_companies_company_uuid_suspensionsop.py b/gusto_embedded/src/gusto_embedded/models/post_companies_company_uuid_suspensionsop.py new file mode 100644 index 00000000..2eb4808f --- /dev/null +++ b/gusto_embedded/src/gusto_embedded/models/post_companies_company_uuid_suspensionsop.py @@ -0,0 +1,135 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +from .versionheader import VersionHeader +from enum import Enum +from gusto_embedded.types import BaseModel +from gusto_embedded.utils import ( + FieldMetadata, + HeaderMetadata, + PathParamMetadata, + RequestMetadata, +) +import pydantic +from typing import Optional +from typing_extensions import Annotated, NotRequired, TypedDict + + +class PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod(str, Enum): + r"""How Gusto will handle taxes already collected.""" + + PAY_TAXES = "pay_taxes" + REFUND_TAXES = "refund_taxes" + + +class Reason(str, Enum): + r"""Explanation for why the company is suspending their account. + + > 🚧 FEIN or entity type changes require Customer Support + > + > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. + """ + + SWITCHING_PROVIDER = "switching_provider" + SHUTTING_DOWN = "shutting_down" + ACQUIRED = "acquired" + NO_MORE_EMPLOYEES = "no_more_employees" + CHANGING_EIN_OR_ENTITY_TYPE = "changing_ein_or_entity_type" + + +class LeavingFor(str, Enum): + r"""Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`.""" + + APD = "apd" + ADP_TOTAL_SOURCE = "adp_total_source" + ACCOUNTANT = "accountant" + BAMBOO_HR = "bamboo_hr" + BANK_OR_FINANCIAL_INSTITUTION = "bank_or_financial_institution" + CHECK = "check" + INSPERITY = "insperity" + INTUIT_OR_QUICKBOOKS = "intuit_or_quickbooks" + JUSTWORKS = "justworks" + MANUAL = "manual" + NAMELY = "namely" + ONPAY = "onpay" + OTHER = "other" + PATRIOT = "patriot" + PAYCOM = "paycom" + PAYLOCITY = "paylocity" + RIPPLING = "rippling" + SQUARE = "square" + SUREPAYROLL = "surepayroll" + TRINET = "trinet" + ZENEFITS = "zenefits" + + +class PostCompaniesCompanyUUIDSuspensionsRequestBodyTypedDict(TypedDict): + file_quarterly_forms: bool + r"""Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled.""" + file_yearly_forms: bool + r"""Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled.""" + reconcile_tax_method: PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod + r"""How Gusto will handle taxes already collected.""" + reason: Reason + r"""Explanation for why the company is suspending their account. + + > 🚧 FEIN or entity type changes require Customer Support + > + > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. + """ + comments: NotRequired[str] + r"""User-supplied comments describing why they are suspending their account.""" + leaving_for: NotRequired[LeavingFor] + r"""Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`.""" + + +class PostCompaniesCompanyUUIDSuspensionsRequestBody(BaseModel): + file_quarterly_forms: bool + r"""Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled.""" + + file_yearly_forms: bool + r"""Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled.""" + + reconcile_tax_method: PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod + r"""How Gusto will handle taxes already collected.""" + + reason: Reason + r"""Explanation for why the company is suspending their account. + + > 🚧 FEIN or entity type changes require Customer Support + > + > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. + """ + + comments: Optional[str] = None + r"""User-supplied comments describing why they are suspending their account.""" + + leaving_for: Optional[LeavingFor] = None + r"""Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`.""" + + +class PostCompaniesCompanyUUIDSuspensionsRequestTypedDict(TypedDict): + company_uuid: str + r"""The UUID of the company""" + request_body: PostCompaniesCompanyUUIDSuspensionsRequestBodyTypedDict + x_gusto_api_version: NotRequired[VersionHeader] + r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used.""" + + +class PostCompaniesCompanyUUIDSuspensionsRequest(BaseModel): + company_uuid: Annotated[ + str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False)) + ] + r"""The UUID of the company""" + + request_body: Annotated[ + PostCompaniesCompanyUUIDSuspensionsRequestBody, + FieldMetadata(request=RequestMetadata(media_type="application/json")), + ] + + x_gusto_api_version: Annotated[ + Optional[VersionHeader], + pydantic.Field(alias="X-Gusto-API-Version"), + FieldMetadata(header=HeaderMetadata(style="simple", explode=False)), + ] = VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01 + r"""Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used.""" diff --git a/gusto_embedded/src/gusto_embedded/models/put_v1_companies_company_id_payrollsop.py b/gusto_embedded/src/gusto_embedded/models/put_v1_companies_company_id_payrollsop.py index 91319316..93510580 100644 --- a/gusto_embedded/src/gusto_embedded/models/put_v1_companies_company_id_payrollsop.py +++ b/gusto_embedded/src/gusto_embedded/models/put_v1_companies_company_id_payrollsop.py @@ -146,15 +146,46 @@ class PutV1CompaniesCompanyIDPayrollsEmployeeCompensations(BaseModel): r"""An array of all paid time off the employee is eligible for this pay period. Each paid time off object can be the name or the specific policy_uuid.""" +class PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod(str, Enum): + r"""The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls.""" + + EVERY_WEEK = "Every week" + EVERY_OTHER_WEEK = "Every other week" + TWICE_PER_MONTH = "Twice per month" + MONTHLY = "Monthly" + QUARTERLY = "Quarterly" + SEMIANNUALLY = "Semiannually" + ANNUALLY = "Annually" + + class PutV1CompaniesCompanyIDPayrollsRequestBodyTypedDict(TypedDict): employee_compensations: List[ PutV1CompaniesCompanyIDPayrollsEmployeeCompensationsTypedDict ] + withholding_pay_period: NotRequired[ + PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod + ] + r"""The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls.""" + skip_regular_deductions: NotRequired[bool] + r"""Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls.""" + fixed_withholding_rate: NotRequired[bool] + r"""Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls.""" class PutV1CompaniesCompanyIDPayrollsRequestBody(BaseModel): employee_compensations: List[PutV1CompaniesCompanyIDPayrollsEmployeeCompensations] + withholding_pay_period: Optional[ + PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod + ] = None + r"""The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls.""" + + skip_regular_deductions: Optional[bool] = None + r"""Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls.""" + + fixed_withholding_rate: Optional[bool] = None + r"""Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls.""" + class PutV1CompaniesCompanyIDPayrollsRequestTypedDict(TypedDict): company_id: str diff --git a/gusto_embedded/src/gusto_embedded/models/put_v1_employees_employee_id_state_taxesop.py b/gusto_embedded/src/gusto_embedded/models/put_v1_employees_employee_id_state_taxesop.py index c3dce3a1..89f8e3f3 100644 --- a/gusto_embedded/src/gusto_embedded/models/put_v1_employees_employee_id_state_taxesop.py +++ b/gusto_embedded/src/gusto_embedded/models/put_v1_employees_employee_id_state_taxesop.py @@ -17,18 +17,28 @@ ) import pydantic from pydantic import model_serializer -from typing import Any, List, Optional -from typing_extensions import Annotated, NotRequired, TypedDict +from typing import Any, List, Optional, Union +from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict + + +PutV1EmployeesEmployeeIDStateTaxesValueTypedDict = TypeAliasType( + "PutV1EmployeesEmployeeIDStateTaxesValueTypedDict", Union[str, float, bool] +) + + +PutV1EmployeesEmployeeIDStateTaxesValue = TypeAliasType( + "PutV1EmployeesEmployeeIDStateTaxesValue", Union[str, float, bool] +) class AnswersTypedDict(TypedDict): - value: str + value: Nullable[PutV1EmployeesEmployeeIDStateTaxesValueTypedDict] valid_from: str valid_up_to: NotRequired[Nullable[Any]] class Answers(BaseModel): - value: str + value: Nullable[PutV1EmployeesEmployeeIDStateTaxesValue] valid_from: str @@ -37,7 +47,7 @@ class Answers(BaseModel): @model_serializer(mode="wrap") def serialize_model(self, handler): optional_fields = ["valid_up_to"] - nullable_fields = ["valid_up_to"] + nullable_fields = ["value", "valid_up_to"] null_default_fields = [] serialized = handler(self) diff --git a/gusto_embedded/src/gusto_embedded/payrolls.py b/gusto_embedded/src/gusto_embedded/payrolls.py index 6285fe33..74fb64e0 100644 --- a/gusto_embedded/src/gusto_embedded/payrolls.py +++ b/gusto_embedded/src/gusto_embedded/payrolls.py @@ -1033,6 +1033,11 @@ def update( x_gusto_api_version: Optional[ models.VersionHeader ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + withholding_pay_period: Optional[ + models.PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod + ] = None, + skip_regular_deductions: Optional[bool] = None, + fixed_withholding_rate: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1051,6 +1056,9 @@ def update( :param payroll_id: The UUID of the payroll :param employee_compensations: :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param withholding_pay_period: The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. + :param skip_regular_deductions: Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. + :param fixed_withholding_rate: Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1075,6 +1083,9 @@ def update( employee_compensations, List[models.PutV1CompaniesCompanyIDPayrollsEmployeeCompensations], ), + withholding_pay_period=withholding_pay_period, + skip_regular_deductions=skip_regular_deductions, + fixed_withholding_rate=fixed_withholding_rate, ), ) @@ -1163,6 +1174,11 @@ async def update_async( x_gusto_api_version: Optional[ models.VersionHeader ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + withholding_pay_period: Optional[ + models.PutV1CompaniesCompanyIDPayrollsWithholdingPayPeriod + ] = None, + skip_regular_deductions: Optional[bool] = None, + fixed_withholding_rate: Optional[bool] = None, retries: OptionalNullable[utils.RetryConfig] = UNSET, server_url: Optional[str] = None, timeout_ms: Optional[int] = None, @@ -1181,6 +1197,9 @@ async def update_async( :param payroll_id: The UUID of the payroll :param employee_compensations: :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param withholding_pay_period: The payment schedule tax rate the payroll is based on. Only relevant for off-cycle payrolls. + :param skip_regular_deductions: Block regular deductions and contributions for this payroll. Only relevant for off-cycle payrolls. + :param fixed_withholding_rate: Enable taxes to be withheld at the IRS's required rate of 22% for federal income taxes. State income taxes will be taxed at the state's supplemental tax rate. Otherwise, we'll sum the entirety of the employee's wages and withhold taxes on the entire amount at the rate for regular wages. Only relevant for off-cycle payrolls. :param retries: Override the default retry configuration for this method :param server_url: Override the default server URL for this method :param timeout_ms: Override the default request timeout configuration for this method in milliseconds @@ -1205,6 +1224,9 @@ async def update_async( employee_compensations, List[models.PutV1CompaniesCompanyIDPayrollsEmployeeCompensations], ), + withholding_pay_period=withholding_pay_period, + skip_regular_deductions=skip_regular_deductions, + fixed_withholding_rate=fixed_withholding_rate, ), ) diff --git a/gusto_embedded/src/gusto_embedded/payschedules.py b/gusto_embedded/src/gusto_embedded/payschedules.py index 5b95cdcd..43615d6a 100644 --- a/gusto_embedded/src/gusto_embedded/payschedules.py +++ b/gusto_embedded/src/gusto_embedded/payschedules.py @@ -296,7 +296,7 @@ def get_all( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.PaySchedule]: + ) -> List[models.PayScheduleList]: r"""Get the pay schedules for a company The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -368,7 +368,7 @@ def get_all( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, List[models.PaySchedule]) + return utils.unmarshal_json(http_res.text, List[models.PayScheduleList]) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -402,7 +402,7 @@ async def get_all_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> List[models.PaySchedule]: + ) -> List[models.PayScheduleList]: r"""Get the pay schedules for a company The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -474,7 +474,7 @@ async def get_all_async( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, List[models.PaySchedule]) + return utils.unmarshal_json(http_res.text, List[models.PayScheduleList]) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( @@ -743,7 +743,7 @@ def get( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.PaySchedule: + ) -> models.PayScheduleObject: r"""Get a pay schedule The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -813,7 +813,7 @@ def get( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.PaySchedule) + return utils.unmarshal_json(http_res.text, models.PayScheduleObject) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = utils.stream_to_text(http_res) raise models.APIError( @@ -846,7 +846,7 @@ async def get_async( server_url: Optional[str] = None, timeout_ms: Optional[int] = None, http_headers: Optional[Mapping[str, str]] = None, - ) -> models.PaySchedule: + ) -> models.PayScheduleObject: r"""Get a pay schedule The pay schedule object in Gusto captures the details of when employees work and when they should be paid. A company can have multiple pay schedules. @@ -916,7 +916,7 @@ async def get_async( ) if utils.match_response(http_res, "200", "application/json"): - return utils.unmarshal_json(http_res.text, models.PaySchedule) + return utils.unmarshal_json(http_res.text, models.PayScheduleObject) if utils.match_response(http_res, ["404", "4XX"], "*"): http_res_text = await utils.stream_to_text_async(http_res) raise models.APIError( diff --git a/gusto_embedded/src/gusto_embedded/signatories.py b/gusto_embedded/src/gusto_embedded/signatories.py index b8ff201d..160b1dd4 100644 --- a/gusto_embedded/src/gusto_embedded/signatories.py +++ b/gusto_embedded/src/gusto_embedded/signatories.py @@ -605,7 +605,7 @@ def invite( ) response_data: Any = None - if utils.match_response(http_res, "201", "application/json"): + if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Signatory) if utils.match_response(http_res, "422", "application/json"): response_data = utils.unmarshal_json( @@ -730,7 +730,7 @@ async def invite_async( ) response_data: Any = None - if utils.match_response(http_res, "201", "application/json"): + if utils.match_response(http_res, "200", "application/json"): return utils.unmarshal_json(http_res.text, models.Signatory) if utils.match_response(http_res, "422", "application/json"): response_data = utils.unmarshal_json( diff --git a/gusto_embedded/src/gusto_embedded/suspensions.py b/gusto_embedded/src/gusto_embedded/suspensions.py new file mode 100644 index 00000000..896b402c --- /dev/null +++ b/gusto_embedded/src/gusto_embedded/suspensions.py @@ -0,0 +1,484 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .basesdk import BaseSDK +from gusto_embedded import models, utils +from gusto_embedded._hooks import HookContext +from gusto_embedded.types import OptionalNullable, UNSET +from gusto_embedded.utils import get_security_from_env +from typing import Any, List, Mapping, Optional + + +class Suspensions(BaseSDK): + def get( + self, + *, + company_uuid: str, + x_gusto_api_version: Optional[ + models.VersionHeader + ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.CompanySuspension]: + r"""Get suspensions for this company + + Get existing suspension records for this company. A company may have multiple suspension records if they have suspended their Gusto account more than once. + + > 📘 To check if company is already suspended + > + > To determine if a company is _currently_ suspended, use the `is_suspended` and `company_status` fields in the [Get a company](https://docs.gusto.com/embedded-payroll/reference/get-v1-companies) endpoint. + + scope: `company_suspensions:read` + + :param company_uuid: The UUID of the company + :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCompaniesCompanyUUIDSuspensionsRequest( + company_uuid=company_uuid, + x_gusto_api_version=x_gusto_api_version, + ) + + req = self._build_request( + method="GET", + path="/v1/companies/{company_uuid}/suspensions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="get-companies-company_uuid-suspensions", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["404", "4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, List[models.CompanySuspension]) + if utils.match_response(http_res, ["404", "4XX"], "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def get_async( + self, + *, + company_uuid: str, + x_gusto_api_version: Optional[ + models.VersionHeader + ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> List[models.CompanySuspension]: + r"""Get suspensions for this company + + Get existing suspension records for this company. A company may have multiple suspension records if they have suspended their Gusto account more than once. + + > 📘 To check if company is already suspended + > + > To determine if a company is _currently_ suspended, use the `is_suspended` and `company_status` fields in the [Get a company](https://docs.gusto.com/embedded-payroll/reference/get-v1-companies) endpoint. + + scope: `company_suspensions:read` + + :param company_uuid: The UUID of the company + :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.GetCompaniesCompanyUUIDSuspensionsRequest( + company_uuid=company_uuid, + x_gusto_api_version=x_gusto_api_version, + ) + + req = self._build_request_async( + method="GET", + path="/v1/companies/{company_uuid}/suspensions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=False, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="get-companies-company_uuid-suspensions", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["404", "4XX", "5XX"], + retry_config=retry_config, + ) + + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, List[models.CompanySuspension]) + if utils.match_response(http_res, ["404", "4XX"], "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + def suspend( + self, + *, + company_uuid: str, + file_quarterly_forms: bool, + file_yearly_forms: bool, + reconcile_tax_method: models.PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod, + reason: models.Reason, + x_gusto_api_version: Optional[ + models.VersionHeader + ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + comments: Optional[str] = None, + leaving_for: Optional[models.LeavingFor] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CompanySuspension: + r"""Suspend a company's account + + Use this endpoint to suspend a company. After suspension, company will no longer be able to run payroll but will retain access to their information, such as retrieving employee info or retrieving past payrolls. + + scope: `company_suspensions:write` + + :param company_uuid: The UUID of the company + :param file_quarterly_forms: Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. + :param file_yearly_forms: Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. + :param reconcile_tax_method: How Gusto will handle taxes already collected. + :param reason: Explanation for why the company is suspending their account. > 🚧 FEIN or entity type changes require Customer Support > > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. + :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param comments: User-supplied comments describing why they are suspending their account. + :param leaving_for: Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostCompaniesCompanyUUIDSuspensionsRequest( + company_uuid=company_uuid, + x_gusto_api_version=x_gusto_api_version, + request_body=models.PostCompaniesCompanyUUIDSuspensionsRequestBody( + file_quarterly_forms=file_quarterly_forms, + file_yearly_forms=file_yearly_forms, + reconcile_tax_method=reconcile_tax_method, + comments=comments, + reason=reason, + leaving_for=leaving_for, + ), + ) + + req = self._build_request( + method="POST", + path="/v1/companies/{company_uuid}/suspensions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + models.PostCompaniesCompanyUUIDSuspensionsRequestBody, + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = self.do_request( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="post-companies-company_uuid-suspensions", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.CompanySuspension) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.UnprocessableEntityErrorObjectData + ) + raise models.UnprocessableEntityErrorObject(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = utils.stream_to_text(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + ) + + async def suspend_async( + self, + *, + company_uuid: str, + file_quarterly_forms: bool, + file_yearly_forms: bool, + reconcile_tax_method: models.PostCompaniesCompanyUUIDSuspensionsReconcileTaxMethod, + reason: models.Reason, + x_gusto_api_version: Optional[ + models.VersionHeader + ] = models.VersionHeader.TWO_THOUSAND_AND_TWENTY_FOUR_MINUS_04_MINUS_01, + comments: Optional[str] = None, + leaving_for: Optional[models.LeavingFor] = None, + retries: OptionalNullable[utils.RetryConfig] = UNSET, + server_url: Optional[str] = None, + timeout_ms: Optional[int] = None, + http_headers: Optional[Mapping[str, str]] = None, + ) -> models.CompanySuspension: + r"""Suspend a company's account + + Use this endpoint to suspend a company. After suspension, company will no longer be able to run payroll but will retain access to their information, such as retrieving employee info or retrieving past payrolls. + + scope: `company_suspensions:write` + + :param company_uuid: The UUID of the company + :param file_quarterly_forms: Should Gusto file quarterly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. + :param file_yearly_forms: Should Gusto file yearly tax forms on behalf of the company? The correct answer can depend on why the company is suspending their account, and how taxes are being reconciled. + :param reconcile_tax_method: How Gusto will handle taxes already collected. + :param reason: Explanation for why the company is suspending their account. > 🚧 FEIN or entity type changes require Customer Support > > If a company is switching FEIN or changing their entity type, this change must be performed by Gusto Customer Support and cannot be performed via the API at this time. + :param x_gusto_api_version: Determines the date-based API version associated with your API call. If none is provided, your application's [minimum API version](https://docs.gusto.com/embedded-payroll/docs/api-versioning#minimum-api-version) is used. + :param comments: User-supplied comments describing why they are suspending their account. + :param leaving_for: Which competitor the company is joining instead. Required if `reason` is `'switching_provider'`. + :param retries: Override the default retry configuration for this method + :param server_url: Override the default server URL for this method + :param timeout_ms: Override the default request timeout configuration for this method in milliseconds + :param http_headers: Additional headers to set or replace on requests. + """ + base_url = None + url_variables = None + if timeout_ms is None: + timeout_ms = self.sdk_configuration.timeout_ms + + if server_url is not None: + base_url = server_url + else: + base_url = self._get_url(base_url, url_variables) + + request = models.PostCompaniesCompanyUUIDSuspensionsRequest( + company_uuid=company_uuid, + x_gusto_api_version=x_gusto_api_version, + request_body=models.PostCompaniesCompanyUUIDSuspensionsRequestBody( + file_quarterly_forms=file_quarterly_forms, + file_yearly_forms=file_yearly_forms, + reconcile_tax_method=reconcile_tax_method, + comments=comments, + reason=reason, + leaving_for=leaving_for, + ), + ) + + req = self._build_request_async( + method="POST", + path="/v1/companies/{company_uuid}/suspensions", + base_url=base_url, + url_variables=url_variables, + request=request, + request_body_required=True, + request_has_path_params=True, + request_has_query_params=True, + user_agent_header="user-agent", + accept_header_value="application/json", + http_headers=http_headers, + security=self.sdk_configuration.security, + get_serialized_body=lambda: utils.serialize_request_body( + request.request_body, + False, + False, + "json", + models.PostCompaniesCompanyUUIDSuspensionsRequestBody, + ), + timeout_ms=timeout_ms, + ) + + if retries == UNSET: + if self.sdk_configuration.retry_config is not UNSET: + retries = self.sdk_configuration.retry_config + + retry_config = None + if isinstance(retries, utils.RetryConfig): + retry_config = (retries, ["429", "500", "502", "503", "504"]) + + http_res = await self.do_request_async( + hook_ctx=HookContext( + base_url=base_url or "", + operation_id="post-companies-company_uuid-suspensions", + oauth2_scopes=[], + security_source=get_security_from_env( + self.sdk_configuration.security, models.Security + ), + ), + request=req, + error_status_codes=["422", "4XX", "5XX"], + retry_config=retry_config, + ) + + response_data: Any = None + if utils.match_response(http_res, "200", "application/json"): + return utils.unmarshal_json(http_res.text, models.CompanySuspension) + if utils.match_response(http_res, "422", "application/json"): + response_data = utils.unmarshal_json( + http_res.text, models.UnprocessableEntityErrorObjectData + ) + raise models.UnprocessableEntityErrorObject(data=response_data) + if utils.match_response(http_res, "4XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + if utils.match_response(http_res, "5XX", "*"): + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + "API error occurred", http_res.status_code, http_res_text, http_res + ) + + content_type = http_res.headers.get("Content-Type") + http_res_text = await utils.stream_to_text_async(http_res) + raise models.APIError( + f"Unexpected response received (code: {http_res.status_code}, type: {content_type})", + http_res.status_code, + http_res_text, + http_res, + )