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.
-
#register(entity_ids: nil, description: nil, frequency: nil, type: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::RegisterCompanyBenefitResponse
Register existing benefits from the customer on the provider, on Finch’s end.
-
#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.
190 191 192 193 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 190 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 45 46 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 33 def create(params = {}) query_params = [:entity_ids] parsed, = FinchAPI::HRIS::BenefitCreateParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/benefits", query: query, body: parsed.except(*query_params), model: FinchAPI::HRIS::CreateCompanyBenefitsResponse, security: {bearer_auth: true}, options: ) end |
#list(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::CompanyBenefit>
List all company-wide deductions and contributions.
115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 115 def list(params = {}) parsed, = FinchAPI::HRIS::BenefitListParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/benefits", query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::CompanyBenefit, security: {bearer_auth: true}, options: ) end |
#list_supported_benefits(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::SinglePage<FinchAPI::Models::HRIS::SupportedBenefit>
Get deductions metadata
140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 140 def list_supported_benefits(params = {}) parsed, = FinchAPI::HRIS::BenefitListSupportedBenefitsParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/benefits/meta", query: query, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::SupportedBenefit, security: {bearer_auth: true}, options: ) end |
#register(entity_ids: nil, description: nil, frequency: nil, type: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::RegisterCompanyBenefitResponse
Register existing benefits from the customer on the provider, on Finch’s end. Please use the ‘/provider` endpoint to view available types for each provider.
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 172 def register(params = {}) query_params = [:entity_ids] parsed, = FinchAPI::HRIS::BenefitRegisterParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/benefits/register", query: query, body: parsed.except(*query_params), model: FinchAPI::HRIS::RegisterCompanyBenefitResponse, security: {bearer_auth: true}, options: ) end |
#retrieve(benefit_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::CompanyBenefit
Lists deductions and contributions information for a given item
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 61 def retrieve(benefit_id, params = {}) parsed, = FinchAPI::HRIS::BenefitRetrieveParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: ["employer/benefits/%1$s", benefit_id], query: query, model: FinchAPI::HRIS::CompanyBenefit, security: {bearer_auth: true}, options: ) end |
#update(benefit_id, entity_ids: nil, description: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::UpdateCompanyBenefitResponse
Updates an existing company-wide deduction or contribution
89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/finch_api/resources/hris/benefits.rb', line 89 def update(benefit_id, params = {}) query_params = [:entity_ids] parsed, = FinchAPI::HRIS::BenefitUpdateParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: ["employer/benefits/%1$s", benefit_id], query: query, body: parsed.except(*query_params), model: FinchAPI::HRIS::UpdateCompanyBenefitResponse, security: {bearer_auth: true}, options: ) end |