Class: Gusto::PayrollEmployeeCompensationsTypeItemFixedCompensationsItem

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

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::PayrollEmployeeCompensationsTypeItemFixedCompensationsItem

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



28
29
30
31
32
33
34
35
36
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_fixed_compensations_item.rb', line 28

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



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

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.



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

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.



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

def job_uuid
  @job_uuid
end

#nameObject (readonly)

identifier for this compensation.



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

def name
  @name
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollEmployeeCompensationsTypeItemFixedCompensationsItem

Parameters:

  • json_object (String)

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_fixed_compensations_item.rb', line 42

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)


68
69
70
71
72
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_fixed_compensations_item.rb', line 68

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)


59
60
61
# File 'lib/fern_gusto/types/payroll_employee_compensations_type_item_fixed_compensations_item.rb', line 59

def to_json
  @_field_set&.to_json
end