Class: Gusto::EmployeeEmployments::UnprocessedTerminationPayPeriod

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

Overview

The representation of an unprocessed termination pay period.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_date: OMIT, end_date: OMIT, check_date: OMIT, debit_date: OMIT, employee_name: OMIT, employee_uuid: OMIT, pay_schedule_uuid: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeEmployments::UnprocessedTerminationPayPeriod

Parameters:

  • start_date (String) (defaults to: OMIT)

    The start date of the pay period.

  • end_date (String) (defaults to: OMIT)

    The end date of the pay period.

  • check_date (String) (defaults to: OMIT)

    The check date of the pay period.

  • debit_date (String) (defaults to: OMIT)

    The debit date of the pay period.

  • employee_name (String) (defaults to: OMIT)

    The full name of the employee.

  • employee_uuid (String) (defaults to: OMIT)

    A unique identifier of the employee.

  • pay_schedule_uuid (String) (defaults to: OMIT)

    A unique identifier of the pay schedule to which the pay period belongs.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 40

def initialize(start_date: OMIT, end_date: OMIT, check_date: OMIT, debit_date: OMIT, employee_name: OMIT, employee_uuid: OMIT, pay_schedule_uuid: OMIT, additional_properties: nil)
  @start_date = start_date if start_date != OMIT
  @end_date = end_date if end_date != OMIT
  @check_date = check_date if check_date != OMIT
  @debit_date = debit_date if debit_date != OMIT
  @employee_name = employee_name if employee_name != OMIT
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @pay_schedule_uuid = pay_schedule_uuid if pay_schedule_uuid != OMIT
  @additional_properties = additional_properties
  @_field_set = { "start_date": start_date, "end_date": end_date, "check_date": check_date, "debit_date": debit_date, "employee_name": employee_name, "employee_uuid": employee_uuid, "pay_schedule_uuid": pay_schedule_uuid }.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



24
25
26
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 24

def additional_properties
  @additional_properties
end

#check_dateString (readonly)

Returns The check date of the pay period.

Returns:

  • (String)

    The check date of the pay period.



14
15
16
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 14

def check_date
  @check_date
end

#debit_dateString (readonly)

Returns The debit date of the pay period.

Returns:

  • (String)

    The debit date of the pay period.



16
17
18
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 16

def debit_date
  @debit_date
end

#employee_nameString (readonly)

Returns The full name of the employee.

Returns:

  • (String)

    The full name of the employee.



18
19
20
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 18

def employee_name
  @employee_name
end

#employee_uuidString (readonly)

Returns A unique identifier of the employee.

Returns:

  • (String)

    A unique identifier of the employee.



20
21
22
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 20

def employee_uuid
  @employee_uuid
end

#end_dateString (readonly)

Returns The end date of the pay period.

Returns:

  • (String)

    The end date of the pay period.



12
13
14
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 12

def end_date
  @end_date
end

#pay_schedule_uuidString (readonly)

Returns A unique identifier of the pay schedule to which the pay period belongs.

Returns:

  • (String)

    A unique identifier of the pay schedule to which the pay period belongs.



22
23
24
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 22

def pay_schedule_uuid
  @pay_schedule_uuid
end

#start_dateString (readonly)

Returns The start date of the pay period.

Returns:

  • (String)

    The start date of the pay period.



10
11
12
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 10

def start_date
  @start_date
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::EmployeeEmployments::UnprocessedTerminationPayPeriod

Parameters:

  • json_object (String)

Returns:



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 57

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  start_date = parsed_json["start_date"]
  end_date = parsed_json["end_date"]
  check_date = parsed_json["check_date"]
  debit_date = parsed_json["debit_date"]
  employee_name = parsed_json["employee_name"]
  employee_uuid = parsed_json["employee_uuid"]
  pay_schedule_uuid = parsed_json["pay_schedule_uuid"]
  new(
    start_date: start_date,
    end_date: end_date,
    check_date: check_date,
    debit_date: debit_date,
    employee_name: employee_name,
    employee_uuid: employee_uuid,
    pay_schedule_uuid: pay_schedule_uuid,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


90
91
92
93
94
95
96
97
98
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 90

def self.validate_raw(obj:)
  obj.start_date&.is_a?(String) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.")
  obj.end_date&.is_a?(String) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.")
  obj.check_date&.is_a?(String) != false || raise("Passed value for field obj.check_date is not the expected type, validation failed.")
  obj.debit_date&.is_a?(String) != false || raise("Passed value for field obj.debit_date is not the expected type, validation failed.")
  obj.employee_name&.is_a?(String) != false || raise("Passed value for field obj.employee_name is not the expected type, validation failed.")
  obj.employee_uuid&.is_a?(String) != false || raise("Passed value for field obj.employee_uuid is not the expected type, validation failed.")
  obj.pay_schedule_uuid&.is_a?(String) != false || raise("Passed value for field obj.pay_schedule_uuid is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


81
82
83
# File 'lib/fern_gusto/employee_employments/types/unprocessed_termination_pay_period.rb', line 81

def to_json
  @_field_set&.to_json
end