Class: Gusto::Payrolls::EmployeePayStub

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

Overview

The representation of an employee pay stub information.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, check_date: OMIT, gross_pay: OMIT, net_pay: OMIT, payroll_uuid: OMIT, check_amount: OMIT, additional_properties: nil) ⇒ Gusto::Payrolls::EmployeePayStub

Parameters:

  • uuid (String)

    The UUID of the employee pay stub.

  • check_date (String) (defaults to: OMIT)

    The check date of the pay stub.

  • gross_pay (String) (defaults to: OMIT)

    The gross pay amount for the pay stub.

  • net_pay (String) (defaults to: OMIT)

    The net pay amount for the pay stub.

  • payroll_uuid (String) (defaults to: OMIT)

    A unique identifier of the payroll to which the pay stub belongs.

  • check_amount (String) (defaults to: OMIT)

    The check amount for the pay stub.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 37

def initialize(uuid:, check_date: OMIT, gross_pay: OMIT, net_pay: OMIT, payroll_uuid: OMIT, check_amount: OMIT, additional_properties: nil)
  @uuid = uuid
  @check_date = check_date if check_date != OMIT
  @gross_pay = gross_pay if gross_pay != OMIT
  @net_pay = net_pay if net_pay != OMIT
  @payroll_uuid = payroll_uuid if payroll_uuid != OMIT
  @check_amount = check_amount if check_amount != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "check_date": check_date, "gross_pay": gross_pay, "net_pay": net_pay, "payroll_uuid": payroll_uuid, "check_amount": check_amount }.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



22
23
24
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 22

def additional_properties
  @additional_properties
end

#check_amountString (readonly)

Returns The check amount for the pay stub.

Returns:

  • (String)

    The check amount for the pay stub.



20
21
22
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 20

def check_amount
  @check_amount
end

#check_dateString (readonly)

Returns The check date of the pay stub.

Returns:

  • (String)

    The check date of the pay stub.



12
13
14
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 12

def check_date
  @check_date
end

#gross_payString (readonly)

Returns The gross pay amount for the pay stub.

Returns:

  • (String)

    The gross pay amount for the pay stub.



14
15
16
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 14

def gross_pay
  @gross_pay
end

#net_payString (readonly)

Returns The net pay amount for the pay stub.

Returns:

  • (String)

    The net pay amount for the pay stub.



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

def net_pay
  @net_pay
end

#payroll_uuidString (readonly)

Returns A unique identifier of the payroll to which the pay stub belongs.

Returns:

  • (String)

    A unique identifier of the payroll to which the pay stub belongs.



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

def payroll_uuid
  @payroll_uuid
end

#uuidString (readonly)

Returns The UUID of the employee pay stub.

Returns:

  • (String)

    The UUID of the employee pay stub.



10
11
12
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 10

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Payrolls::EmployeePayStub

Parameters:

  • json_object (String)

Returns:



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 53

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  check_date = parsed_json["check_date"]
  gross_pay = parsed_json["gross_pay"]
  net_pay = parsed_json["net_pay"]
  payroll_uuid = parsed_json["payroll_uuid"]
  check_amount = parsed_json["check_amount"]
  new(
    uuid: uuid,
    check_date: check_date,
    gross_pay: gross_pay,
    net_pay: net_pay,
    payroll_uuid: payroll_uuid,
    check_amount: check_amount,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


84
85
86
87
88
89
90
91
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 84

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.check_date&.is_a?(String) != false || raise("Passed value for field obj.check_date is not the expected type, validation failed.")
  obj.gross_pay&.is_a?(String) != false || raise("Passed value for field obj.gross_pay is not the expected type, validation failed.")
  obj.net_pay&.is_a?(String) != false || raise("Passed value for field obj.net_pay is not the expected type, validation failed.")
  obj.payroll_uuid&.is_a?(String) != false || raise("Passed value for field obj.payroll_uuid is not the expected type, validation failed.")
  obj.check_amount&.is_a?(String) != false || raise("Passed value for field obj.check_amount is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


75
76
77
# File 'lib/fern_gusto/payrolls/types/employee_pay_stub.rb', line 75

def to_json
  @_field_set&.to_json
end