Class: Gusto::HolidayPayPolicyFederalHolidaysItemPresidentsDay

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selected: OMIT, name: OMIT, date: OMIT, additional_properties: nil) ⇒ Gusto::HolidayPayPolicyFederalHolidaysItemPresidentsDay

Parameters:

  • selected (Boolean) (defaults to: OMIT)
  • name (String) (defaults to: OMIT)
  • date (String) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



26
27
28
29
30
31
32
33
34
# File 'lib/fern_gusto/types/holiday_pay_policy_federal_holidays_item_presidents_day.rb', line 26

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



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

def additional_properties
  @additional_properties
end

#dateString (readonly)

Returns:

  • (String)


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

def date
  @date
end

#nameString (readonly)

Returns:

  • (String)


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

def name
  @name
end

#selectedBoolean (readonly)

Returns:

  • (Boolean)


8
9
10
# File 'lib/fern_gusto/types/holiday_pay_policy_federal_holidays_item_presidents_day.rb', line 8

def selected
  @selected
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::HolidayPayPolicyFederalHolidaysItemPresidentsDay

Parameters:

  • json_object (String)

Returns:



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

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


66
67
68
69
70
# File 'lib/fern_gusto/types/holiday_pay_policy_federal_holidays_item_presidents_day.rb', line 66

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


57
58
59
# File 'lib/fern_gusto/types/holiday_pay_policy_federal_holidays_item_presidents_day.rb', line 57

def to_json
  @_field_set&.to_json
end