Class: Gusto::PayrollReceipt

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payroll_uuid: OMIT, company_uuid: OMIT, name_of_sender: OMIT, name_of_recipient: OMIT, recipient_notice: OMIT, debit_date: OMIT, license: OMIT, license_uri: OMIT, right_to_refund: OMIT, liability_of_licensee: OMIT, totals: OMIT, taxes: OMIT, employee_compensations: OMIT, licensee: OMIT, additional_properties: nil) ⇒ Gusto::PayrollReceipt

Parameters:

  • right_to_refund (String) (defaults to: OMIT)
  • liability_of_licensee (String) (defaults to: OMIT)
  • totals (Gusto::PayrollReceiptTotals) (defaults to: OMIT)

    The subtotals for the payroll.

  • taxes (Array<Gusto::PayrollReceiptTaxesItem>) (defaults to: OMIT)

    An array of totaled employer and employee taxes for the pay period.

  • employee_compensations (Array<Gusto::PayrollReceiptEmployeeCompensationsItem>) (defaults to: OMIT)

    An array of employee compensations and withholdings for this payroll

  • licensee (Gusto::PayrollReceiptLicensee) (defaults to: OMIT)

    The licensed payroll processor

  • 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
92
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 73

def initialize(payroll_uuid: OMIT, company_uuid: OMIT, name_of_sender: OMIT, name_of_recipient: OMIT, recipient_notice: OMIT, debit_date: OMIT, license: OMIT, license_uri: OMIT, right_to_refund: OMIT, liability_of_licensee: OMIT, totals: OMIT, taxes: OMIT, employee_compensations: OMIT, licensee: OMIT, additional_properties: nil)
  @payroll_uuid = payroll_uuid if payroll_uuid != OMIT
  @company_uuid = company_uuid if company_uuid != OMIT
  @name_of_sender = name_of_sender if name_of_sender != OMIT
  @name_of_recipient = name_of_recipient if name_of_recipient != OMIT
  @recipient_notice = recipient_notice if recipient_notice != OMIT
  @debit_date = debit_date if debit_date != OMIT
  @license = license if license != OMIT
  @license_uri = license_uri if license_uri != OMIT
  @right_to_refund = right_to_refund if right_to_refund != OMIT
  @liability_of_licensee = liability_of_licensee if liability_of_licensee != OMIT
  @totals = totals if totals != OMIT
  @taxes = taxes if taxes != OMIT
  @employee_compensations = employee_compensations if employee_compensations != OMIT
  @licensee = licensee if licensee != OMIT
  @additional_properties = additional_properties
  @_field_set = { "payroll_uuid": payroll_uuid, "company_uuid": company_uuid, "name_of_sender": name_of_sender, "name_of_recipient": name_of_recipient, "recipient_notice": recipient_notice, "debit_date": debit_date, "license": license, "license_uri": license_uri, "right_to_refund": right_to_refund, "liability_of_licensee": liability_of_licensee, "totals": totals, "taxes": taxes, "employee_compensations": employee_compensations, "licensee": licensee }.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



45
46
47
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 45

def additional_properties
  @additional_properties
end

#company_uuidString (readonly)

Returns A unique identifier of the company for the payroll.

Returns:

  • (String)

    A unique identifier of the company for the payroll.



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

def company_uuid
  @company_uuid
end

#debit_dateString (readonly)

Returns The debit or funding date for the payroll.

Returns:

  • (String)

    The debit or funding date for the payroll



23
24
25
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 23

def debit_date
  @debit_date
end

#employee_compensationsArray<Gusto::PayrollReceiptEmployeeCompensationsItem> (readonly)

Returns An array of employee compensations and withholdings for this payroll.

Returns:



41
42
43
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 41

def employee_compensations
  @employee_compensations
end

#liability_of_licenseeString (readonly)

Returns:

  • (String)


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

def liability_of_licensee
  @liability_of_licensee
end

#licenseObject (readonly)

visit our license page.“



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

def license
  @license
end

#license_uriObject (readonly)

fixed string “gusto.com/about/licenses



31
32
33
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 31

def license_uri
  @license_uri
end

#licenseeGusto::PayrollReceiptLicensee (readonly)

Returns The licensed payroll processor.

Returns:



43
44
45
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 43

def licensee
  @licensee
end

#name_of_recipientString (readonly)

Returns Always the fixed string “Payroll Recipients”.

Returns:

  • (String)

    Always the fixed string “Payroll Recipients”



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

def name_of_recipient
  @name_of_recipient
end

#name_of_senderString (readonly)

Returns The name of the company by whom the payroll was paid.

Returns:

  • (String)

    The name of the company by whom the payroll was paid



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

def name_of_sender
  @name_of_sender
end

#payroll_uuidString (readonly)

Returns A unique identifier of the payroll receipt.

Returns:

  • (String)

    A unique identifier of the payroll receipt.



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

def payroll_uuid
  @payroll_uuid
end

#recipient_noticeObject (readonly)

plus the tax agencies for the taxes listed below.“



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

def recipient_notice
  @recipient_notice
end

#right_to_refundString (readonly)

Returns:

  • (String)


33
34
35
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 33

def right_to_refund
  @right_to_refund
end

#taxesArray<Gusto::PayrollReceiptTaxesItem> (readonly)

Returns An array of totaled employer and employee taxes for the pay period.

Returns:



39
40
41
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 39

def taxes
  @taxes
end

#totalsGusto::PayrollReceiptTotals (readonly)

Returns The subtotals for the payroll.

Returns:



37
38
39
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 37

def totals
  @totals
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollReceipt

Parameters:

  • json_object (String)

Returns:



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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 97

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  payroll_uuid = parsed_json["payroll_uuid"]
  company_uuid = parsed_json["company_uuid"]
  name_of_sender = parsed_json["name_of_sender"]
  name_of_recipient = parsed_json["name_of_recipient"]
  recipient_notice = parsed_json["recipient_notice"]
  debit_date = parsed_json["debit_date"]
  license = parsed_json["license"]
  license_uri = parsed_json["license_uri"]
  right_to_refund = parsed_json["right_to_refund"]
  liability_of_licensee = parsed_json["liability_of_licensee"]
  unless parsed_json["totals"].nil?
    totals = parsed_json["totals"].to_json
    totals = Gusto::PayrollReceiptTotals.from_json(json_object: totals)
  else
    totals = nil
  end
  taxes = parsed_json["taxes"]&.map do | item |
  item = item.to_json
  Gusto::PayrollReceiptTaxesItem.from_json(json_object: item)
end
  employee_compensations = parsed_json["employee_compensations"]&.map do | item |
  item = item.to_json
  Gusto::PayrollReceiptEmployeeCompensationsItem.from_json(json_object: item)
end
  unless parsed_json["licensee"].nil?
    licensee = parsed_json["licensee"].to_json
    licensee = Gusto::PayrollReceiptLicensee.from_json(json_object: licensee)
  else
    licensee = nil
  end
  new(
    payroll_uuid: payroll_uuid,
    company_uuid: company_uuid,
    name_of_sender: name_of_sender,
    name_of_recipient: name_of_recipient,
    recipient_notice: recipient_notice,
    debit_date: debit_date,
    license: license,
    license_uri: license_uri,
    right_to_refund: right_to_refund,
    liability_of_licensee: liability_of_licensee,
    totals: totals,
    taxes: taxes,
    employee_compensations: employee_compensations,
    licensee: licensee,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 160

def self.validate_raw(obj:)
  obj.payroll_uuid&.is_a?(String) != false || raise("Passed value for field obj.payroll_uuid is not the expected type, validation failed.")
  obj.company_uuid&.is_a?(String) != false || raise("Passed value for field obj.company_uuid is not the expected type, validation failed.")
  obj.name_of_sender&.is_a?(String) != false || raise("Passed value for field obj.name_of_sender is not the expected type, validation failed.")
  obj.name_of_recipient&.is_a?(String) != false || raise("Passed value for field obj.name_of_recipient is not the expected type, validation failed.")
  obj.recipient_notice&.is_a?(String) != false || raise("Passed value for field obj.recipient_notice is not the expected type, validation failed.")
  obj.debit_date&.is_a?(String) != false || raise("Passed value for field obj.debit_date is not the expected type, validation failed.")
  obj.license&.is_a?(String) != false || raise("Passed value for field obj.license is not the expected type, validation failed.")
  obj.license_uri&.is_a?(String) != false || raise("Passed value for field obj.license_uri is not the expected type, validation failed.")
  obj.right_to_refund&.is_a?(String) != false || raise("Passed value for field obj.right_to_refund is not the expected type, validation failed.")
  obj.liability_of_licensee&.is_a?(String) != false || raise("Passed value for field obj.liability_of_licensee is not the expected type, validation failed.")
  obj.totals.nil? || Gusto::PayrollReceiptTotals.validate_raw(obj: obj.totals)
  obj.taxes&.is_a?(Array) != false || raise("Passed value for field obj.taxes is not the expected type, validation failed.")
  obj.employee_compensations&.is_a?(Array) != false || raise("Passed value for field obj.employee_compensations is not the expected type, validation failed.")
  obj.licensee.nil? || Gusto::PayrollReceiptLicensee.validate_raw(obj: obj.licensee)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


151
152
153
# File 'lib/fern_gusto/types/payroll_receipt.rb', line 151

def to_json
  @_field_set&.to_json
end