Class: Gusto::Payrolls::Payroll
- Inherits:
-
Object
- Object
- Gusto::Payrolls::Payroll
- Defined in:
- lib/fern_gusto/payrolls/types/payroll.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #auto_pilot ⇒ Boolean readonly
- #calculated_at ⇒ String readonly
- #check_date ⇒ String readonly
- #company_taxes ⇒ Gusto::PAYROLL_COMPANY_TAXES_TYPE readonly
- #company_uuid ⇒ String readonly
- #created_at ⇒ DateTime readonly
- #credit_blockers ⇒ Gusto::PAYROLL_CREDIT_BLOCKERS_TYPE readonly
- #employee_compensations ⇒ Gusto::PAYROLL_EMPLOYEE_COMPENSATIONS_TYPE readonly
- #external ⇒ Boolean readonly
- #final_termination_payroll ⇒ Boolean readonly
- #fixed_withholding_rate ⇒ Boolean readonly
- #off_cycle ⇒ Boolean readonly
- #off_cycle_reason ⇒ Gusto::OffCycleReasonType readonly
- #pay_period ⇒ Gusto::PayrollPayPeriodType readonly
- #payment_speed_changed ⇒ Gusto::PayrollPaymentSpeedChangedType readonly
- #payroll_deadline ⇒ DateTime readonly
- #payroll_status_meta ⇒ Gusto::PayrollPayrollStatusMetaType readonly
- #payroll_uuid ⇒ String readonly
- #processed ⇒ Boolean readonly
- #processed_date ⇒ String readonly
- #processing_request ⇒ Gusto::PayrollProcessingRequest readonly
- #skip_regular_deductions ⇒ Boolean readonly
- #submission_blockers ⇒ Gusto::PAYROLL_SUBMISSION_BLOCKERS_TYPE readonly
- #totals ⇒ Gusto::PayrollTotalsType readonly
- #withholding_pay_period ⇒ Gusto::PayrollWithholdingPayPeriodType readonly
Class Method Summary collapse
Instance Method Summary collapse
- #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, totals: OMIT, employee_compensations: OMIT, company_taxes: OMIT, payment_speed_changed: OMIT, created_at: OMIT, submission_blockers: OMIT, credit_blockers: OMIT, processing_request: OMIT, additional_properties: nil) ⇒ Gusto::Payrolls::Payroll constructor
- #to_json ⇒ String
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, totals: OMIT, employee_compensations: OMIT, company_taxes: OMIT, payment_speed_changed: OMIT, created_at: OMIT, submission_blockers: OMIT, credit_blockers: OMIT, processing_request: OMIT, additional_properties: nil) ⇒ Gusto::Payrolls::Payroll
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 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 107 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, totals: OMIT, employee_compensations: OMIT, company_taxes: OMIT, payment_speed_changed: OMIT, created_at: OMIT, submission_blockers: OMIT, credit_blockers: 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 = if != OMIT @totals = totals if totals != OMIT @employee_compensations = employee_compensations if employee_compensations != OMIT @company_taxes = company_taxes if company_taxes != OMIT @payment_speed_changed = payment_speed_changed if payment_speed_changed != OMIT @created_at = created_at if created_at != OMIT @submission_blockers = submission_blockers if submission_blockers != OMIT @credit_blockers = credit_blockers if credit_blockers != 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": , "totals": totals, "employee_compensations": employee_compensations, "company_taxes": company_taxes, "payment_speed_changed": payment_speed_changed, "created_at": created_at, "submission_blockers": submission_blockers, "credit_blockers": credit_blockers, "processing_request": processing_request }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
73 74 75 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 73 def additional_properties @additional_properties end |
#auto_pilot ⇒ Boolean (readonly)
41 42 43 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 41 def auto_pilot @auto_pilot end |
#calculated_at ⇒ String (readonly)
31 32 33 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 31 def calculated_at @calculated_at end |
#check_date ⇒ String (readonly)
25 26 27 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 25 def check_date @check_date end |
#company_taxes ⇒ Gusto::PAYROLL_COMPANY_TAXES_TYPE (readonly)
61 62 63 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 61 def company_taxes @company_taxes end |
#company_uuid ⇒ String (readonly)
35 36 37 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 35 def company_uuid @company_uuid end |
#created_at ⇒ DateTime (readonly)
65 66 67 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 65 def created_at @created_at end |
#credit_blockers ⇒ Gusto::PAYROLL_CREDIT_BLOCKERS_TYPE (readonly)
69 70 71 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 69 def credit_blockers @credit_blockers end |
#employee_compensations ⇒ Gusto::PAYROLL_EMPLOYEE_COMPENSATIONS_TYPE (readonly)
59 60 61 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 59 def employee_compensations @employee_compensations end |
#external ⇒ Boolean (readonly)
43 44 45 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 43 def external @external end |
#final_termination_payroll ⇒ Boolean (readonly)
45 46 47 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 45 def final_termination_payroll @final_termination_payroll end |
#fixed_withholding_rate ⇒ Boolean (readonly)
51 52 53 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 51 def fixed_withholding_rate @fixed_withholding_rate end |
#off_cycle ⇒ Boolean (readonly)
37 38 39 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 37 def off_cycle @off_cycle end |
#off_cycle_reason ⇒ Gusto::OffCycleReasonType (readonly)
39 40 41 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 39 def off_cycle_reason @off_cycle_reason end |
#pay_period ⇒ Gusto::PayrollPayPeriodType (readonly)
53 54 55 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 53 def pay_period @pay_period end |
#payment_speed_changed ⇒ Gusto::PayrollPaymentSpeedChangedType (readonly)
63 64 65 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 63 def payment_speed_changed @payment_speed_changed end |
#payroll_deadline ⇒ DateTime (readonly)
23 24 25 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 23 def payroll_deadline @payroll_deadline end |
#payroll_status_meta ⇒ Gusto::PayrollPayrollStatusMetaType (readonly)
55 56 57 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 55 def @payroll_status_meta end |
#payroll_uuid ⇒ String (readonly)
33 34 35 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 33 def payroll_uuid @payroll_uuid end |
#processed ⇒ Boolean (readonly)
27 28 29 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 27 def processed @processed end |
#processed_date ⇒ String (readonly)
29 30 31 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 29 def processed_date @processed_date end |
#processing_request ⇒ Gusto::PayrollProcessingRequest (readonly)
71 72 73 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 71 def processing_request @processing_request end |
#skip_regular_deductions ⇒ Boolean (readonly)
49 50 51 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 49 def skip_regular_deductions @skip_regular_deductions end |
#submission_blockers ⇒ Gusto::PAYROLL_SUBMISSION_BLOCKERS_TYPE (readonly)
67 68 69 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 67 def submission_blockers @submission_blockers end |
#totals ⇒ Gusto::PayrollTotalsType (readonly)
57 58 59 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 57 def totals @totals end |
#withholding_pay_period ⇒ Gusto::PayrollWithholdingPayPeriodType (readonly)
47 48 49 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 47 def withholding_pay_period @withholding_pay_period end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Payrolls::Payroll
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 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 142 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? = parsed_json["payroll_status_meta"].to_json = Gusto::PayrollPayrollStatusMetaType.from_json(json_object: ) else = nil end unless parsed_json["totals"].nil? totals = parsed_json["totals"].to_json totals = Gusto::PayrollTotalsType.from_json(json_object: totals) else totals = nil end employee_compensations = parsed_json["employee_compensations"]&.map do | item | item = item.to_json Gusto::PayrollEmployeeCompensationsTypeItem.from_json(json_object: item) end company_taxes = parsed_json["company_taxes"]&.map do | item | item = item.to_json Gusto::PayrollCompanyTaxesTypeItem.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 submission_blockers = parsed_json["submission_blockers"]&.map do | item | item = item.to_json Gusto::PayrollSubmissionBlockersTypeItem.from_json(json_object: item) end credit_blockers = parsed_json["credit_blockers"]&.map do | item | item = item.to_json Gusto::PayrollCreditBlockersTypeItem.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: , totals: totals, employee_compensations: employee_compensations, company_taxes: company_taxes, payment_speed_changed: payment_speed_changed, created_at: created_at, submission_blockers: submission_blockers, credit_blockers: credit_blockers, processing_request: processing_request, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 256 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..nil? || Gusto::PayrollPayrollStatusMetaType.validate_raw(obj: obj.) obj.totals.nil? || Gusto::PayrollTotalsType.validate_raw(obj: obj.totals) obj.employee_compensations&.is_a?(Array) != false || raise("Passed value for field obj.employee_compensations is not the expected type, validation failed.") obj.company_taxes&.is_a?(Array) != false || raise("Passed value for field obj.company_taxes 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.submission_blockers&.is_a?(Array) != false || raise("Passed value for field obj.submission_blockers is not the expected type, validation failed.") obj.credit_blockers&.is_a?(Array) != false || raise("Passed value for field obj.credit_blockers is not the expected type, validation failed.") obj.processing_request.nil? || Gusto::PayrollProcessingRequest.validate_raw(obj: obj.processing_request) end |
Instance Method Details
#to_json ⇒ String
247 248 249 |
# File 'lib/fern_gusto/payrolls/types/payroll.rb', line 247 def to_json @_field_set&.to_json end |