Class: Gusto::ContractorPaymentGroups::ContractorPaymentForGroup
- Inherits:
-
Object
- Object
- Gusto::ContractorPaymentGroups::ContractorPaymentForGroup
- Defined in:
- lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.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.
-
#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::ContractorPaymentGroups::ContractorPaymentForGroupPaymentMethod
readonly
The payment method.
-
#reimbursement ⇒ String
readonly
The reimbursement amount in the payment.
-
#status ⇒ Object
readonly
‘Unfunded`.
-
#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::ContractorPaymentGroups::ContractorPaymentForGroupWageType
readonly
The wage type for the payment.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentForGroup
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(uuid: OMIT, contractor_uuid: OMIT, bonus: 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::ContractorPaymentGroups::ContractorPaymentForGroup constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid: OMIT, contractor_uuid: OMIT, bonus: 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::ContractorPaymentGroups::ContractorPaymentForGroup
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 64 def initialize(uuid: OMIT, contractor_uuid: OMIT, bonus: 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 if uuid != OMIT @contractor_uuid = contractor_uuid if contractor_uuid != OMIT @bonus = bonus if bonus != 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, "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.
40 41 42 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 40 def additional_properties @additional_properties end |
#bonus ⇒ String (readonly)
Returns The bonus amount in the payment.
17 18 19 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.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_payment_groups/types/contractor_payment_for_group.rb', line 15 def contractor_uuid @contractor_uuid end |
#hourly_rate ⇒ String (readonly)
Returns The rate per hour worked for the payment.
30 31 32 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 30 def hourly_rate @hourly_rate end |
#hours ⇒ String (readonly)
Returns The number of hours worked for the payment.
19 20 21 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 19 def hours @hours end |
#may_cancel ⇒ Boolean (readonly)
Returns Determine if the contractor payment can be cancelled.
32 33 34 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 32 def may_cancel @may_cancel end |
#payment_method ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentForGroupPaymentMethod (readonly)
Returns The payment method.
21 22 23 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 21 def payment_method @payment_method end |
#reimbursement ⇒ String (readonly)
Returns The reimbursement amount in the payment.
23 24 25 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 23 def reimbursement @reimbursement end |
#status ⇒ Object (readonly)
‘Unfunded`.
28 29 30 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 28 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_payment_groups/types/contractor_payment_for_group.rb', line 13 def uuid @uuid end |
#wage ⇒ String (readonly)
Returns The fixed wage of the payment, regardless of hours worked.
34 35 36 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 34 def wage @wage end |
#wage_total ⇒ String (readonly)
Returns (hours * hourly_rate) + wage + bonus.
38 39 40 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 38 def wage_total @wage_total end |
#wage_type ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentForGroupWageType (readonly)
Returns The wage type for the payment.
36 37 38 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.rb', line 36 def wage_type @wage_type end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::ContractorPaymentGroups::ContractorPaymentForGroup
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_payment_groups/types/contractor_payment_for_group.rb', line 86 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"] 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, 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 |
# File 'lib/fern_gusto/contractor_payment_groups/types/contractor_payment_for_group.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.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::ContractorPaymentGroups::ContractorPaymentForGroupPaymentMethod) != 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::ContractorPaymentGroups::ContractorPaymentForGroupStatus) != 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::ContractorPaymentGroups::ContractorPaymentForGroupWageType) != 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_payment_groups/types/contractor_payment_for_group.rb', line 120 def to_json @_field_set&.to_json end |