Class: FinchAPI::Resources::HRIS::PayStatementItem::Rules
- Inherits:
-
Object
- Object
- FinchAPI::Resources::HRIS::PayStatementItem::Rules
- Defined in:
- lib/finch_api/resources/hris/pay_statement_item/rules.rb
Instance Method Summary collapse
-
#create(entity_ids: nil, attributes: nil, conditions: nil, effective_end_date: nil, effective_start_date: nil, entity_type: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::PayStatementItem::RuleCreateResponse
Some parameter documentations has been truncated, see Models::HRIS::PayStatementItem::RuleCreateParams for more details.
-
#delete(rule_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::PayStatementItem::RuleDeleteResponse
Delete a rule for a pay statement item.
-
#initialize(client:) ⇒ Rules
constructor
private
A new instance of Rules.
-
#list(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::ResponsesPage<FinchAPI::Models::HRIS::PayStatementItem::RuleListResponse>
List all rules of a connection account.
-
#update(rule_id, entity_ids: nil, optional_property: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::PayStatementItem::RuleUpdateResponse
Update a rule for a pay statement item.
Constructor Details
#initialize(client:) ⇒ Rules
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 Rules.
134 135 136 |
# File 'lib/finch_api/resources/hris/pay_statement_item/rules.rb', line 134 def initialize(client:) @client = client end |
Instance Method Details
#create(entity_ids: nil, attributes: nil, conditions: nil, effective_end_date: nil, effective_start_date: nil, entity_type: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::PayStatementItem::RuleCreateResponse
Some parameter documentations has been truncated, see Models::HRIS::PayStatementItem::RuleCreateParams for more details.
Custom rules can be created to associate specific attributes to pay statement items depending on the use case. For example, pay statement items that meet certain conditions can be labeled as a pre-tax 401k. This metadata can be retrieved where pay statement item information is available.
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/finch_api/resources/hris/pay_statement_item/rules.rb', line 35 def create(params = {}) query_params = [:entity_ids] parsed, = FinchAPI::HRIS::PayStatementItem::RuleCreateParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :post, path: "employer/pay-statement-item/rule", query: query, body: parsed.except(*query_params), model: FinchAPI::Models::HRIS::PayStatementItem::RuleCreateResponse, security: {bearer_auth: true}, options: ) end |
#delete(rule_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::PayStatementItem::RuleDeleteResponse
Delete a rule for a pay statement item.
118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/finch_api/resources/hris/pay_statement_item/rules.rb', line 118 def delete(rule_id, params = {}) parsed, = FinchAPI::HRIS::PayStatementItem::RuleDeleteParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :delete, path: ["employer/pay-statement-item/rule/%1$s", rule_id], query: query, model: FinchAPI::Models::HRIS::PayStatementItem::RuleDeleteResponse, security: {bearer_auth: true}, options: ) end |
#list(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::ResponsesPage<FinchAPI::Models::HRIS::PayStatementItem::RuleListResponse>
List all rules of a connection account.
91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/finch_api/resources/hris/pay_statement_item/rules.rb', line 91 def list(params = {}) parsed, = FinchAPI::HRIS::PayStatementItem::RuleListParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "employer/pay-statement-item/rule", query: query, page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::PayStatementItem::RuleListResponse, security: {bearer_auth: true}, options: ) end |
#update(rule_id, entity_ids: nil, optional_property: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::PayStatementItem::RuleUpdateResponse
Update a rule for a pay statement item.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/finch_api/resources/hris/pay_statement_item/rules.rb', line 65 def update(rule_id, params = {}) query_params = [:entity_ids] parsed, = FinchAPI::HRIS::PayStatementItem::RuleUpdateParams.dump_request(params) query = FinchAPI::Internal::Util.encode_query_params(parsed.slice(*query_params)) @client.request( method: :put, path: ["employer/pay-statement-item/rule/%1$s", rule_id], query: query, body: parsed.except(*query_params), model: FinchAPI::Models::HRIS::PayStatementItem::RuleUpdateResponse, security: {bearer_auth: true}, options: ) end |