Class: Gusto::PaySchedules::PayScheduleAssignmentEmployeeChange

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(employee_uuid: OMIT, first_name: OMIT, last_name: OMIT, pay_frequency: OMIT, first_pay_period: OMIT, transition_pay_period: OMIT, additional_properties: nil) ⇒ Gusto::PaySchedules::PayScheduleAssignmentEmployeeChange

Parameters:

  • employee_uuid (String) (defaults to: OMIT)

    The UUID of the employee.

  • first_name (String) (defaults to: OMIT)

    The employee’s first name.

  • last_name (String) (defaults to: OMIT)

    The employee’s last name.

  • pay_frequency (String) (defaults to: OMIT)

    New pay schedule frequency and name.

  • first_pay_period (Gusto::PaySchedules::PayScheduleAssignmentPayPeriod) (defaults to: OMIT)
  • transition_pay_period (Gusto::PaySchedules::PayScheduleAssignmentTransitionPayPeriod) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 38

def initialize(employee_uuid: OMIT, first_name: OMIT, last_name: OMIT, pay_frequency: OMIT, first_pay_period: OMIT, transition_pay_period: OMIT, additional_properties: nil)
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @first_name = first_name if first_name != OMIT
  @last_name = last_name if last_name != OMIT
  @pay_frequency = pay_frequency if pay_frequency != OMIT
  @first_pay_period = first_pay_period if first_pay_period != OMIT
  @transition_pay_period = transition_pay_period if transition_pay_period != OMIT
  @additional_properties = additional_properties
  @_field_set = { "employee_uuid": employee_uuid, "first_name": first_name, "last_name": last_name, "pay_frequency": pay_frequency, "first_pay_period": first_pay_period, "transition_pay_period": transition_pay_period }.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



23
24
25
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 23

def additional_properties
  @additional_properties
end

#employee_uuidString (readonly)

Returns The UUID of the employee.

Returns:

  • (String)

    The UUID of the employee.



11
12
13
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 11

def employee_uuid
  @employee_uuid
end

#first_nameString (readonly)

Returns The employee’s first name.

Returns:

  • (String)

    The employee’s first name.



13
14
15
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 13

def first_name
  @first_name
end

#first_pay_periodGusto::PaySchedules::PayScheduleAssignmentPayPeriod (readonly)



19
20
21
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 19

def first_pay_period
  @first_pay_period
end

#last_nameString (readonly)

Returns The employee’s last name.

Returns:

  • (String)

    The employee’s last name.



15
16
17
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 15

def last_name
  @last_name
end

#pay_frequencyString (readonly)

Returns New pay schedule frequency and name.

Returns:

  • (String)

    New pay schedule frequency and name.



17
18
19
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 17

def pay_frequency
  @pay_frequency
end

#transition_pay_periodGusto::PaySchedules::PayScheduleAssignmentTransitionPayPeriod (readonly)



21
22
23
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 21

def transition_pay_period
  @transition_pay_period
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PaySchedules::PayScheduleAssignmentEmployeeChange

Parameters:

  • json_object (String)

Returns:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 54

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  employee_uuid = parsed_json["employee_uuid"]
  first_name = parsed_json["first_name"]
  last_name = parsed_json["last_name"]
  pay_frequency = parsed_json["pay_frequency"]
  unless parsed_json["first_pay_period"].nil?
    first_pay_period = parsed_json["first_pay_period"].to_json
    first_pay_period = Gusto::PaySchedules::PayScheduleAssignmentPayPeriod.from_json(json_object: first_pay_period)
  else
    first_pay_period = nil
  end
  unless parsed_json["transition_pay_period"].nil?
    transition_pay_period = parsed_json["transition_pay_period"].to_json
    transition_pay_period = Gusto::PaySchedules::PayScheduleAssignmentTransitionPayPeriod.from_json(json_object: transition_pay_period)
  else
    transition_pay_period = nil
  end
  new(
    employee_uuid: employee_uuid,
    first_name: first_name,
    last_name: last_name,
    pay_frequency: pay_frequency,
    first_pay_period: first_pay_period,
    transition_pay_period: transition_pay_period,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


95
96
97
98
99
100
101
102
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 95

def self.validate_raw(obj:)
  obj.employee_uuid&.is_a?(String) != false || raise("Passed value for field obj.employee_uuid is not the expected type, validation failed.")
  obj.first_name&.is_a?(String) != false || raise("Passed value for field obj.first_name is not the expected type, validation failed.")
  obj.last_name&.is_a?(String) != false || raise("Passed value for field obj.last_name is not the expected type, validation failed.")
  obj.pay_frequency&.is_a?(String) != false || raise("Passed value for field obj.pay_frequency is not the expected type, validation failed.")
  obj.first_pay_period.nil? || Gusto::PaySchedules::PayScheduleAssignmentPayPeriod.validate_raw(obj: obj.first_pay_period)
  obj.transition_pay_period.nil? || Gusto::PaySchedules::PayScheduleAssignmentTransitionPayPeriod.validate_raw(obj: obj.transition_pay_period)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


86
87
88
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_employee_change.rb', line 86

def to_json
  @_field_set&.to_json
end