Class: Gusto::ContractorPayments::ContractorPayment
- Inherits:
-
Object
- Object
- Gusto::ContractorPayments::ContractorPayment
- Defined in:
- lib/fern_gusto/contractor_payments/types/contractor_payment.rb
Overview
The representation of a single contractor payment.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#bonus ⇒ String
readonly
The bonus amount in the payment.
-
#contractor_uuid ⇒ String
readonly
The UUID of the contractor.
-
#date ⇒ String
readonly
The payment date.
-
#hourly_rate ⇒ String
readonly
The rate per hour worked for the payment.
-
#hours ⇒ String
readonly
The number of hours worked for the payment.
-
#may_cancel ⇒ Boolean
readonly
Determine if the contractor payment can be cancelled.
-
#payment_method ⇒ Gusto::ContractorPayments::ContractorPaymentPaymentMethod
readonly
The payment method.
-
#reimbursement ⇒ String
readonly
The reimbursement amount in the payment.
-
#status ⇒ Gusto::ContractorPayments::ContractorPaymentStatus
readonly
Contractor payment status.
-
#uuid ⇒ String
readonly
The unique identifier of the contractor payment in Gusto.
-
#wage ⇒ String
readonly
The fixed wage of the payment, regardless of hours worked.
-
#wage_total ⇒ String
readonly
(hours * hourly_rate) + wage + bonus.
-
#wage_type ⇒ Gusto::ContractorPayments::ContractorPaymentWageType
readonly
The wage type for the payment.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(uuid:, contractor_uuid: OMIT, bonus: OMIT, date: OMIT, hours: OMIT, payment_method: OMIT, reimbursement: OMIT, status: OMIT, hourly_rate: OMIT, may_cancel: OMIT, wage: OMIT, wage_type: OMIT, wage_total: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPayment constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid:, contractor_uuid: OMIT, bonus: OMIT, date: OMIT, hours: OMIT, payment_method: OMIT, reimbursement: OMIT, status: OMIT, hourly_rate: OMIT, may_cancel: OMIT, wage: OMIT, wage_type: OMIT, wage_total: OMIT, additional_properties: nil) ⇒ Gusto::ContractorPayments::ContractorPayment
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 61 def initialize(uuid:, contractor_uuid: OMIT, bonus: OMIT, date: OMIT, hours: OMIT, payment_method: OMIT, reimbursement: OMIT, status: OMIT, hourly_rate: OMIT, may_cancel: OMIT, wage: OMIT, wage_type: OMIT, wage_total: OMIT, additional_properties: nil) @uuid = uuid @contractor_uuid = contractor_uuid if contractor_uuid != OMIT @bonus = bonus if bonus != OMIT @date = date if date != OMIT @hours = hours if hours != OMIT @payment_method = payment_method if payment_method != OMIT @reimbursement = reimbursement if reimbursement != OMIT @status = status if status != OMIT @hourly_rate = hourly_rate if hourly_rate != OMIT @may_cancel = may_cancel if may_cancel != OMIT @wage = wage if wage != OMIT @wage_type = wage_type if wage_type != OMIT @wage_total = wage_total if wage_total != OMIT @additional_properties = additional_properties @_field_set = { "uuid": uuid, "contractor_uuid": contractor_uuid, "bonus": bonus, "date": date, "hours": hours, "payment_method": payment_method, "reimbursement": reimbursement, "status": status, "hourly_rate": hourly_rate, "may_cancel": may_cancel, "wage": wage, "wage_type": wage_type, "wage_total": wage_total }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
39 40 41 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 39 def additional_properties @additional_properties end |
#bonus ⇒ String (readonly)
Returns The bonus amount in the payment.
17 18 19 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 17 def bonus @bonus end |
#contractor_uuid ⇒ String (readonly)
Returns The UUID of the contractor.
15 16 17 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 15 def contractor_uuid @contractor_uuid end |
#date ⇒ String (readonly)
Returns The payment date.
19 20 21 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 19 def date @date end |
#hourly_rate ⇒ String (readonly)
Returns The rate per hour worked for the payment.
29 30 31 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 29 def hourly_rate @hourly_rate end |
#hours ⇒ String (readonly)
Returns The number of hours worked for the payment.
21 22 23 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 21 def hours @hours end |
#may_cancel ⇒ Boolean (readonly)
Returns Determine if the contractor payment can be cancelled.
31 32 33 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 31 def may_cancel @may_cancel end |
#payment_method ⇒ Gusto::ContractorPayments::ContractorPaymentPaymentMethod (readonly)
Returns The payment method.
23 24 25 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 23 def payment_method @payment_method end |
#reimbursement ⇒ String (readonly)
Returns The reimbursement amount in the payment.
25 26 27 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 25 def reimbursement @reimbursement end |
#status ⇒ Gusto::ContractorPayments::ContractorPaymentStatus (readonly)
Returns Contractor payment status.
27 28 29 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 27 def status @status end |
#uuid ⇒ String (readonly)
Returns The unique identifier of the contractor payment in Gusto.
13 14 15 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 13 def uuid @uuid end |
#wage ⇒ String (readonly)
Returns The fixed wage of the payment, regardless of hours worked.
33 34 35 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 33 def wage @wage end |
#wage_total ⇒ String (readonly)
Returns (hours * hourly_rate) + wage + bonus.
37 38 39 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 37 def wage_total @wage_total end |
#wage_type ⇒ Gusto::ContractorPayments::ContractorPaymentWageType (readonly)
Returns The wage type for the payment.
35 36 37 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 35 def wage_type @wage_type end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ContractorPayments::ContractorPayment
84 85 86 87 88 89 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 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 84 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) uuid = parsed_json["uuid"] contractor_uuid = parsed_json["contractor_uuid"] bonus = parsed_json["bonus"] date = parsed_json["date"] hours = parsed_json["hours"] payment_method = parsed_json["payment_method"] reimbursement = parsed_json["reimbursement"] status = parsed_json["status"] hourly_rate = parsed_json["hourly_rate"] may_cancel = parsed_json["may_cancel"] wage = parsed_json["wage"] wage_type = parsed_json["wage_type"] wage_total = parsed_json["wage_total"] new( uuid: uuid, contractor_uuid: contractor_uuid, bonus: bonus, date: date, hours: hours, payment_method: payment_method, reimbursement: reimbursement, status: status, hourly_rate: hourly_rate, may_cancel: may_cancel, wage: wage, wage_type: wage_type, wage_total: wage_total, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 129 def self.validate_raw(obj:) obj.uuid.is_a?(String) != false || raise("Passed value for field obj.uuid is not the expected type, validation failed.") obj.contractor_uuid&.is_a?(String) != false || raise("Passed value for field obj.contractor_uuid 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.date&.is_a?(String) != false || raise("Passed value for field obj.date is not the expected type, validation failed.") obj.hours&.is_a?(String) != false || raise("Passed value for field obj.hours is not the expected type, validation failed.") obj.payment_method&.is_a?(Gusto::ContractorPayments::ContractorPaymentPaymentMethod) != false || raise("Passed value for field obj.payment_method 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.") obj.status&.is_a?(Gusto::ContractorPayments::ContractorPaymentStatus) != false || raise("Passed value for field obj.status is not the expected type, validation failed.") obj.hourly_rate&.is_a?(String) != false || raise("Passed value for field obj.hourly_rate is not the expected type, validation failed.") obj.may_cancel&.is_a?(Boolean) != false || raise("Passed value for field obj.may_cancel 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.wage_type&.is_a?(Gusto::ContractorPayments::ContractorPaymentWageType) != false || raise("Passed value for field obj.wage_type 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.") end |
Instance Method Details
#to_json ⇒ String
120 121 122 |
# File 'lib/fern_gusto/contractor_payments/types/contractor_payment.rb', line 120 def to_json @_field_set&.to_json end |