Class: FinchAPI::Resources::HRIS::Benefits
- Inherits:
-
Object
- Object
- FinchAPI::Resources::HRIS::Benefits
- Defined in:
- lib/finch-api/resources/hris/benefits.rb,
lib/finch-api/resources/hris/benefits/individuals.rb
Defined Under Namespace
Classes: Individuals
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#create(params = {}) ⇒ FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse
Creates a new company-wide deduction or contribution.
-
#initialize(client:) ⇒ Benefits
constructor
A new instance of Benefits.
-
#list(params = {}) ⇒ FinchAPI::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
-
#list_supported_benefits(params = {}) ⇒ FinchAPI::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata.
-
#retrieve(benefit_id, params = {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item.
-
#update(benefit_id, params = {}) ⇒ FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse
Updates an existing company-wide deduction or contribution.
Constructor Details
Instance Attribute Details
#individuals ⇒ FinchAPI::Resources::HRIS::Benefits::Individuals (readonly)
8 9 10 |
# File 'lib/finch-api/resources/hris/benefits.rb', line 8 def individuals @individuals end |
Instance Method Details
#create(params = {}) ⇒ FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse
Creates a new company-wide deduction or contribution. Please use the
`/providers` endpoint to view available types for each provider.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/finch-api/resources/hris/benefits.rb', line 26 def create(params = {}) parsed, = FinchAPI::Models::HRIS::BenefitCreateParams.dump_request(params) @client.request( method: :post, path: "employer/benefits", body: parsed, model: FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse, options: ) end |
#list(params = {}) ⇒ FinchAPI::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
84 85 86 87 88 89 90 91 92 |
# File 'lib/finch-api/resources/hris/benefits.rb', line 84 def list(params = {}) @client.request( method: :get, path: "employer/benefits", page: FinchAPI::SinglePage, model: FinchAPI::Models::HRIS::CompanyBenefit, options: params[:request_options] ) end |
#list_supported_benefits(params = {}) ⇒ FinchAPI::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata
101 102 103 104 105 106 107 108 109 |
# File 'lib/finch-api/resources/hris/benefits.rb', line 101 def list_supported_benefits(params = {}) @client.request( method: :get, path: "employer/benefits/meta", page: FinchAPI::SinglePage, model: FinchAPI::Models::HRIS::SupportedBenefit, options: params[:request_options] ) end |
#retrieve(benefit_id, params = {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item
46 47 48 49 50 51 52 53 |
# File 'lib/finch-api/resources/hris/benefits.rb', line 46 def retrieve(benefit_id, params = {}) @client.request( method: :get, path: ["employer/benefits/%0s", benefit_id], model: FinchAPI::Models::HRIS::CompanyBenefit, options: params[:request_options] ) end |
#update(benefit_id, params = {}) ⇒ FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse
Updates an existing company-wide deduction or contribution
66 67 68 69 70 71 72 73 74 75 |
# File 'lib/finch-api/resources/hris/benefits.rb', line 66 def update(benefit_id, params = {}) parsed, = FinchAPI::Models::HRIS::BenefitUpdateParams.dump_request(params) @client.request( method: :post, path: ["employer/benefits/%0s", benefit_id], body: parsed, model: FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse, options: ) end |