Class: Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem
- Inherits:
-
Object
- Object
- Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem
- Defined in:
- lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#contractor_uuid ⇒ Float
readonly
The UUID of the contractor.
-
#payments ⇒ Array<Gusto::ContractorPayments::ContractorPayment>
readonly
The contractor’s payments within a given time period.
-
#reimbursement_total ⇒ String
readonly
The total reimbursements for the contractor within a given time period.
-
#wage_total ⇒ String
readonly
The total wages for the contractor within a given time period.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(contractor_uuid: OMIT, reimbursement_total: OMIT, wage_total: OMIT, payments: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(contractor_uuid: OMIT, reimbursement_total: OMIT, wage_total: OMIT, payments: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem
32 33 34 35 36 37 38 39 40 41 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 32 def initialize(contractor_uuid: OMIT, reimbursement_total: OMIT, wage_total: OMIT, payments: OMIT, additional_properties: nil) @contractor_uuid = contractor_uuid if contractor_uuid != OMIT @reimbursement_total = reimbursement_total if reimbursement_total != OMIT @wage_total = wage_total if wage_total != OMIT @payments = payments if payments != OMIT @additional_properties = additional_properties @_field_set = { "contractor_uuid": contractor_uuid, "reimbursement_total": reimbursement_total, "wage_total": wage_total, "payments": 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.
19 20 21 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 19 def additional_properties @additional_properties end |
#contractor_uuid ⇒ Float (readonly)
Returns The UUID of the contractor.
11 12 13 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 11 def contractor_uuid @contractor_uuid end |
#payments ⇒ Array<Gusto::ContractorPayments::ContractorPayment> (readonly)
Returns The contractor’s payments within a given time period.
17 18 19 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 17 def payments @payments end |
#reimbursement_total ⇒ String (readonly)
Returns The total reimbursements for the contractor within a given time period.
13 14 15 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 13 def reimbursement_total @reimbursement_total end |
#wage_total ⇒ String (readonly)
Returns The total wages for the contractor within a given time period.
15 16 17 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 15 def wage_total @wage_total end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 47 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) contractor_uuid = parsed_json["contractor_uuid"] reimbursement_total = parsed_json["reimbursement_total"] wage_total = parsed_json["wage_total"] payments = parsed_json["payments"]&.map do | item | item = item.to_json Gusto::ContractorPayments::ContractorPayment.from_json(json_object: item) end new( contractor_uuid: contractor_uuid, reimbursement_total: reimbursement_total, wage_total: wage_total, payments: payments, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
78 79 80 81 82 83 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 78 def self.validate_raw(obj:) obj.contractor_uuid&.is_a?(Float) != false || raise("Passed value for field obj.contractor_uuid is not the expected type, validation failed.") obj.reimbursement_total&.is_a?(String) != false || raise("Passed value for field obj.reimbursement_total is not the expected type, validation failed.") obj.wage_total&.is_a?(String) != false || raise("Passed value for field obj.wage_total is not the expected type, validation failed.") obj.payments&.is_a?(Array) != false || raise("Passed value for field obj.payments is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
69 70 71 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_contractor_payments_item.rb', line 69 def to_json @_field_set&.to_json end |