Class: Gusto::ContractorPaymentGroups::ContractorPaymentGroup

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

Overview

The full contractor payment group, including associated contractor payments.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid: OMIT, company_uuid: OMIT, check_date: OMIT, debit_date: OMIT, status: OMIT, creation_token: OMIT, totals: OMIT, contractor_payments: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentGroup

Parameters:



54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 54

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



33
34
35
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 33

def additional_properties
  @additional_properties
end

#check_dateString (readonly)

Returns The check date of the contractor payment group.

Returns:

  • (String)

    The check date of the contractor payment group.



17
18
19
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 17

def check_date
  @check_date
end

#company_uuidString (readonly)

Returns The UUID of the company.

Returns:

  • (String)

    The UUID of the company.



15
16
17
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 15

def company_uuid
  @company_uuid
end

#contractor_paymentsArray<Gusto::ContractorPaymentGroups::ContractorPaymentForGroup> (readonly)



31
32
33
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 31

def contractor_payments
  @contractor_payments
end

#creation_tokenObject (readonly)

attempting to create a group with a duplicate token.



27
28
29
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 27

def creation_token
  @creation_token
end

#debit_dateString (readonly)

Returns The debit date of the contractor payment group.

Returns:

  • (String)

    The debit date of the contractor payment group.



19
20
21
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 19

def debit_date
  @debit_date
end

#statusObject (readonly)

have status ‘Unfunded`, i.e. payment with `Check` payment method.



24
25
26
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 24

def status
  @status
end

#totalsGusto::ContractorPaymentGroups::ContractorPaymentGroupTotals (readonly)



29
30
31
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 29

def totals
  @totals
end

#uuidString (readonly)

Returns The unique identifier of the contractor payment group.

Returns:

  • (String)

    The unique identifier of the contractor payment group.



13
14
15
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 13

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentGroup

Parameters:

  • json_object (String)

Returns:



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 72

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"]
  debit_date = parsed_json["debit_date"]
  status = parsed_json["status"]
  creation_token = parsed_json["creation_token"]
  unless parsed_json["totals"].nil?
    totals = parsed_json["totals"].to_json
    totals = Gusto::ContractorPaymentGroups::ContractorPaymentGroupTotals.from_json(json_object: totals)
  else
    totals = nil
  end
  contractor_payments = parsed_json["contractor_payments"]&.map do | item |
  item = item.to_json
  Gusto::ContractorPaymentGroups::ContractorPaymentForGroup.from_json(json_object: item)
end
  new(
    uuid: uuid,
    company_uuid: company_uuid,
    check_date: check_date,
    debit_date: debit_date,
    status: status,
    creation_token: creation_token,
    totals: totals,
    contractor_payments: contractor_payments,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


115
116
117
118
119
120
121
122
123
124
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 115

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.debit_date&.is_a?(String) != false || raise("Passed value for field obj.debit_date is not the expected type, validation failed.")
  obj.status&.is_a?(Gusto::ContractorPaymentGroups::ContractorPaymentGroupStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.")
  obj.creation_token&.is_a?(String) != false || raise("Passed value for field obj.creation_token is not the expected type, validation failed.")
  obj.totals.nil? || Gusto::ContractorPaymentGroups::ContractorPaymentGroupTotals.validate_raw(obj: obj.totals)
  obj.contractor_payments&.is_a?(Array) != false || raise("Passed value for field obj.contractor_payments is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


106
107
108
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 106

def to_json
  @_field_set&.to_json
end