Class: Gusto::ContractorPaymentReceiptContractorPaymentsItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/contractor_payment_receipt_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, contractor_first_name: OMIT, contractor_last_name: OMIT, contractor_business_name: OMIT, contractor_type: OMIT, payment_method: OMIT, wage: OMIT, bonus: OMIT, reimbursement: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPaymentReceiptContractorPaymentsItem

Parameters:

  • wage (String) (defaults to: OMIT)

    The fixed wage of the payment, regardless of hours worked.

  • bonus (String) (defaults to: OMIT)

    The bonus amount in the payment.

  • reimbursement (String) (defaults to: OMIT)

    The reimbursement amount in the payment.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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

def initialize(contractor_uuid: OMIT, contractor_first_name: OMIT, contractor_last_name: OMIT, contractor_business_name: OMIT, contractor_type: OMIT, payment_method: OMIT, wage: OMIT, bonus: OMIT, reimbursement: OMIT, additional_properties: nil)
  @contractor_uuid = contractor_uuid if contractor_uuid != OMIT
  @contractor_first_name = contractor_first_name if contractor_first_name != OMIT
  @contractor_last_name = contractor_last_name if contractor_last_name != OMIT
  @contractor_business_name = contractor_business_name if contractor_business_name != OMIT
  @contractor_type = contractor_type if contractor_type != OMIT
  @payment_method = payment_method if payment_method != OMIT
  @wage = wage if wage != OMIT
  @bonus = bonus if bonus != OMIT
  @reimbursement = reimbursement if reimbursement != OMIT
  @additional_properties = additional_properties
  @_field_set = { "contractor_uuid": contractor_uuid, "contractor_first_name": contractor_first_name, "contractor_last_name": contractor_last_name, "contractor_business_name": contractor_business_name, "contractor_type": contractor_type, "payment_method": payment_method, "wage": wage, "bonus": bonus, "reimbursement": reimbursement }.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



29
30
31
# File 'lib/fern_gusto/types/contractor_payment_receipt_contractor_payments_item.rb', line 29

def additional_properties
  @additional_properties
end

#bonusString (readonly)

Returns The bonus amount in the payment.

Returns:

  • (String)

    The bonus amount in the payment.



25
26
27
# File 'lib/fern_gusto/types/contractor_payment_receipt_contractor_payments_item.rb', line 25

def bonus
  @bonus
end

#contractor_business_nameString (readonly)

Returns The business name of the employee. Applies when ‘contractor_type` is `Business`.

Returns:

  • (String)

    The business name of the employee. Applies when ‘contractor_type` is `Business`.



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

def contractor_business_name
  @contractor_business_name
end

#contractor_first_nameObject (readonly)

‘Individual`.



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

def contractor_first_name
  @contractor_first_name
end

#contractor_last_nameString (readonly)

Returns The last name of the contractor. Applies when ‘contractor_type` is `Individual`.

Returns:

  • (String)

    The last name of the contractor. Applies when ‘contractor_type` is `Individual`.



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

def contractor_last_name
  @contractor_last_name
end

#contractor_typeObject (readonly)

‘Individual` `Business`



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

def contractor_type
  @contractor_type
end

#contractor_uuidString (readonly)

Returns The UUID of the contractor.

Returns:

  • (String)

    The UUID of the contractor.



8
9
10
# File 'lib/fern_gusto/types/contractor_payment_receipt_contractor_payments_item.rb', line 8

def contractor_uuid
  @contractor_uuid
end

#payment_methodObject (readonly)

‘Direct Deposit` `Check` `Historical Payment` `Correction Payment`



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

def payment_method
  @payment_method
end

#reimbursementString (readonly)

Returns The reimbursement amount in the payment.

Returns:

  • (String)

    The reimbursement amount in the payment.



27
28
29
# File 'lib/fern_gusto/types/contractor_payment_receipt_contractor_payments_item.rb', line 27

def reimbursement
  @reimbursement
end

#wageString (readonly)

Returns The fixed wage of the payment, regardless of hours worked.

Returns:

  • (String)

    The fixed wage of the payment, regardless of hours worked.



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

def wage
  @wage
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ContractorPaymentReceiptContractorPaymentsItem

Parameters:

  • json_object (String)

Returns:



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

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"]
  contractor_first_name = parsed_json["contractor_first_name"]
  contractor_last_name = parsed_json["contractor_last_name"]
  contractor_business_name = parsed_json["contractor_business_name"]
  contractor_type = parsed_json["contractor_type"]
  payment_method = parsed_json["payment_method"]
  wage = parsed_json["wage"]
  bonus = parsed_json["bonus"]
  reimbursement = parsed_json["reimbursement"]
  new(
    contractor_uuid: contractor_uuid,
    contractor_first_name: contractor_first_name,
    contractor_last_name: contractor_last_name,
    contractor_business_name: contractor_business_name,
    contractor_type: contractor_type,
    payment_method: payment_method,
    wage: wage,
    bonus: bonus,
    reimbursement: reimbursement,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


108
109
110
111
112
113
114
115
116
117
118
# File 'lib/fern_gusto/types/contractor_payment_receipt_contractor_payments_item.rb', line 108

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.contractor_first_name&.is_a?(String) != false || raise("Passed value for field obj.contractor_first_name is not the expected type, validation failed.")
  obj.contractor_last_name&.is_a?(String) != false || raise("Passed value for field obj.contractor_last_name is not the expected type, validation failed.")
  obj.contractor_business_name&.is_a?(String) != false || raise("Passed value for field obj.contractor_business_name is not the expected type, validation failed.")
  obj.contractor_type&.is_a?(String) != false || raise("Passed value for field obj.contractor_type is not the expected type, validation failed.")
  obj.payment_method&.is_a?(String) != false || raise("Passed value for field obj.payment_method is not the expected type, validation failed.")
  obj.wage&.is_a?(String) != false || raise("Passed value for field obj.wage is not the expected type, validation failed.")
  obj.bonus&.is_a?(String) != false || raise("Passed value for field obj.bonus is not the expected type, validation failed.")
  obj.reimbursement&.is_a?(String) != false || raise("Passed value for field obj.reimbursement is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


99
100
101
# File 'lib/fern_gusto/types/contractor_payment_receipt_contractor_payments_item.rb', line 99

def to_json
  @_field_set&.to_json
end