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(company_contribution: nil, description: nil, frequency: nil, type: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse
Some parameter documentations has been truncated, see Models::HRIS::BenefitCreateParams for more details.
-
#initialize(client:) ⇒ Benefits
constructor
private
A new instance of Benefits.
-
#list(request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
-
#list_supported_benefits(request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata.
-
#retrieve(benefit_id, request_options: {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item.
-
#update(benefit_id, description: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse
Updates an existing company-wide deduction or contribution.
Constructor Details
#initialize(client:) ⇒ Benefits
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Benefits.
126 127 128 129 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 126 def initialize(client:) @client = client @individuals = FinchAPI::Resources::HRIS::Benefits::Individuals.new(client: client) end |
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(company_contribution: nil, description: nil, frequency: nil, type: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::CreateCompanyBenefitsResponse
Some parameter documentations has been truncated, see Models::HRIS::BenefitCreateParams for more details.
Creates a new company-wide deduction or contribution. Please use the ‘/providers` endpoint to view available types for each provider.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 31 def create(params = {}) parsed, = FinchAPI::HRIS::BenefitCreateParams.dump_request(params) @client.request( method: :post, path: "employer/benefits", body: parsed, model: FinchAPI::HRIS::CreateCompanyBenefitsResponse, options: ) end |
#list(request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
94 95 96 97 98 99 100 101 102 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 94 def list(params = {}) @client.request( method: :get, path: "employer/benefits", page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::CompanyBenefit, options: params[:request_options] ) end |
#list_supported_benefits(request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata
113 114 115 116 117 118 119 120 121 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 113 def list_supported_benefits(params = {}) @client.request( method: :get, path: "employer/benefits/meta", page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::SupportedBenefit, options: params[:request_options] ) end |
#retrieve(benefit_id, request_options: {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item
52 53 54 55 56 57 58 59 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 52 def retrieve(benefit_id, params = {}) @client.request( method: :get, path: ["employer/benefits/%1$s", benefit_id], model: FinchAPI::HRIS::CompanyBenefit, options: params[:request_options] ) end |
#update(benefit_id, description: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse
Updates an existing company-wide deduction or contribution
74 75 76 77 78 79 80 81 82 83 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 74 def update(benefit_id, params = {}) parsed, = FinchAPI::HRIS::BenefitUpdateParams.dump_request(params) @client.request( method: :post, path: ["employer/benefits/%1$s", benefit_id], body: parsed, model: FinchAPI::HRIS::UpdateCompanyBenefitResponse, options: ) end |