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(entity_ids: nil, 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(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
-
#list_supported_benefits(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata.
-
#retrieve(benefit_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item.
-
#update(benefit_id, entity_ids: nil, 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.
147 148 149 150 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 147 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(entity_ids: nil, 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.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 33 def create(params = {}) parsed, = FinchAPI::HRIS::BenefitCreateParams.dump_request(params) query_params = [:entity_ids] @client.request( method: :post, path: "employer/benefits", query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::HRIS::CreateCompanyBenefitsResponse, options: ) end |
#list(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 109 def list(params = {}) parsed, = FinchAPI::HRIS::BenefitListParams.dump_request(params) @client.request( method: :get, path: "employer/benefits", query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::CompanyBenefit, options: ) end |
#list_supported_benefits(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata
132 133 134 135 136 137 138 139 140 141 142 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 132 def list_supported_benefits(params = {}) parsed, = FinchAPI::HRIS::BenefitListSupportedBenefitsParams.dump_request(params) @client.request( method: :get, path: "employer/benefits/meta", query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::SupportedBenefit, options: ) end |
#retrieve(benefit_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item
59 60 61 62 63 64 65 66 67 68 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 59 def retrieve(benefit_id, params = {}) parsed, = FinchAPI::HRIS::BenefitRetrieveParams.dump_request(params) @client.request( method: :get, path: ["employer/benefits/%1$s", benefit_id], query: parsed, model: FinchAPI::HRIS::CompanyBenefit, options: ) end |
#update(benefit_id, entity_ids: nil, description: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse
Updates an existing company-wide deduction or contribution
85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 85 def update(benefit_id, params = {}) parsed, = FinchAPI::HRIS::BenefitUpdateParams.dump_request(params) query_params = [:entity_ids] @client.request( method: :post, path: ["employer/benefits/%1$s", benefit_id], query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::HRIS::UpdateCompanyBenefitResponse, options: ) end |