Class: Gusto::PayrollPayPeriodType

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(start_date: OMIT, end_date: OMIT, pay_schedule_uuid: OMIT, additional_properties: nil) ⇒ Gusto::PayrollPayPeriodType

Parameters:

  • start_date (String) (defaults to: OMIT)

    The start date, inclusive, of the pay period.

  • end_date (String) (defaults to: OMIT)

    The start date, inclusive, of the pay period.

  • pay_schedule_uuid (String) (defaults to: OMIT)

    The UUID of the pay schedule for the payroll.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



26
27
28
29
30
31
32
33
34
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 26

def initialize(start_date: OMIT, end_date: OMIT, pay_schedule_uuid: OMIT, additional_properties: nil)
  @start_date = start_date if start_date != OMIT
  @end_date = end_date if end_date != OMIT
  @pay_schedule_uuid = pay_schedule_uuid if pay_schedule_uuid != OMIT
  @additional_properties = additional_properties
  @_field_set = { "start_date": start_date, "end_date": end_date, "pay_schedule_uuid": pay_schedule_uuid }.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



14
15
16
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 14

def additional_properties
  @additional_properties
end

#end_dateString (readonly)

Returns The start date, inclusive, of the pay period.

Returns:

  • (String)

    The start date, inclusive, of the pay period.



10
11
12
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 10

def end_date
  @end_date
end

#pay_schedule_uuidString (readonly)

Returns The UUID of the pay schedule for the payroll.

Returns:

  • (String)

    The UUID of the pay schedule for the payroll.



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

def pay_schedule_uuid
  @pay_schedule_uuid
end

#start_dateString (readonly)

Returns The start date, inclusive, of the pay period.

Returns:

  • (String)

    The start date, inclusive, of the pay period.



8
9
10
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 8

def start_date
  @start_date
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PayrollPayPeriodType

Parameters:

  • json_object (String)

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 39

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  start_date = parsed_json["start_date"]
  end_date = parsed_json["end_date"]
  pay_schedule_uuid = parsed_json["pay_schedule_uuid"]
  new(
    start_date: start_date,
    end_date: end_date,
    pay_schedule_uuid: pay_schedule_uuid,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


64
65
66
67
68
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 64

def self.validate_raw(obj:)
  obj.start_date&.is_a?(String) != false || raise("Passed value for field obj.start_date is not the expected type, validation failed.")
  obj.end_date&.is_a?(String) != false || raise("Passed value for field obj.end_date is not the expected type, validation failed.")
  obj.pay_schedule_uuid&.is_a?(String) != false || raise("Passed value for field obj.pay_schedule_uuid is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


55
56
57
# File 'lib/fern_gusto/types/payroll_pay_period_type.rb', line 55

def to_json
  @_field_set&.to_json
end