Class: Gusto::JobsAndCompensations::Job

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

Overview

The representation of a job in Gusto.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, version: OMIT, employee_uuid: OMIT, hire_date: OMIT, title: OMIT, primary: OMIT, rate: OMIT, payment_unit: OMIT, current_compensation_uuid: OMIT, two_percent_shareholder: OMIT, state_wc_covered: OMIT, state_wc_class_code: OMIT, compensations: OMIT, additional_properties: nil) ⇒ Gusto::JobsAndCompensations::Job

Parameters:

  • compensations (Array<Gusto::JobsAndCompensations::Compensation>) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

def initialize(uuid:, version: OMIT, employee_uuid: OMIT, hire_date: OMIT, title: OMIT, primary: OMIT, rate: OMIT, payment_unit: OMIT, current_compensation_uuid: OMIT, two_percent_shareholder: OMIT, state_wc_covered: OMIT, state_wc_class_code: OMIT, compensations: OMIT, additional_properties: nil)
  @uuid = uuid
  @version = version if version != OMIT
  @employee_uuid = employee_uuid if employee_uuid != OMIT
  @hire_date = hire_date if hire_date != OMIT
  @title = title if title != OMIT
  @primary = primary if primary != OMIT
  @rate = rate if rate != OMIT
  @payment_unit = payment_unit if payment_unit != OMIT
  @current_compensation_uuid = current_compensation_uuid if current_compensation_uuid != OMIT
  @two_percent_shareholder = two_percent_shareholder if two_percent_shareholder != OMIT
  @state_wc_covered = state_wc_covered if state_wc_covered != OMIT
  @state_wc_class_code = state_wc_class_code if state_wc_class_code != OMIT
  @compensations = compensations if compensations != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "version": version, "employee_uuid": employee_uuid, "hire_date": hire_date, "title": title, "primary": primary, "rate": rate, "payment_unit": payment_unit, "current_compensation_uuid": current_compensation_uuid, "two_percent_shareholder": two_percent_shareholder, "state_wc_covered": state_wc_covered, "state_wc_class_code": state_wc_class_code, "compensations": compensations }.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



44
45
46
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 44

def additional_properties
  @additional_properties
end

#compensationsArray<Gusto::JobsAndCompensations::Compensation> (readonly)



42
43
44
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 42

def compensations
  @compensations
end

#current_compensation_uuidString (readonly)

Returns The UUID of the current compensation of the job.

Returns:

  • (String)

    The UUID of the current compensation of the job.



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

def current_compensation_uuid
  @current_compensation_uuid
end

#employee_uuidString (readonly)

Returns The UUID of the employee to which the job belongs.

Returns:

  • (String)

    The UUID of the employee to which the job belongs.



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

def employee_uuid
  @employee_uuid
end

#hire_dateString (readonly)

Returns The date when the employee was hired or rehired for the job.

Returns:

  • (String)

    The date when the employee was hired or rehired for the job.



19
20
21
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 19

def hire_date
  @hire_date
end

#payment_unitString (readonly)

Returns The payment unit of the current compensation for the job.

Returns:

  • (String)

    The payment unit of the current compensation for the job.



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

def payment_unit
  @payment_unit
end

#primaryObject (readonly)

an existing job exists for the employee.



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

def primary
  @primary
end

#rateString (readonly)

Returns The current compensation rate of the job.

Returns:

  • (String)

    The current compensation rate of the job.



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

def rate
  @rate
end

#state_wc_class_codeObject (readonly)

to learn more.



40
41
42
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 40

def state_wc_class_code
  @state_wc_class_code
end

#state_wc_coveredObject (readonly)

Washington (WA).



35
36
37
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 35

def state_wc_covered
  @state_wc_covered
end

#titleString (readonly)

Returns The title for the job.

Returns:

  • (String)

    The title for the job.



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

def title
  @title
end

#two_percent_shareholderBoolean (readonly)

Returns Whether the employee owns at least 2% of the company.

Returns:

  • (Boolean)

    Whether the employee owns at least 2% of the company.



32
33
34
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 32

def two_percent_shareholder
  @two_percent_shareholder
end

#uuidString (readonly)

Returns The UUID of the job.

Returns:

  • (String)

    The UUID of the job.



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

def uuid
  @uuid
end

#versionObject (readonly)

on how to use this field.



15
16
17
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 15

def version
  @version
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::JobsAndCompensations::Job

Parameters:

  • json_object (String)

Returns:



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 96

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  version = parsed_json["version"]
  employee_uuid = parsed_json["employee_uuid"]
  hire_date = parsed_json["hire_date"]
  title = parsed_json["title"]
  primary = parsed_json["primary"]
  rate = parsed_json["rate"]
  payment_unit = parsed_json["payment_unit"]
  current_compensation_uuid = parsed_json["current_compensation_uuid"]
  two_percent_shareholder = parsed_json["two_percent_shareholder"]
  state_wc_covered = parsed_json["state_wc_covered"]
  state_wc_class_code = parsed_json["state_wc_class_code"]
  compensations = parsed_json["compensations"]&.map do | item |
  item = item.to_json
  Gusto::JobsAndCompensations::Compensation.from_json(json_object: item)
end
  new(
    uuid: uuid,
    version: version,
    employee_uuid: employee_uuid,
    hire_date: hire_date,
    title: title,
    primary: primary,
    rate: rate,
    payment_unit: payment_unit,
    current_compensation_uuid: current_compensation_uuid,
    two_percent_shareholder: two_percent_shareholder,
    state_wc_covered: state_wc_covered,
    state_wc_class_code: state_wc_class_code,
    compensations: compensations,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 144

def self.validate_raw(obj:)
  obj.uuid.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.")
  obj.version&.is_a?(String) != false || raise("Passed value for field obj.version 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.hire_date&.is_a?(String) != false || raise("Passed value for field obj.hire_date is not the expected type, validation failed.")
  obj.title&.is_a?(String) != false || raise("Passed value for field obj.title is not the expected type, validation failed.")
  obj.primary&.is_a?(Boolean) != false || raise("Passed value for field obj.primary is not the expected type, validation failed.")
  obj.rate&.is_a?(String) != false || raise("Passed value for field obj.rate is not the expected type, validation failed.")
  obj.payment_unit&.is_a?(String) != false || raise("Passed value for field obj.payment_unit is not the expected type, validation failed.")
  obj.current_compensation_uuid&.is_a?(String) != false || raise("Passed value for field obj.current_compensation_uuid 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.state_wc_covered&.is_a?(Boolean) != false || raise("Passed value for field obj.state_wc_covered is not the expected type, validation failed.")
  obj.state_wc_class_code&.is_a?(String) != false || raise("Passed value for field obj.state_wc_class_code is not the expected type, validation failed.")
  obj.compensations&.is_a?(Array) != false || raise("Passed value for field obj.compensations is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


135
136
137
# File 'lib/fern_gusto/jobs_and_compensations/types/job.rb', line 135

def to_json
  @_field_set&.to_json
end