Class: Gusto::Payrolls::PayrollPrepared

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payroll_deadline: OMIT, check_date: OMIT, processed: OMIT, processed_date: OMIT, calculated_at: OMIT, payroll_uuid: OMIT, company_uuid: OMIT, off_cycle: OMIT, off_cycle_reason: OMIT, auto_pilot: OMIT, external: OMIT, final_termination_payroll: OMIT, withholding_pay_period: OMIT, skip_regular_deductions: OMIT, fixed_withholding_rate: OMIT, pay_period: OMIT, payroll_status_meta: OMIT, employee_compensations: OMIT, payment_speed_changed: OMIT, created_at: OMIT, fixed_compensation_types: OMIT, processing_request: OMIT, additional_properties: nil) ⇒ Gusto::Payrolls::PayrollPrepared

Parameters:



95
96
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
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 95

def initialize(payroll_deadline: OMIT, check_date: OMIT, processed: OMIT, processed_date: OMIT, calculated_at: OMIT, payroll_uuid: OMIT, company_uuid: OMIT, off_cycle: OMIT, off_cycle_reason: OMIT, auto_pilot: OMIT, external: OMIT, final_termination_payroll: OMIT, withholding_pay_period: OMIT, skip_regular_deductions: OMIT, fixed_withholding_rate: OMIT, pay_period: OMIT, payroll_status_meta: OMIT, employee_compensations: OMIT, payment_speed_changed: OMIT, created_at: OMIT, fixed_compensation_types: OMIT, processing_request: OMIT, additional_properties: nil)
  @payroll_deadline = payroll_deadline if payroll_deadline != OMIT
  @check_date = check_date if check_date != OMIT
  @processed = processed if processed != OMIT
  @processed_date = processed_date if processed_date != OMIT
  @calculated_at = calculated_at if calculated_at != OMIT
  @payroll_uuid = payroll_uuid if payroll_uuid != OMIT
  @company_uuid = company_uuid if company_uuid != OMIT
  @off_cycle = off_cycle if off_cycle != OMIT
  @off_cycle_reason = off_cycle_reason if off_cycle_reason != OMIT
  @auto_pilot = auto_pilot if auto_pilot != OMIT
  @external = external if external != OMIT
  @final_termination_payroll = final_termination_payroll if final_termination_payroll != OMIT
  @withholding_pay_period = withholding_pay_period if withholding_pay_period != OMIT
  @skip_regular_deductions = skip_regular_deductions if skip_regular_deductions != OMIT
  @fixed_withholding_rate = fixed_withholding_rate if fixed_withholding_rate != OMIT
  @pay_period = pay_period if pay_period != OMIT
  @payroll_status_meta = payroll_status_meta if payroll_status_meta != OMIT
  @employee_compensations = employee_compensations if employee_compensations != OMIT
  @payment_speed_changed = payment_speed_changed if payment_speed_changed != OMIT
  @created_at = created_at if created_at != OMIT
  @fixed_compensation_types = fixed_compensation_types if fixed_compensation_types != OMIT
  @processing_request = processing_request if processing_request != OMIT
  @additional_properties = additional_properties
  @_field_set = { "payroll_deadline": payroll_deadline, "check_date": check_date, "processed": processed, "processed_date": processed_date, "calculated_at": calculated_at, "payroll_uuid": payroll_uuid, "company_uuid": company_uuid, "off_cycle": off_cycle, "off_cycle_reason": off_cycle_reason, "auto_pilot": auto_pilot, "external": external, "final_termination_payroll": final_termination_payroll, "withholding_pay_period": withholding_pay_period, "skip_regular_deductions": skip_regular_deductions, "fixed_withholding_rate": fixed_withholding_rate, "pay_period": pay_period, "payroll_status_meta": payroll_status_meta, "employee_compensations": employee_compensations, "payment_speed_changed": payment_speed_changed, "created_at": created_at, "fixed_compensation_types": fixed_compensation_types, "processing_request": processing_request }.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



64
65
66
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 64

def additional_properties
  @additional_properties
end

#auto_pilotBoolean (readonly)

Returns:

  • (Boolean)


38
39
40
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 38

def auto_pilot
  @auto_pilot
end

#calculated_atString (readonly)

Returns:

  • (String)


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

def calculated_at
  @calculated_at
end

#check_dateString (readonly)

Returns:

  • (String)


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

def check_date
  @check_date
end

#company_uuidString (readonly)

Returns:

  • (String)


32
33
34
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 32

def company_uuid
  @company_uuid
end

#created_atDateTime (readonly)

Returns:

  • (DateTime)


58
59
60
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 58

def created_at
  @created_at
end

#employee_compensationsGusto::PAYROLL_EMPLOYEE_COMPENSATIONS_TYPE (readonly)



54
55
56
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 54

def employee_compensations
  @employee_compensations
end

#externalBoolean (readonly)

Returns:

  • (Boolean)


40
41
42
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 40

def external
  @external
end

#final_termination_payrollBoolean (readonly)

Returns:

  • (Boolean)


42
43
44
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 42

def final_termination_payroll
  @final_termination_payroll
end

#fixed_compensation_typesGusto::PAYROLL_FIXED_COMPENSATION_TYPES_TYPE (readonly)



60
61
62
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 60

def fixed_compensation_types
  @fixed_compensation_types
end

#fixed_withholding_rateBoolean (readonly)

Returns:

  • (Boolean)


48
49
50
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 48

def fixed_withholding_rate
  @fixed_withholding_rate
end

#off_cycleBoolean (readonly)

Returns:

  • (Boolean)


34
35
36
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 34

def off_cycle
  @off_cycle
end

#off_cycle_reasonGusto::OffCycleReasonType (readonly)



36
37
38
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 36

def off_cycle_reason
  @off_cycle_reason
end

#pay_periodGusto::PayrollPayPeriodType (readonly)



50
51
52
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 50

def pay_period
  @pay_period
end

#payment_speed_changedGusto::PayrollPaymentSpeedChangedType (readonly)



56
57
58
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 56

def payment_speed_changed
  @payment_speed_changed
end

#payroll_deadlineDateTime (readonly)

Returns:

  • (DateTime)


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

def payroll_deadline
  @payroll_deadline
end

#payroll_status_metaGusto::PayrollPayrollStatusMetaType (readonly)



52
53
54
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 52

def payroll_status_meta
  @payroll_status_meta
end

#payroll_uuidString (readonly)

Returns:

  • (String)


30
31
32
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 30

def payroll_uuid
  @payroll_uuid
end

#processedBoolean (readonly)

Returns:

  • (Boolean)


24
25
26
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 24

def processed
  @processed
end

#processed_dateString (readonly)

Returns:

  • (String)


26
27
28
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 26

def processed_date
  @processed_date
end

#processing_requestGusto::PayrollProcessingRequest (readonly)



62
63
64
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 62

def processing_request
  @processing_request
end

#skip_regular_deductionsBoolean (readonly)

Returns:

  • (Boolean)


46
47
48
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 46

def skip_regular_deductions
  @skip_regular_deductions
end

#withholding_pay_periodGusto::PayrollWithholdingPayPeriodType (readonly)



44
45
46
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 44

def withholding_pay_period
  @withholding_pay_period
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 127

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  payroll_deadline = unless parsed_json["payroll_deadline"].nil?
  DateTime.parse(parsed_json["payroll_deadline"])
else
  nil
end
  check_date = parsed_json["check_date"]
  processed = parsed_json["processed"]
  processed_date = parsed_json["processed_date"]
  calculated_at = parsed_json["calculated_at"]
  payroll_uuid = parsed_json["payroll_uuid"]
  company_uuid = parsed_json["company_uuid"]
  off_cycle = parsed_json["off_cycle"]
  off_cycle_reason = parsed_json["off_cycle_reason"]
  auto_pilot = parsed_json["auto_pilot"]
  external = parsed_json["external"]
  final_termination_payroll = parsed_json["final_termination_payroll"]
  withholding_pay_period = parsed_json["withholding_pay_period"]
  skip_regular_deductions = parsed_json["skip_regular_deductions"]
  fixed_withholding_rate = parsed_json["fixed_withholding_rate"]
  unless parsed_json["pay_period"].nil?
    pay_period = parsed_json["pay_period"].to_json
    pay_period = Gusto::PayrollPayPeriodType.from_json(json_object: pay_period)
  else
    pay_period = nil
  end
  unless parsed_json["payroll_status_meta"].nil?
    payroll_status_meta = parsed_json["payroll_status_meta"].to_json
    payroll_status_meta = Gusto::PayrollPayrollStatusMetaType.from_json(json_object: payroll_status_meta)
  else
    payroll_status_meta = nil
  end
  employee_compensations = parsed_json["employee_compensations"]&.map do | item |
  item = item.to_json
  Gusto::PayrollEmployeeCompensationsTypeItem.from_json(json_object: item)
end
  unless parsed_json["payment_speed_changed"].nil?
    payment_speed_changed = parsed_json["payment_speed_changed"].to_json
    payment_speed_changed = Gusto::PayrollPaymentSpeedChangedType.from_json(json_object: payment_speed_changed)
  else
    payment_speed_changed = nil
  end
  created_at = unless parsed_json["created_at"].nil?
  DateTime.parse(parsed_json["created_at"])
else
  nil
end
  fixed_compensation_types = parsed_json["fixed_compensation_types"]&.map do | item |
  item = item.to_json
  Gusto::PayrollFixedCompensationTypesTypeItem.from_json(json_object: item)
end
  unless parsed_json["processing_request"].nil?
    processing_request = parsed_json["processing_request"].to_json
    processing_request = Gusto::PayrollProcessingRequest.from_json(json_object: processing_request)
  else
    processing_request = nil
  end
  new(
    payroll_deadline: payroll_deadline,
    check_date: check_date,
    processed: processed,
    processed_date: processed_date,
    calculated_at: calculated_at,
    payroll_uuid: payroll_uuid,
    company_uuid: company_uuid,
    off_cycle: off_cycle,
    off_cycle_reason: off_cycle_reason,
    auto_pilot: auto_pilot,
    external: external,
    final_termination_payroll: final_termination_payroll,
    withholding_pay_period: withholding_pay_period,
    skip_regular_deductions: skip_regular_deductions,
    fixed_withholding_rate: fixed_withholding_rate,
    pay_period: pay_period,
    payroll_status_meta: payroll_status_meta,
    employee_compensations: employee_compensations,
    payment_speed_changed: payment_speed_changed,
    created_at: created_at,
    fixed_compensation_types: fixed_compensation_types,
    processing_request: processing_request,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 224

def self.validate_raw(obj:)
  obj.payroll_deadline&.is_a?(DateTime) != false || raise("Passed value for field obj.payroll_deadline 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.processed&.is_a?(Boolean) != false || raise("Passed value for field obj.processed is not the expected type, validation failed.")
  obj.processed_date&.is_a?(String) != false || raise("Passed value for field obj.processed_date is not the expected type, validation failed.")
  obj.calculated_at&.is_a?(String) != false || raise("Passed value for field obj.calculated_at 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.company_uuid&.is_a?(String) != false || raise("Passed value for field obj.company_uuid is not the expected type, validation failed.")
  obj.off_cycle&.is_a?(Boolean) != false || raise("Passed value for field obj.off_cycle is not the expected type, validation failed.")
  obj.off_cycle_reason&.is_a?(Gusto::OffCycleReasonType) != false || raise("Passed value for field obj.off_cycle_reason is not the expected type, validation failed.")
  obj.auto_pilot&.is_a?(Boolean) != false || raise("Passed value for field obj.auto_pilot is not the expected type, validation failed.")
  obj.external&.is_a?(Boolean) != false || raise("Passed value for field obj.external is not the expected type, validation failed.")
  obj.final_termination_payroll&.is_a?(Boolean) != false || raise("Passed value for field obj.final_termination_payroll is not the expected type, validation failed.")
  obj.withholding_pay_period&.is_a?(Gusto::PayrollWithholdingPayPeriodType) != false || raise("Passed value for field obj.withholding_pay_period is not the expected type, validation failed.")
  obj.skip_regular_deductions&.is_a?(Boolean) != false || raise("Passed value for field obj.skip_regular_deductions is not the expected type, validation failed.")
  obj.fixed_withholding_rate&.is_a?(Boolean) != false || raise("Passed value for field obj.fixed_withholding_rate is not the expected type, validation failed.")
  obj.pay_period.nil? || Gusto::PayrollPayPeriodType.validate_raw(obj: obj.pay_period)
  obj.payroll_status_meta.nil? || Gusto::PayrollPayrollStatusMetaType.validate_raw(obj: obj.payroll_status_meta)
  obj.employee_compensations&.is_a?(Array) != false || raise("Passed value for field obj.employee_compensations is not the expected type, validation failed.")
  obj.payment_speed_changed.nil? || Gusto::PayrollPaymentSpeedChangedType.validate_raw(obj: obj.payment_speed_changed)
  obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
  obj.fixed_compensation_types&.is_a?(Array) != false || raise("Passed value for field obj.fixed_compensation_types is not the expected type, validation failed.")
  obj.processing_request.nil? || Gusto::PayrollProcessingRequest.validate_raw(obj: obj.processing_request)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


215
216
217
# File 'lib/fern_gusto/payrolls/types/payroll_prepared.rb', line 215

def to_json
  @_field_set&.to_json
end