Class: Gusto::JobsAndCompensations::Compensation
- Inherits:
-
Object
- Object
- Gusto::JobsAndCompensations::Compensation
- Defined in:
- lib/fern_gusto/jobs_and_compensations/types/compensation.rb
Overview
The representation of compensation in Gusto.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#adjust_for_minimum_wage ⇒ Object
readonly
calculation.
-
#effective_date ⇒ Object
readonly
defaults to the job’s hire date.
- #flsa_status ⇒ Gusto::FlsaStatusType readonly
-
#job_uuid ⇒ String
readonly
The UUID of the job to which the compensation belongs.
-
#payment_unit ⇒ Object
readonly
should be ‘Paycheck’.
-
#rate ⇒ String
readonly
The dollar amount paid per payment unit.
-
#uuid ⇒ String
readonly
The UUID of the compensation in Gusto.
-
#version ⇒ Object
readonly
on how to use this field.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(uuid:, version: OMIT, job_uuid: OMIT, rate: OMIT, payment_unit: OMIT, flsa_status: OMIT, effective_date: OMIT, adjust_for_minimum_wage: OMIT, additional_properties: nil) ⇒ Gusto::JobsAndCompensations::Compensation constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid:, version: OMIT, job_uuid: OMIT, rate: OMIT, payment_unit: OMIT, flsa_status: OMIT, effective_date: OMIT, adjust_for_minimum_wage: OMIT, additional_properties: nil) ⇒ Gusto::JobsAndCompensations::Compensation
55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 55 def initialize(uuid:, version: OMIT, job_uuid: OMIT, rate: OMIT, payment_unit: OMIT, flsa_status: OMIT, effective_date: OMIT, adjust_for_minimum_wage: OMIT, additional_properties: nil) @uuid = uuid @version = version if version != OMIT @job_uuid = job_uuid if job_uuid != OMIT @rate = rate if rate != OMIT @payment_unit = payment_unit if payment_unit != OMIT @flsa_status = flsa_status if flsa_status != OMIT @effective_date = effective_date if effective_date != OMIT @adjust_for_minimum_wage = adjust_for_minimum_wage if adjust_for_minimum_wage != OMIT @additional_properties = additional_properties @_field_set = { "uuid": uuid, "version": version, "job_uuid": job_uuid, "rate": rate, "payment_unit": payment_unit, "flsa_status": flsa_status, "effective_date": effective_date, "adjust_for_minimum_wage": adjust_for_minimum_wage }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
33 34 35 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 33 def additional_properties @additional_properties end |
#adjust_for_minimum_wage ⇒ Object (readonly)
calculation.
31 32 33 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 31 def adjust_for_minimum_wage @adjust_for_minimum_wage end |
#effective_date ⇒ Object (readonly)
defaults to the job’s hire date.
28 29 30 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 28 def effective_date @effective_date end |
#flsa_status ⇒ Gusto::FlsaStatusType (readonly)
25 26 27 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 25 def flsa_status @flsa_status end |
#job_uuid ⇒ String (readonly)
Returns The UUID of the job to which the compensation belongs.
18 19 20 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 18 def job_uuid @job_uuid end |
#payment_unit ⇒ Object (readonly)
should be ‘Paycheck’.
23 24 25 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 23 def payment_unit @payment_unit end |
#rate ⇒ String (readonly)
Returns The dollar amount paid per payment unit.
20 21 22 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 20 def rate @rate end |
#uuid ⇒ String (readonly)
Returns The UUID of the compensation in Gusto.
12 13 14 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 12 def uuid @uuid end |
#version ⇒ Object (readonly)
on how to use this field.
16 17 18 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 16 def version @version end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::JobsAndCompensations::Compensation
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 73 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"] job_uuid = parsed_json["job_uuid"] rate = parsed_json["rate"] payment_unit = parsed_json["payment_unit"] flsa_status = parsed_json["flsa_status"] effective_date = parsed_json["effective_date"] adjust_for_minimum_wage = parsed_json["adjust_for_minimum_wage"] new( uuid: uuid, version: version, job_uuid: job_uuid, rate: rate, payment_unit: payment_unit, flsa_status: flsa_status, effective_date: effective_date, adjust_for_minimum_wage: adjust_for_minimum_wage, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
108 109 110 111 112 113 114 115 116 117 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 108 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.job_uuid&.is_a?(String) != false || raise("Passed value for field obj.job_uuid 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?(Gusto::JobsAndCompensations::CompensationPaymentUnit) != false || raise("Passed value for field obj.payment_unit is not the expected type, validation failed.") obj.flsa_status&.is_a?(Gusto::FlsaStatusType) != false || raise("Passed value for field obj.flsa_status 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.adjust_for_minimum_wage&.is_a?(Boolean) != false || raise("Passed value for field obj.adjust_for_minimum_wage is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
99 100 101 |
# File 'lib/fern_gusto/jobs_and_compensations/types/compensation.rb', line 99 def to_json @_field_set&.to_json end |