Class: Gusto::AccruingTimeOffHour

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/accruing_time_off_hour.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(time_off_policy_uuid: OMIT, hours: OMIT, additional_properties: nil) ⇒ Gusto::AccruingTimeOffHour

Parameters:

  • time_off_policy_uuid (String) (defaults to: OMIT)

    A unique identifier of the time off policy.

  • hours (String) (defaults to: OMIT)

    Hours accrued during this pay period.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



24
25
26
27
28
29
30
31
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 24

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



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

def additional_properties
  @additional_properties
end

#hoursString (readonly)

Returns Hours accrued during this pay period.

Returns:

  • (String)

    Hours accrued during this pay period.



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

def hours
  @hours
end

#time_off_policy_uuidString (readonly)

Returns A unique identifier of the time off policy.

Returns:

  • (String)

    A unique identifier of the time off policy.



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

def time_off_policy_uuid
  @time_off_policy_uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::AccruingTimeOffHour

Parameters:

  • json_object (String)

Returns:



36
37
38
39
40
41
42
43
44
45
46
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 36

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


59
60
61
62
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 59

def self.validate_raw(obj:)
  obj.time_off_policy_uuid&.is_a?(String) != false || raise("Passed value for field obj.time_off_policy_uuid 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.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


50
51
52
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 50

def to_json
  @_field_set&.to_json
end