Class: Gusto::RehireBody

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(effective_date:, file_new_hire_report:, work_location_uuid:, employment_status: OMIT, two_percent_shareholder: OMIT, additional_properties: nil) ⇒ Gusto::RehireBody

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

def initialize(effective_date:, file_new_hire_report:, work_location_uuid:, employment_status: OMIT, two_percent_shareholder: OMIT, additional_properties: nil)
  @effective_date = effective_date
  @file_new_hire_report = file_new_hire_report
  @work_location_uuid = work_location_uuid
  @employment_status = employment_status if employment_status != OMIT
  @two_percent_shareholder = two_percent_shareholder if two_percent_shareholder != OMIT
  @additional_properties = additional_properties
  @_field_set = { "effective_date": effective_date, "file_new_hire_report": file_new_hire_report, "work_location_uuid": work_location_uuid, "employment_status": employment_status, "two_percent_shareholder": two_percent_shareholder }.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



22
23
24
# File 'lib/fern_gusto/types/rehire_body.rb', line 22

def additional_properties
  @additional_properties
end

#effective_dateString (readonly)

Returns The day when the employee returns to work.

Returns:

  • (String)

    The day when the employee returns to work.



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

def effective_date
  @effective_date
end

#employment_statusObject (readonly)

employment_status to not_set.



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

def employment_status
  @employment_status
end

#file_new_hire_reportObject (readonly)

employee.



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

def file_new_hire_report
  @file_new_hire_report
end

#two_percent_shareholderObject (readonly)

only applies to companies with an S-Corp entity type.



20
21
22
# File 'lib/fern_gusto/types/rehire_body.rb', line 20

def two_percent_shareholder
  @two_percent_shareholder
end

#work_location_uuidString (readonly)

Returns The uuid of the employee’s work location.

Returns:

  • (String)

    The uuid of the employee’s work location.



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

def work_location_uuid
  @work_location_uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::RehireBody

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/rehire_body.rb', line 54

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  effective_date = parsed_json["effective_date"]
  file_new_hire_report = parsed_json["file_new_hire_report"]
  work_location_uuid = parsed_json["work_location_uuid"]
  employment_status = parsed_json["employment_status"]
  two_percent_shareholder = parsed_json["two_percent_shareholder"]
  new(
    effective_date: effective_date,
    file_new_hire_report: file_new_hire_report,
    work_location_uuid: work_location_uuid,
    employment_status: employment_status,
    two_percent_shareholder: two_percent_shareholder,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

def self.validate_raw(obj:)
  obj.effective_date.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.")
  obj.file_new_hire_report.is_a?(Boolean) != false || raise("Passed value for field obj.file_new_hire_report is not the expected type, validation failed.")
  obj.work_location_uuid.is_a?(String) != false || raise("Passed value for field obj.work_location_uuid is not the expected type, validation failed.")
  obj.employment_status&.is_a?(Gusto::RehireBodyEmploymentStatus) != false || raise("Passed value for field obj.employment_status is not the expected type, validation failed.")
  obj.two_percent_shareholder&.is_a?(Boolean) != false || raise("Passed value for field obj.two_percent_shareholder is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


74
75
76
# File 'lib/fern_gusto/types/rehire_body.rb', line 74

def to_json
  @_field_set&.to_json
end