Class: Gusto::ExternalPayrolls::ExternalPayrollBasic

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

Overview

The representation of an external payroll with minimal information.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, company_uuid: OMIT, check_date: OMIT, payment_period_start_date: OMIT, payment_period_end_date: OMIT, status: OMIT, additional_properties: nil) ⇒ Gusto::ExternalPayrolls::ExternalPayrollBasic

Parameters:

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 44

def initialize(uuid:, company_uuid: OMIT, check_date: OMIT, payment_period_start_date: OMIT, payment_period_end_date: OMIT, status: OMIT, additional_properties: nil)
  @uuid = uuid
  @company_uuid = company_uuid if company_uuid != OMIT
  @check_date = check_date if check_date != OMIT
  @payment_period_start_date = payment_period_start_date if payment_period_start_date != OMIT
  @payment_period_end_date = payment_period_end_date if payment_period_end_date != OMIT
  @status = status if status != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "company_uuid": company_uuid, "check_date": check_date, "payment_period_start_date": payment_period_start_date, "payment_period_end_date": payment_period_end_date, "status": status }.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



26
27
28
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 26

def additional_properties
  @additional_properties
end

#check_dateString (readonly)

Returns External payroll’s check date.

Returns:

  • (String)

    External payroll’s check date.



15
16
17
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 15

def check_date
  @check_date
end

#company_uuidString (readonly)

Returns The UUID of the company.

Returns:

  • (String)

    The UUID of the company.



13
14
15
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 13

def company_uuid
  @company_uuid
end

#payment_period_end_dateString (readonly)

Returns External payroll’s pay period end date.

Returns:

  • (String)

    External payroll’s pay period end date.



19
20
21
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 19

def payment_period_end_date
  @payment_period_end_date
end

#payment_period_start_dateString (readonly)

Returns External payroll’s pay period start date.

Returns:

  • (String)

    External payroll’s pay period start date.



17
18
19
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 17

def payment_period_start_date
  @payment_period_start_date
end

#statusObject (readonly)

edit an external payroll will be disabled.



24
25
26
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 24

def status
  @status
end

#uuidString (readonly)

Returns The UUID of the external payroll.

Returns:

  • (String)

    The UUID of the external payroll.



11
12
13
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 11

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ExternalPayrolls::ExternalPayrollBasic

Parameters:

  • json_object (String)

Returns:



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 60

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  company_uuid = parsed_json["company_uuid"]
  check_date = parsed_json["check_date"]
  payment_period_start_date = parsed_json["payment_period_start_date"]
  payment_period_end_date = parsed_json["payment_period_end_date"]
  status = parsed_json["status"]
  new(
    uuid: uuid,
    company_uuid: company_uuid,
    check_date: check_date,
    payment_period_start_date: payment_period_start_date,
    payment_period_end_date: payment_period_end_date,
    status: status,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


91
92
93
94
95
96
97
98
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 91

def self.validate_raw(obj:)
  obj.uuid.is_a?(String) != false || raise("Passed value for field obj.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.check_date&.is_a?(String) != false || raise("Passed value for field obj.check_date is not the expected type, validation failed.")
  obj.payment_period_start_date&.is_a?(String) != false || raise("Passed value for field obj.payment_period_start_date is not the expected type, validation failed.")
  obj.payment_period_end_date&.is_a?(String) != false || raise("Passed value for field obj.payment_period_end_date is not the expected type, validation failed.")
  obj.status&.is_a?(Gusto::ExternalPayrolls::ExternalPayrollBasicStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


82
83
84
# File 'lib/fern_gusto/external_payrolls/types/external_payroll_basic.rb', line 82

def to_json
  @_field_set&.to_json
end