Class: Gusto::ContractorPaymentReceipt

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contractor_payment_uuid: OMIT, company_uuid: OMIT, name_of_sender: OMIT, name_of_recipient: OMIT, debit_date: OMIT, license: OMIT, license_uri: OMIT, right_to_refund: OMIT, liability_of_licensee: OMIT, totals: OMIT, contractor_payments: OMIT, licensee: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPaymentReceipt

Parameters:



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 68

def initialize(contractor_payment_uuid: OMIT, company_uuid: OMIT, name_of_sender: OMIT, name_of_recipient: OMIT, debit_date: OMIT, license: OMIT, license_uri: OMIT, right_to_refund: OMIT, liability_of_licensee: OMIT, totals: OMIT, contractor_payments: OMIT, licensee: OMIT, additional_properties: nil)
  @contractor_payment_uuid = contractor_payment_uuid if contractor_payment_uuid != OMIT
  @company_uuid = company_uuid if company_uuid != OMIT
  @name_of_sender = name_of_sender if name_of_sender != OMIT
  @name_of_recipient = name_of_recipient if name_of_recipient != OMIT
  @debit_date = debit_date if debit_date != OMIT
  @license = license if license != OMIT
  @license_uri = license_uri if license_uri != OMIT
  @right_to_refund = right_to_refund if right_to_refund != OMIT
  @liability_of_licensee = liability_of_licensee if liability_of_licensee != OMIT
  @totals = totals if totals != OMIT
  @contractor_payments = contractor_payments if contractor_payments != OMIT
  @licensee = licensee if licensee != OMIT
  @additional_properties = additional_properties
  @_field_set = { "contractor_payment_uuid": contractor_payment_uuid, "company_uuid": company_uuid, "name_of_sender": name_of_sender, "name_of_recipient": name_of_recipient, "debit_date": debit_date, "license": license, "license_uri": license_uri, "right_to_refund": right_to_refund, "liability_of_licensee": liability_of_licensee, "totals": totals, "contractor_payments": contractor_payments, "licensee": licensee }.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



41
42
43
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 41

def additional_properties
  @additional_properties
end

#company_uuidString (readonly)

Returns A unique identifier of the company making the contractor payment.

Returns:

  • (String)

    A unique identifier of the company making the contractor payment.



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

def company_uuid
  @company_uuid
end

#contractor_payment_uuidString (readonly)

Returns A unique identifier of the contractor payment receipt.

Returns:

  • (String)

    A unique identifier of the contractor payment receipt.



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

def contractor_payment_uuid
  @contractor_payment_uuid
end

#contractor_paymentsArray<Gusto::ContractorPaymentReceiptContractorPaymentsItem> (readonly)

Returns An array of contractor payments for this contractor payment.

Returns:



37
38
39
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 37

def contractor_payments
  @contractor_payments
end

#debit_dateString (readonly)

Returns The debit date for the contractor payment.

Returns:

  • (String)

    The debit date for the contractor payment.



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

def debit_date
  @debit_date
end

#liability_of_licenseeObject (readonly)



33
34
35
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 33

def liability_of_licensee
  @liability_of_licensee
end

#licenseObject (readonly)

visit our license page.“



24
25
26
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 24

def license
  @license
end

#license_uriObject (readonly)

fixed string “gusto.com/about/licenses



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

def license_uri
  @license_uri
end

#licenseeGusto::ContractorPaymentReceiptLicensee (readonly)

Returns The licensed payroll processor.

Returns:



39
40
41
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 39

def licensee
  @licensee
end

#name_of_recipientString (readonly)

Returns The individual or company name of the contractor receiving payment.

Returns:

  • (String)

    The individual or company name of the contractor receiving payment.



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

def name_of_recipient
  @name_of_recipient
end

#name_of_senderString (readonly)

Returns The name of the company making the contractor payment.

Returns:

  • (String)

    The name of the company making the contractor payment.



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

def name_of_sender
  @name_of_sender
end

#right_to_refundObject (readonly)



30
31
32
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 30

def right_to_refund
  @right_to_refund
end

#totalsGusto::ContractorPaymentReceiptTotals (readonly)

Returns The subtotals for the contractor payment.

Returns:



35
36
37
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 35

def totals
  @totals
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::ContractorPaymentReceipt

Parameters:

  • json_object (String)

Returns:



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 90

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  contractor_payment_uuid = parsed_json["contractor_payment_uuid"]
  company_uuid = parsed_json["company_uuid"]
  name_of_sender = parsed_json["name_of_sender"]
  name_of_recipient = parsed_json["name_of_recipient"]
  debit_date = parsed_json["debit_date"]
  license = parsed_json["license"]
  license_uri = parsed_json["license_uri"]
  right_to_refund = parsed_json["right_to_refund"]
  liability_of_licensee = parsed_json["liability_of_licensee"]
  unless parsed_json["totals"].nil?
    totals = parsed_json["totals"].to_json
    totals = Gusto::ContractorPaymentReceiptTotals.from_json(json_object: totals)
  else
    totals = nil
  end
  contractor_payments = parsed_json["contractor_payments"]&.map do | item |
  item = item.to_json
  Gusto::ContractorPaymentReceiptContractorPaymentsItem.from_json(json_object: item)
end
  unless parsed_json["licensee"].nil?
    licensee = parsed_json["licensee"].to_json
    licensee = Gusto::ContractorPaymentReceiptLicensee.from_json(json_object: licensee)
  else
    licensee = nil
  end
  new(
    contractor_payment_uuid: contractor_payment_uuid,
    company_uuid: company_uuid,
    name_of_sender: name_of_sender,
    name_of_recipient: name_of_recipient,
    debit_date: debit_date,
    license: license,
    license_uri: license_uri,
    right_to_refund: right_to_refund,
    liability_of_licensee: liability_of_licensee,
    totals: totals,
    contractor_payments: contractor_payments,
    licensee: licensee,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 146

def self.validate_raw(obj:)
  obj.contractor_payment_uuid&.is_a?(String) != false || raise("Passed value for field obj.contractor_payment_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.name_of_sender&.is_a?(String) != false || raise("Passed value for field obj.name_of_sender is not the expected type, validation failed.")
  obj.name_of_recipient&.is_a?(String) != false || raise("Passed value for field obj.name_of_recipient 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.license&.is_a?(String) != false || raise("Passed value for field obj.license is not the expected type, validation failed.")
  obj.license_uri&.is_a?(String) != false || raise("Passed value for field obj.license_uri is not the expected type, validation failed.")
  obj.right_to_refund&.is_a?(String) != false || raise("Passed value for field obj.right_to_refund is not the expected type, validation failed.")
  obj.liability_of_licensee&.is_a?(String) != false || raise("Passed value for field obj.liability_of_licensee is not the expected type, validation failed.")
  obj.totals.nil? || Gusto::ContractorPaymentReceiptTotals.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.")
  obj.licensee.nil? || Gusto::ContractorPaymentReceiptLicensee.validate_raw(obj: obj.licensee)
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


137
138
139
# File 'lib/fern_gusto/types/contractor_payment_receipt.rb', line 137

def to_json
  @_field_set&.to_json
end