Class: Gusto::Payrolls::PayPeriodPayroll

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

Overview

Information about the payroll for the pay period.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payroll_uuid: OMIT, check_date: OMIT, processed: OMIT, payroll_deadline: OMIT, payroll_type: OMIT, additional_properties: nil) ⇒ Gusto::Payrolls::PayPeriodPayroll

Parameters:

  • payroll_type (Gusto::Payrolls::PayPeriodPayrollPayrollType) (defaults to: OMIT)

    Whether it is regular pay period or transition pay period.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 50

def initialize(payroll_uuid: OMIT, check_date: OMIT, processed: OMIT, payroll_deadline: OMIT, payroll_type: OMIT, additional_properties: nil)
  @payroll_uuid = payroll_uuid if payroll_uuid != OMIT
  @check_date = check_date if check_date != OMIT
  @processed = processed if processed != OMIT
  @payroll_deadline = payroll_deadline if payroll_deadline != OMIT
  @payroll_type = payroll_type if payroll_type != OMIT
  @additional_properties = additional_properties
  @_field_set = { "payroll_uuid": payroll_uuid, "check_date": check_date, "processed": processed, "payroll_deadline": payroll_deadline, "payroll_type": payroll_type }.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



29
30
31
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 29

def additional_properties
  @additional_properties
end

#check_dateObject (readonly)

submitted on time.



15
16
17
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 15

def check_date
  @check_date
end

#payroll_deadlineObject (readonly)

this date.



25
26
27
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 25

def payroll_deadline
  @payroll_deadline
end

#payroll_typeGusto::Payrolls::PayPeriodPayrollPayrollType (readonly)

Returns Whether it is regular pay period or transition pay period.

Returns:



27
28
29
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 27

def payroll_type
  @payroll_type
end

#payroll_uuidString (readonly)

Returns The UUID of the payroll for this pay period.

Returns:

  • (String)

    The UUID of the payroll for this pay period.



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

def payroll_uuid
  @payroll_uuid
end

#processedObject (readonly)

deadline.



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

def processed
  @processed
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 65

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"]
  check_date = parsed_json["check_date"]
  processed = parsed_json["processed"]
  payroll_deadline = unless parsed_json["payroll_deadline"].nil?
  DateTime.parse(parsed_json["payroll_deadline"])
else
  nil
end
  payroll_type = parsed_json["payroll_type"]
  new(
    payroll_uuid: payroll_uuid,
    check_date: check_date,
    processed: processed,
    payroll_deadline: payroll_deadline,
    payroll_type: payroll_type,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


98
99
100
101
102
103
104
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 98

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.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.payroll_deadline&.is_a?(DateTime) != false || raise("Passed value for field obj.payroll_deadline is not the expected type, validation failed.")
  obj.payroll_type&.is_a?(Gusto::Payrolls::PayPeriodPayrollPayrollType) != false || raise("Passed value for field obj.payroll_type is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


89
90
91
# File 'lib/fern_gusto/payrolls/types/pay_period_payroll.rb', line 89

def to_json
  @_field_set&.to_json
end