Class: Gusto::Payroll::PayrollUpdateRequestEmployeeCompensationsItemFixedCompensationsItem

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

Overview

tips, bonuses, and one time reimbursements.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: OMIT, amount: OMIT, job_uuid: OMIT, additional_properties: nil) ⇒ Gusto::Payroll::PayrollUpdateRequestEmployeeCompensationsItemFixedCompensationsItem

Parameters:

  • amount (String) (defaults to: OMIT)

    The amount of the compensation for the pay period.

  • job_uuid (String) (defaults to: OMIT)

    The UUID of the job for the compensation.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

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



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

def additional_properties
  @additional_properties
end

#amountString (readonly)

Returns The amount of the compensation for the pay period.

Returns:

  • (String)

    The amount of the compensation for the pay period.



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

def amount
  @amount
end

#job_uuidString (readonly)

Returns The UUID of the job for the compensation.

Returns:

  • (String)

    The UUID of the job for the compensation.



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

def job_uuid
  @job_uuid
end

#nameObject (readonly)

identifier for this compensation.



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

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Payroll::PayrollUpdateRequestEmployeeCompensationsItemFixedCompensationsItem



45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/fern_gusto/payroll/types/payroll_update_request_employee_compensations_item_fixed_compensations_item.rb', line 45

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  name = parsed_json["name"]
  amount = parsed_json["amount"]
  job_uuid = parsed_json["job_uuid"]
  new(
    name: name,
    amount: amount,
    job_uuid: job_uuid,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


72
73
74
75
76
# File 'lib/fern_gusto/payroll/types/payroll_update_request_employee_compensations_item_fixed_compensations_item.rb', line 72

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


63
64
65
# File 'lib/fern_gusto/payroll/types/payroll_update_request_employee_compensations_item_fixed_compensations_item.rb', line 63

def to_json
  @_field_set&.to_json
end