Class: Gusto::Companies::CompanyCompensations

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

Overview

The available company-wide compensation rates for the company.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hourly: OMIT, fixed: OMIT, paid_time_off: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyCompensations

Parameters:



31
32
33
34
35
36
37
38
39
# File 'lib/fern_gusto/companies/types/company_compensations.rb', line 31

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



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

def additional_properties
  @additional_properties
end

#fixedArray<Gusto::Companies::CompanyCompensationsFixedItem> (readonly)

Returns The available fixed compensation rates for the company.

Returns:



15
16
17
# File 'lib/fern_gusto/companies/types/company_compensations.rb', line 15

def fixed
  @fixed
end

#hourlyArray<Gusto::Companies::CompanyCompensationsHourlyItem> (readonly)

Returns The available hourly compensation rates for the company.

Returns:



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

def hourly
  @hourly
end

Returns The available types of paid time off for the company.

Returns:



17
18
19
# File 'lib/fern_gusto/companies/types/company_compensations.rb', line 17

def paid_time_off
  @paid_time_off
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Companies::CompanyCompensations

Parameters:

  • json_object (String)

Returns:



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fern_gusto/companies/types/company_compensations.rb', line 44

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  hourly = parsed_json["hourly"]&.map do | item |
  item = item.to_json
  Gusto::Companies::CompanyCompensationsHourlyItem.from_json(json_object: item)
end
  fixed = parsed_json["fixed"]&.map do | item |
  item = item.to_json
  Gusto::Companies::CompanyCompensationsFixedItem.from_json(json_object: item)
end
  paid_time_off = parsed_json["paid_time_off"]&.map do | item |
  item = item.to_json
  Gusto::Companies::CompanyCompensationsPaidTimeOffItem.from_json(json_object: item)
end
  new(
    hourly: hourly,
    fixed: fixed,
    paid_time_off: paid_time_off,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


78
79
80
81
82
# File 'lib/fern_gusto/companies/types/company_compensations.rb', line 78

def self.validate_raw(obj:)
  obj.hourly&.is_a?(Array) != false || raise("Passed value for field obj.hourly is not the expected type, validation failed.")
  obj.fixed&.is_a?(Array) != false || raise("Passed value for field obj.fixed is not the expected type, validation failed.")
  obj.paid_time_off&.is_a?(Array) != false || raise("Passed value for field obj.paid_time_off is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


69
70
71
# File 'lib/fern_gusto/companies/types/company_compensations.rb', line 69

def to_json
  @_field_set&.to_json
end