Class: Gusto::PayrollEmployeeCompensationsTypeItemHourlyCompensationsItem

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: OMIT, hours: OMIT, amount: OMIT, job_uuid: OMIT, compensation_multiplier: OMIT, additional_properties: nil) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemHourlyCompensationsItem

Parameters:

  • 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
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_hourly_compensations_item.rb', line 38

def initialize(name: OMIT, hours: OMIT, amount: OMIT, job_uuid: OMIT, compensation_multiplier: OMIT, additional_properties: nil)
  @name = name if name != OMIT
  @hours = hours if hours != OMIT
  @amount = amount if amount != OMIT
  @job_uuid = job_uuid if job_uuid != OMIT
  @compensation_multiplier = compensation_multiplier if compensation_multiplier != OMIT
  @additional_properties = additional_properties
  @_field_set = { "name": name, "hours": hours, "amount": amount, "job_uuid": job_uuid, "compensation_multiplier": compensation_multiplier }.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



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

def additional_properties
  @additional_properties
end

#amountObject (readonly)

is calculated and cannot be used for updating hourly compensations.



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

def amount
  @amount
end

#compensation_multiplierObject (readonly)

worked.



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

def compensation_multiplier
  @compensation_multiplier
end

#hoursString (readonly)

Returns The number of hours to be compensated for this pay period.

Returns:

  • (String)

    The number of hours to be compensated for this pay period.



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

def hours
  @hours
end

#job_uuidString (readonly)

Returns The UUID of the job for the compensation.

Returns:

  • (String)

    The UUID of the job for the compensation.



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

def job_uuid
  @job_uuid
end

#nameObject (readonly)

identifier for this compensation.



9
10
11
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_hourly_compensations_item.rb', line 9

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemHourlyCompensationsItem

Parameters:

  • json_object (String)

Returns:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_hourly_compensations_item.rb', line 54

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  name = parsed_json["name"]
  hours = parsed_json["hours"]
  amount = parsed_json["amount"]
  job_uuid = parsed_json["job_uuid"]
  compensation_multiplier = parsed_json["compensation_multiplier"]
  new(
    name: name,
    hours: hours,
    amount: amount,
    job_uuid: job_uuid,
    compensation_multiplier: compensation_multiplier,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


84
85
86
87
88
89
90
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_hourly_compensations_item.rb', line 84

def self.validate_raw(obj:)
  obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.hours&.is_a?(String) != false || raise("Passed value for field obj.hours is not the expected type, validation failed.")
  obj.amount&.is_a?(String) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.")
  obj.job_uuid&.is_a?(String) != false || raise("Passed value for field obj.job_uuid is not the expected type, validation failed.")
  obj.compensation_multiplier&.is_a?(Float) != false || raise("Passed value for field obj.compensation_multiplier is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


75
76
77
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_hourly_compensations_item.rb', line 75

def to_json
  @_field_set&.to_json
end