Skip to content

Latest commit

 

History

History
executable file
·
424 lines (299 loc) · 24.7 KB

File metadata and controls

executable file
·
424 lines (299 loc) · 24.7 KB

companyBenefits

Available Operations

deleteV1CompanyBenefitsCompanyBenefitId

The following must be true in order to delete a company benefit

  • There are no employee benefits associated with the company benefit
  • There are no payroll items associated with the company benefit
  • The benefit is not managed by a Partner or by Gusto (type must be 'External')

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  DeleteV1CompanyBenefitsCompanyBenefitIdRequest,
  DeleteV1CompanyBenefitsCompanyBenefitIdResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyBenefitId: string = "itaque";

sdk.companyBenefits.deleteV1CompanyBenefitsCompanyBenefitId(companyBenefitId).then((res: DeleteV1CompanyBenefitsCompanyBenefitIdResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyBenefitId string ✔️ The UUID of the company benefit
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeleteV1CompanyBenefitsCompanyBenefitIdResponse>

getV1Benefits

Returns all benefits supported by Gusto.

The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit.

scope: benefits:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1BenefitsResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});

sdk.companyBenefits.getV1Benefits().then((res: GetV1BenefitsResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1BenefitsResponse>

getV1BenefitsBenefitId

Returns a benefit supported by Gusto.

The benefit object in Gusto contains high level information about a particular benefit type and its tax considerations. When companies choose to offer a benefit, they are creating a Company Benefit object associated with a particular benefit.

scope: benefits:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import { GetV1BenefitsBenefitIdRequest, GetV1BenefitsBenefitIdResponse } from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const benefitId: string = "incidunt";

sdk.companyBenefits.getV1BenefitsBenefitId(benefitId).then((res: GetV1BenefitsBenefitIdResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
benefitId string ✔️ The benefit type in Gusto.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1BenefitsBenefitIdResponse>

getV1BenefitsBenefitsIdRequirements

Returns field requirements for the requested benefit type.

scope: benefits:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1BenefitsBenefitsIdRequirementsRequest,
  GetV1BenefitsBenefitsIdRequirementsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const benefitId: string = "enim";

sdk.companyBenefits.getV1BenefitsBenefitsIdRequirements(benefitId).then((res: GetV1BenefitsBenefitsIdRequirementsResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
benefitId string ✔️ The benefit type in Gusto.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1BenefitsBenefitsIdRequirementsResponse>

getV1BenefitsCompanyBenefitIdSummary

Returns summary benefit data for the requested company benefit id.

scope: benefits:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1BenefitsCompanyBenefitIdSummaryRequest,
  GetV1BenefitsCompanyBenefitIdSummaryResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyBenefitId: string = "consequatur";
const detailed: boolean = false;
const endDate: string = "2022-12-31";
const startDate: string = "2022-01-01";

sdk.companyBenefits.getV1BenefitsCompanyBenefitIdSummary(companyBenefitId, detailed, endDate, startDate).then((res: GetV1BenefitsCompanyBenefitIdSummaryResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description Example
companyBenefitId string ✔️ The UUID of the company benefit
detailed boolean Display employee payroll item summary
endDate string The end date for which to retrieve company benefit summary 2022-12-31
startDate string The start date for which to retrieve company benefit summary 2022-01-01
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1BenefitsCompanyBenefitIdSummaryResponse>

getV1CompaniesCompanyIdCompanyBenefits

Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.

Note that company benefits can be deactivated only when no employees are enrolled.

scope: company_benefits:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1CompaniesCompanyIdCompanyBenefitsRequest,
  GetV1CompaniesCompanyIdCompanyBenefitsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyId: string = "est";
const enrollmentCount: boolean = false;

sdk.companyBenefits.getV1CompaniesCompanyIdCompanyBenefits(companyId, enrollmentCount).then((res: GetV1CompaniesCompanyIdCompanyBenefitsResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyId string ✔️ The UUID of the company
enrollmentCount boolean Whether to return employee enrollment count
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1CompaniesCompanyIdCompanyBenefitsResponse>

getV1CompanyBenefitsCompanyBenefitId

Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.

Note that company benefits can be deactivated only when no employees are enrolled.

When with_employee_benefits parameter with true value is passed, employee_benefits:read scope is required to return employee_benefits.

scope: company_benefits:read

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  GetV1CompanyBenefitsCompanyBenefitIdRequest,
  GetV1CompanyBenefitsCompanyBenefitIdResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyBenefitId: string = "quibusdam";
const withEmployeeBenefits: boolean = false;

sdk.companyBenefits.getV1CompanyBenefitsCompanyBenefitId(companyBenefitId, withEmployeeBenefits).then((res: GetV1CompanyBenefitsCompanyBenefitIdResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyBenefitId string ✔️ The UUID of the company benefit
withEmployeeBenefits boolean Whether to return employee benefits associated with the benefit
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.GetV1CompanyBenefitsCompanyBenefitIdResponse>

postV1CompaniesCompanyIdCompanyBenefits

Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.

Note that company benefits can be deactivated only when no employees are enrolled.

scope: company_benefits:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  PostV1CompaniesCompanyIdCompanyBenefitsRequest,
  PostV1CompaniesCompanyIdCompanyBenefitsRequestBody,
  PostV1CompaniesCompanyIdCompanyBenefitsResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyId: string = "explicabo";
const requestBody: PostV1CompaniesCompanyIdCompanyBenefitsRequestBody = {
  active: false,
  benefitType: 6471.74,
  description: "distinctio",
  responsibleForEmployeeW2: false,
  responsibleForEmployerTaxes: false,
};

sdk.companyBenefits.postV1CompaniesCompanyIdCompanyBenefits(companyId, requestBody).then((res: PostV1CompaniesCompanyIdCompanyBenefitsResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyId string ✔️ The UUID of the company
requestBody operations.PostV1CompaniesCompanyIdCompanyBenefitsRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PostV1CompaniesCompanyIdCompanyBenefitsResponse>

putV1CompanyBenefitsCompanyBenefitId

Company benefits represent the benefits that a company is offering to employees. This ties together a particular supported benefit with the company-specific information for the offering of that benefit.

Note that company benefits can be deactivated only when no employees are enrolled.

scope: company_benefits:write

Example Usage

import { Gusto } from "@speakeasy-sdks/gusto";
import {
  PutV1CompanyBenefitsCompanyBenefitIdRequest,
  PutV1CompanyBenefitsCompanyBenefitIdRequestBody,
  PutV1CompanyBenefitsCompanyBenefitIdResponse,
} from "@speakeasy-sdks/gusto/dist/sdk/models/operations";

const sdk = new Gusto({
  security: {
    authorization: "",
  },
});
const companyBenefitId: string = "quibusdam";
const requestBody: PutV1CompanyBenefitsCompanyBenefitIdRequestBody = {
  active: false,
  description: "labore",
  version: "modi",
};

sdk.companyBenefits.putV1CompanyBenefitsCompanyBenefitId(companyBenefitId, requestBody).then((res: PutV1CompanyBenefitsCompanyBenefitIdResponse) => {
  if (res.statusCode == 200) {
    // handle response
  }
});

Parameters

Parameter Type Required Description
companyBenefitId string ✔️ The UUID of the company benefit
requestBody operations.PutV1CompanyBenefitsCompanyBenefitIdRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.PutV1CompanyBenefitsCompanyBenefitIdResponse>