Class: Gusto::ContractorPayments::ContractorPaymentSummary
- Inherits:
-
Object
- Object
- Gusto::ContractorPayments::ContractorPaymentSummary
- Defined in:
- lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb
Overview
a given time period.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#contractor_payments ⇒ Object
readonly
contractor.
-
#total ⇒ Object
readonly
time period.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ContractorPayments::ContractorPaymentSummary
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(total: OMIT, contractor_payments: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPaymentSummary constructor
- #to_json ⇒ String
Constructor Details
#initialize(total: OMIT, contractor_payments: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPaymentSummary
32 33 34 35 36 37 38 39 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 32 def initialize(total: OMIT, contractor_payments: OMIT, additional_properties: nil) @total = total if total != OMIT @contractor_payments = contractor_payments if contractor_payments != OMIT @additional_properties = additional_properties @_field_set = { "total": total, "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.
19 20 21 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 19 def additional_properties @additional_properties end |
#contractor_payments ⇒ Object (readonly)
contractor.
17 18 19 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 17 def contractor_payments @contractor_payments end |
#total ⇒ Object (readonly)
time period.
14 15 16 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 14 def total @total end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ContractorPayments::ContractorPaymentSummary
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 44 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) unless parsed_json["total"].nil? total = parsed_json["total"].to_json total = Gusto::ContractorPayments::ContractorPaymentSummaryTotal.from_json(json_object: total) else total = nil end contractor_payments = parsed_json["contractor_payments"]&.map do | item | item = item.to_json Gusto::ContractorPayments::ContractorPaymentSummaryContractorPaymentsItem.from_json(json_object: item) end new( total: total, contractor_payments: contractor_payments, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
75 76 77 78 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 75 def self.validate_raw(obj:) obj.total.nil? || Gusto::ContractorPayments::ContractorPaymentSummaryTotal.validate_raw(obj: obj.total) 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
66 67 68 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary.rb', line 66 def to_json @_field_set&.to_json end |