Class: Gusto::PaySchedules::PayScheduleAssignmentPreview
- Inherits:
-
Object
- Object
- Gusto::PaySchedules::PayScheduleAssignmentPreview
- Defined in:
- lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb
Overview
The representation of a pay schedule assignment preview.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#employee_changes ⇒ Array<Gusto::PaySchedules::PayScheduleAssignmentEmployeeChange>
readonly
A list of pay schedule changes including pay period and transition pay period.
-
#type ⇒ Gusto::PaySchedules::PayScheduleAssignmentPreviewType
readonly
The pay schedule assignment type.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::PaySchedules::PayScheduleAssignmentPreview
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(type: OMIT, employee_changes: OMIT, additional_properties: nil) ⇒ Gusto::PaySchedules::PayScheduleAssignmentPreview constructor
- #to_json ⇒ String
Constructor Details
#initialize(type: OMIT, employee_changes: OMIT, additional_properties: nil) ⇒ Gusto::PaySchedules::PayScheduleAssignmentPreview
27 28 29 30 31 32 33 34 |
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb', line 27 def initialize(type: OMIT, employee_changes: OMIT, additional_properties: nil) @type = type if type != OMIT @employee_changes = employee_changes if employee_changes != OMIT @additional_properties = additional_properties @_field_set = { "type": type, "employee_changes": employee_changes }.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/pay_schedules/types/pay_schedule_assignment_preview.rb', line 16 def additional_properties @additional_properties end |
#employee_changes ⇒ Array<Gusto::PaySchedules::PayScheduleAssignmentEmployeeChange> (readonly)
Returns A list of pay schedule changes including pay period and transition pay period.
14 15 16 |
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb', line 14 def employee_changes @employee_changes end |
#type ⇒ Gusto::PaySchedules::PayScheduleAssignmentPreviewType (readonly)
Returns The pay schedule assignment type.
12 13 14 |
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb', line 12 def type @type end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::PaySchedules::PayScheduleAssignmentPreview
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb', line 39 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) type = parsed_json["type"] employee_changes = parsed_json["employee_changes"]&.map do | item | item = item.to_json Gusto::PaySchedules::PayScheduleAssignmentEmployeeChange.from_json(json_object: item) end new( type: type, employee_changes: employee_changes, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
65 66 67 68 |
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb', line 65 def self.validate_raw(obj:) obj.type&.is_a?(Gusto::PaySchedules::PayScheduleAssignmentPreviewType) != false || raise("Passed value for field obj.type is not the expected type, validation failed.") obj.employee_changes&.is_a?(Array) != false || raise("Passed value for field obj.employee_changes is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
56 57 58 |
# File 'lib/fern_gusto/pay_schedules/types/pay_schedule_assignment_preview.rb', line 56 def to_json @_field_set&.to_json end |