Class: Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponse
- Inherits:
-
Object
- Object
- Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponse
- Defined in:
- lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb
Overview
Pay schedule preview
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#holidays ⇒ Array<String>
readonly
A list of dates for bank closures.
-
#pay_periods ⇒ Array<Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponsePayPeriodsItem>
readonly
A list of pay periods for the previewed pay schedule.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponse
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(pay_periods: OMIT, holidays: OMIT, additional_properties: nil) ⇒ Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponse constructor
- #to_json ⇒ String
Constructor Details
#initialize(pay_periods: OMIT, holidays: OMIT, additional_properties: nil) ⇒ Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponse
27 28 29 30 31 32 33 34 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 27 def initialize(pay_periods: OMIT, holidays: OMIT, additional_properties: nil) @pay_periods = pay_periods if pay_periods != OMIT @holidays = holidays if holidays != OMIT @additional_properties = additional_properties @_field_set = { "pay_periods": pay_periods, "holidays": holidays }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
16 17 18 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 16 def additional_properties @additional_properties end |
#holidays ⇒ Array<String> (readonly)
Returns A list of dates for bank closures.
14 15 16 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 14 def holidays @holidays end |
#pay_periods ⇒ Array<Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponsePayPeriodsItem> (readonly)
Returns A list of pay periods for the previewed pay schedule.
12 13 14 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 12 def pay_periods @pay_periods end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponse
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) pay_periods = parsed_json["pay_periods"]&.map do | item | item = item.to_json Gusto::Payroll::PaySchedules::PaySchedulesPreviewResponsePayPeriodsItem.from_json(json_object: item) end holidays = parsed_json["holidays"] new( pay_periods: pay_periods, holidays: holidays, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
65 66 67 68 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 65 def self.validate_raw(obj:) obj.pay_periods&.is_a?(Array) != false || raise("Passed value for field obj.pay_periods is not the expected type, validation failed.") obj.holidays&.is_a?(Array) != false || raise("Passed value for field obj.holidays is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
56 57 58 |
# File 'lib/fern_gusto/payroll/pay_schedules/types/pay_schedules_preview_response.rb', line 56 def to_json @_field_set&.to_json end |