Class: Gusto::PayrollReversal

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/payroll_reversal.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • reversed_payroll_uuid (String) (defaults to: OMIT)

    The UUID for the payroll run being reversed.

  • reversal_payroll_uuid (String) (defaults to: OMIT)

    The UUID of the payroll where the reversal was applied.

  • reason (String) (defaults to: OMIT)

    A reason provided by the admin who created the reversal.

  • approved_at (String) (defaults to: OMIT)

    Timestamp of when the reversal was approved.

  • category (String) (defaults to: OMIT)

    Category chosen by the admin who requested the reversal.

  • reversed_employee_uuids (Array<String>) (defaults to: OMIT)

    Array of affected employee UUIDs.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_atString (readonly)

Returns Timestamp of when the reversal was approved.

Returns:

  • (String)

    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

#categoryString (readonly)

Returns Category chosen by the admin who requested the reversal.

Returns:

  • (String)

    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

#reasonString (readonly)

Returns A reason provided by the admin who created the reversal.

Returns:

  • (String)

    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_uuidString (readonly)

Returns The UUID of the payroll where the reversal was applied.

Returns:

  • (String)

    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_uuidsArray<String> (readonly)

Returns Array of affected employee UUIDs.

Returns:

  • (Array<String>)

    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_uuidString (readonly)

Returns The UUID for the payroll run being reversed.

Returns:

  • (String)

    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

Parameters:

  • json_object (String)

Returns:



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

Parameters:

  • obj (Object)

Returns:

  • (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_jsonString

Returns:

  • (String)


73
74
75
# File 'lib/fern_gusto/types/payroll_reversal.rb', line 73

def to_json
  @_field_set&.to_json
end