Class: Gusto::PayrollReversal
- Inherits:
-
Object
- Object
- Gusto::PayrollReversal
- Defined in:
- lib/fern_gusto/types/payroll_reversal.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#approved_at ⇒ String
readonly
Timestamp of when the reversal was approved.
-
#category ⇒ String
readonly
Category chosen by the admin who requested the reversal.
-
#reason ⇒ String
readonly
A reason provided by the admin who created the reversal.
-
#reversal_payroll_uuid ⇒ String
readonly
The UUID of the payroll where the reversal was applied.
-
#reversed_employee_uuids ⇒ Array<String>
readonly
Array of affected employee UUIDs.
-
#reversed_payroll_uuid ⇒ String
readonly
The UUID for the payroll run being reversed.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(reversed_payroll_uuid: OMIT, reversal_payroll_uuid: OMIT, reason: OMIT, approved_at: OMIT, category: OMIT, reversed_employee_uuids: OMIT, additional_properties: nil) ⇒ Gusto::PayrollReversal constructor
- #to_json ⇒ String
Constructor Details
#initialize(reversed_payroll_uuid: OMIT, reversal_payroll_uuid: OMIT, reason: OMIT, approved_at: OMIT, category: OMIT, reversed_employee_uuids: OMIT, additional_properties: nil) ⇒ Gusto::PayrollReversal
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 35 def initialize(reversed_payroll_uuid: OMIT, reversal_payroll_uuid: OMIT, reason: OMIT, approved_at: OMIT, category: OMIT, reversed_employee_uuids: OMIT, additional_properties: nil) @reversed_payroll_uuid = reversed_payroll_uuid if reversed_payroll_uuid != OMIT @reversal_payroll_uuid = reversal_payroll_uuid if reversal_payroll_uuid != OMIT @reason = reason if reason != OMIT @approved_at = approved_at if approved_at != OMIT @category = category if category != OMIT @reversed_employee_uuids = reversed_employee_uuids if reversed_employee_uuids != OMIT @additional_properties = additional_properties @_field_set = { "reversed_payroll_uuid": reversed_payroll_uuid, "reversal_payroll_uuid": reversal_payroll_uuid, "reason": reason, "approved_at": approved_at, "category": category, "reversed_employee_uuids": reversed_employee_uuids }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
20 21 22 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 20 def additional_properties @additional_properties end |
#approved_at ⇒ String (readonly)
Returns Timestamp of when the reversal was approved.
14 15 16 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 14 def approved_at @approved_at end |
#category ⇒ String (readonly)
Returns Category chosen by the admin who requested the reversal.
16 17 18 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 16 def category @category end |
#reason ⇒ String (readonly)
Returns A reason provided by the admin who created the reversal.
12 13 14 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 12 def reason @reason end |
#reversal_payroll_uuid ⇒ String (readonly)
Returns The UUID of the payroll where the reversal was applied.
10 11 12 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 10 def reversal_payroll_uuid @reversal_payroll_uuid end |
#reversed_employee_uuids ⇒ Array<String> (readonly)
Returns Array of affected employee UUIDs.
18 19 20 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 18 def reversed_employee_uuids @reversed_employee_uuids end |
#reversed_payroll_uuid ⇒ String (readonly)
Returns The UUID for the payroll run being reversed.
8 9 10 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 8 def reversed_payroll_uuid @reversed_payroll_uuid end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::PayrollReversal
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 51 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) reversed_payroll_uuid = parsed_json["reversed_payroll_uuid"] reversal_payroll_uuid = parsed_json["reversal_payroll_uuid"] reason = parsed_json["reason"] approved_at = parsed_json["approved_at"] category = parsed_json["category"] reversed_employee_uuids = parsed_json["reversed_employee_uuids"] new( reversed_payroll_uuid: reversed_payroll_uuid, reversal_payroll_uuid: reversal_payroll_uuid, reason: reason, approved_at: approved_at, category: category, reversed_employee_uuids: reversed_employee_uuids, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
82 83 84 85 86 87 88 89 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 82 def self.validate_raw(obj:) obj.reversed_payroll_uuid&.is_a?(String) != false || raise("Passed value for field obj.reversed_payroll_uuid is not the expected type, validation failed.") obj.reversal_payroll_uuid&.is_a?(String) != false || raise("Passed value for field obj.reversal_payroll_uuid is not the expected type, validation failed.") obj.reason&.is_a?(String) != false || raise("Passed value for field obj.reason is not the expected type, validation failed.") obj.approved_at&.is_a?(String) != false || raise("Passed value for field obj.approved_at is not the expected type, validation failed.") obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") obj.reversed_employee_uuids&.is_a?(Array) != false || raise("Passed value for field obj.reversed_employee_uuids is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
73 74 75 |
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 73 def to_json @_field_set&.to_json end |