Class: Gusto::ContractorPayments::ContractorPaymentSummaryByDatesContractorPaymentsItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contractor_uuid: OMIT, check_date: OMIT, reimbursement_total: OMIT, wage_total: OMIT, payments: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPaymentSummaryByDatesContractorPaymentsItem

Parameters:

  • contractor_uuid (String) (defaults to: OMIT)

    The UUID of the contractor.

  • check_date (String) (defaults to: OMIT)

    The payment check date.

  • reimbursement_total (String) (defaults to: OMIT)

    The total reimbursements for the contractor within a given time period.

  • wage_total (String) (defaults to: OMIT)

    The total wages for the contractor within a given time period.

  • payments (Array<Gusto::ContractorPayments::ContractorPayment>) (defaults to: OMIT)

    The contractor’s payments within a given time period.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 35

def initialize(contractor_uuid: OMIT, check_date: OMIT, reimbursement_total: OMIT, wage_total: OMIT, payments: OMIT, additional_properties: nil)
  @contractor_uuid = contractor_uuid if contractor_uuid != OMIT
  @check_date = check_date if check_date != 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, "check_date": check_date, "reimbursement_total": reimbursement_total, "wage_total": wage_total, "payments": 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



21
22
23
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 21

def additional_properties
  @additional_properties
end

#check_dateString (readonly)

Returns The payment check date.

Returns:

  • (String)

    The payment check date.



13
14
15
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 13

def check_date
  @check_date
end

#contractor_uuidString (readonly)

Returns The UUID of the contractor.

Returns:

  • (String)

    The UUID of the contractor.



11
12
13
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 11

def contractor_uuid
  @contractor_uuid
end

#paymentsArray<Gusto::ContractorPayments::ContractorPayment> (readonly)

Returns The contractor’s payments within a given time period.

Returns:



19
20
21
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 19

def payments
  @payments
end

#reimbursement_totalString (readonly)

Returns The total reimbursements for the contractor within a given time period.

Returns:

  • (String)

    The total reimbursements for the contractor within a given time period.



15
16
17
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 15

def reimbursement_total
  @reimbursement_total
end

#wage_totalString (readonly)

Returns The total wages for the contractor within a given time period.

Returns:

  • (String)

    The total wages for the contractor within a given time period.



17
18
19
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 17

def wage_total
  @wage_total
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ContractorPayments::ContractorPaymentSummaryByDatesContractorPaymentsItem



51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 51

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"]
  check_date = parsed_json["check_date"]
  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,
    check_date: check_date,
    reimbursement_total: reimbursement_total,
    wage_total: wage_total,
    payments: payments,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


84
85
86
87
88
89
90
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 84

def self.validate_raw(obj:)
  obj.contractor_uuid&.is_a?(String) != false || raise("Passed value for field obj.contractor_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.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_jsonString

Returns:

  • (String)


75
76
77
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment_summary_by_dates_contractor_payments_item.rb', line 75

def to_json
  @_field_set&.to_json
end