Class: Gusto::Rehire

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(version: OMIT, effective_date: OMIT, file_new_hire_report: OMIT, work_location_uuid: OMIT, employment_status: OMIT, two_percent_shareholder: OMIT, employee_uuid: OMIT, active: OMIT, additional_properties: nil) ⇒ Gusto::Rehire

Parameters:

  • employee_uuid (String) (defaults to: OMIT)

    The UUID of the employee.

  • active (Boolean) (defaults to: OMIT)

    Whether the employee’s rehire has gone into effect.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fern_gusto/types/rehire.rb', line 52

def initialize(version: OMIT, effective_date: OMIT, file_new_hire_report: OMIT, work_location_uuid: OMIT, employment_status: OMIT, two_percent_shareholder: OMIT, employee_uuid: OMIT, active: OMIT, additional_properties: nil)
  @version = version if version != OMIT
  @effective_date = effective_date if effective_date != OMIT
  @file_new_hire_report = file_new_hire_report if file_new_hire_report != OMIT
  @work_location_uuid = work_location_uuid if work_location_uuid != OMIT
  @employment_status = employment_status if employment_status != OMIT
  @two_percent_shareholder = two_percent_shareholder if two_percent_shareholder != OMIT
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @active = active if active != OMIT
  @additional_properties = additional_properties
  @_field_set = { "version": version, "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, "employee_uuid": employee_uuid, "active": active }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#activeBoolean (readonly)

Returns Whether the employee’s rehire has gone into effect.

Returns:

  • (Boolean)

    Whether the employee’s rehire has gone into effect.



28
29
30
# File 'lib/fern_gusto/types/rehire.rb', line 28

def active
  @active
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



30
31
32
# File 'lib/fern_gusto/types/rehire.rb', line 30

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.



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

def effective_date
  @effective_date
end

#employee_uuidString (readonly)

Returns The UUID of the employee.

Returns:

  • (String)

    The UUID of the employee.



26
27
28
# File 'lib/fern_gusto/types/rehire.rb', line 26

def employee_uuid
  @employee_uuid
end

#employment_statusObject (readonly)

employment_status to not_set.



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

def employment_status
  @employment_status
end

#file_new_hire_reportObject (readonly)

employee.



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

def file_new_hire_report
  @file_new_hire_report
end

#two_percent_shareholderObject (readonly)

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



24
25
26
# File 'lib/fern_gusto/types/rehire.rb', line 24

def two_percent_shareholder
  @two_percent_shareholder
end

#versionObject (readonly)

information on how to use this field.



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

def version
  @version
end

#work_location_uuidString (readonly)

Returns The uuid of the employee’s work location.

Returns:

  • (String)

    The uuid of the employee’s work location.



18
19
20
# File 'lib/fern_gusto/types/rehire.rb', line 18

def work_location_uuid
  @work_location_uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Rehire

Parameters:

  • json_object (String)

Returns:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/fern_gusto/types/rehire.rb', line 70

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  version = parsed_json["version"]
  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"]
  employee_uuid = parsed_json["employee_uuid"]
  active = parsed_json["active"]
  new(
    version: version,
    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,
    employee_uuid: employee_uuid,
    active: active,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


105
106
107
108
109
110
111
112
113
114
# File 'lib/fern_gusto/types/rehire.rb', line 105

def self.validate_raw(obj:)
  obj.version&.is_a?(String) != false || raise("Passed value for field obj.version is not the expected type, validation failed.")
  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::RehireEmploymentStatus) != 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.")
  obj.employee_uuid&.is_a?(String) != false || raise("Passed value for field obj.employee_uuid is not the expected type, validation failed.")
  obj.active&.is_a?(Boolean) != false || raise("Passed value for field obj.active is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


96
97
98
# File 'lib/fern_gusto/types/rehire.rb', line 96

def to_json
  @_field_set&.to_json
end