Class: Gusto::ContractorPaymentGroups::ContractorPaymentGroupMinimal

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

Overview

The summary of a contractor payment group.

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, additional_properties: nil) ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentGroupMinimal

Parameters:



50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 50

def initialize(uuid: OMIT, company_uuid: OMIT, check_date: OMIT, debit_date: OMIT, status: OMIT, creation_token: OMIT, totals: 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
  @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 }.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



30
31
32
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 30

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.



16
17
18
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 16

def check_date
  @check_date
end

#company_uuidString (readonly)

Returns The UUID of the company.

Returns:

  • (String)

    The UUID of the company.



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

def company_uuid
  @company_uuid
end

#creation_tokenObject (readonly)

attempting to create a group with a duplicate token.



26
27
28
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 26

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.



18
19
20
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 18

def debit_date
  @debit_date
end

#statusObject (readonly)

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



23
24
25
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 23

def status
  @status
end

#totalsGusto::ContractorPaymentGroups::ContractorPaymentGroupMinimalTotals (readonly)



28
29
30
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 28

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.



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

def uuid
  @uuid
end

Class Method Details

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

Parameters:

  • json_object (String)

Returns:



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 67

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::ContractorPaymentGroupMinimalTotals.from_json(json_object: totals)
  else
    totals = nil
  end
  new(
    uuid: uuid,
    company_uuid: company_uuid,
    check_date: check_date,
    debit_date: debit_date,
    status: status,
    creation_token: creation_token,
    totals: totals,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


105
106
107
108
109
110
111
112
113
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 105

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::ContractorPaymentGroupMinimalStatus) != 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::ContractorPaymentGroupMinimalTotals.validate_raw(obj: obj.totals)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


96
97
98
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group_minimal.rb', line 96

def to_json
  @_field_set&.to_json
end