Class: FinchAPI::Resources::HRIS::Company::PayStatementItem::Rules

Inherits:
Object
  • Object
show all
Defined in:
lib/finch_api/resources/hris/company/pay_statement_item/rules.rb

Instance Method Summary collapse

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.

Parameters:



133
134
135
# File 'lib/finch_api/resources/hris/company/pay_statement_item/rules.rb', line 133

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::Company::PayStatementItem::RuleCreateResponse

Some parameter documentations has been truncated, see Models::HRIS::Company::PayStatementItem::RuleCreateParams for more details.

Beta: this endpoint currently serves employers onboarded after March 4th and historical support will be added soon 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.

Parameters:

Returns:

See Also:



39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/finch_api/resources/hris/company/pay_statement_item/rules.rb', line 39

def create(params = {})
  parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleCreateParams.dump_request(params)
  query_params = [:entity_ids]
  @client.request(
    method: :post,
    path: "employer/pay-statement-item/rule",
    query: parsed.slice(*query_params),
    body: parsed.except(*query_params),
    model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse,
    options: options
  )
end

#delete(rule_id, entity_ids: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse

Beta: this endpoint currently serves employers onboarded after March 4th and historical support will be added soon Delete a rule for a pay statement item.

Parameters:

  • rule_id (String)
  • entity_ids (Array<String>)

    The entity IDs to delete the rule for.

  • request_options (FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



119
120
121
122
123
124
125
126
127
128
# File 'lib/finch_api/resources/hris/company/pay_statement_item/rules.rb', line 119

def delete(rule_id, params = {})
  parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleDeleteParams.dump_request(params)
  @client.request(
    method: :delete,
    path: ["employer/pay-statement-item/rule/%1$s", rule_id],
    query: parsed,
    model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse,
    options: options
  )
end

#list(entity_ids: nil, request_options: {}) ⇒ FinchAPI::Internal::ResponsesPage<FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse>

Beta: this endpoint currently serves employers onboarded after March 4th and historical support will be added soon List all rules of a connection account.

Parameters:

  • entity_ids (Array<String>)

    The entity IDs to retrieve rules for.

  • request_options (FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



93
94
95
96
97
98
99
100
101
102
103
# File 'lib/finch_api/resources/hris/company/pay_statement_item/rules.rb', line 93

def list(params = {})
  parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "employer/pay-statement-item/rule",
    query: parsed,
    page: FinchAPI::Internal::ResponsesPage,
    model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse,
    options: options
  )
end

#update(rule_id, entity_ids: nil, optional_property: nil, request_options: {}) ⇒ FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse

Beta: this endpoint currently serves employers onboarded after March 4th and historical support will be added soon Update a rule for a pay statement item.

Parameters:

  • rule_id (String)

    Path param:

  • entity_ids (Array<String>)

    Query param: The entity IDs to update the rule for.

  • optional_property (Object)

    Body param:

  • request_options (FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/finch_api/resources/hris/company/pay_statement_item/rules.rb', line 68

def update(rule_id, params = {})
  parsed, options = FinchAPI::HRIS::Company::PayStatementItem::RuleUpdateParams.dump_request(params)
  query_params = [:entity_ids]
  @client.request(
    method: :put,
    path: ["employer/pay-statement-item/rule/%1$s", rule_id],
    query: parsed.slice(*query_params),
    body: parsed.except(*query_params),
    model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse,
    options: options
  )
end