Class: Gusto::ContractorPaymentGroups::ContractorPaymentGroup
- Inherits:
-
Object
- Object
- Gusto::ContractorPaymentGroups::ContractorPaymentGroup
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#check_date ⇒ String
readonly
The check date of the contractor payment group.
-
#company_uuid ⇒ String
readonly
The UUID of the company.
- #contractor_payments ⇒ Array<Gusto::ContractorPaymentGroups::ContractorPaymentForGroup> readonly
-
#creation_token ⇒ Object
readonly
attempting to create a group with a duplicate token.
-
#debit_date ⇒ String
readonly
The debit date of the contractor payment group.
-
#status ⇒ Object
readonly
have status ‘Unfunded`, i.e.
- #totals ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentGroupTotals readonly
-
#uuid ⇒ String
readonly
The unique identifier of the contractor payment group.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentGroup
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #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 constructor
- #to_json ⇒ String
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
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_properties ⇒ OpenStruct (readonly)
Returns 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_date ⇒ String (readonly)
Returns 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_uuid ⇒ String (readonly)
Returns 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_payments ⇒ Array<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_token ⇒ Object (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_date ⇒ String (readonly)
Returns 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 |
#status ⇒ Object (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 |
#totals ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentGroupTotals (readonly)
29 30 31 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_group.rb', line 29 def totals @totals end |
#uuid ⇒ String (readonly)
Returns 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
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
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_json ⇒ 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 |