Class: Gusto::Contractors::PaymentGroups::PaymentGroupsCreateRequestContractorPaymentsItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_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, payment_method: OMIT, wage: OMIT, hours: OMIT, bonus: OMIT, reimbursement: OMIT, additional_properties: nil) ⇒ Gusto::Contractors::PaymentGroups::PaymentGroupsCreateRequestContractorPaymentsItem

Parameters:

  • bonus (Float) (defaults to: OMIT)

    If the contractor is on an hourly wage, this is the bonus the contractor earned

  • reimbursement (Float) (defaults to: OMIT)

    Reimbursed wages for the contractor

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 42

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



25
26
27
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 25

def additional_properties
  @additional_properties
end

#bonusFloat (readonly)

Returns If the contractor is on an hourly wage, this is the bonus the contractor earned.

Returns:

  • (Float)

    If the contractor is on an hourly wage, this is the bonus the contractor earned



21
22
23
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 21

def bonus
  @bonus
end

#contractor_uuidString (readonly)

Returns The contractor receiving the payment.

Returns:

  • (String)

    The contractor receiving the payment



11
12
13
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 11

def contractor_uuid
  @contractor_uuid
end

#hoursObject (readonly)

contractor worked for the payment



19
20
21
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 19

def hours
  @hours
end

#payment_methodGusto::Contractors::PaymentGroups::PaymentGroupsCreateRequestContractorPaymentsItemPaymentMethod (readonly)



13
14
15
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 13

def payment_method
  @payment_method
end

#reimbursementFloat (readonly)

Returns Reimbursed wages for the contractor.

Returns:

  • (Float)

    Reimbursed wages for the contractor



23
24
25
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 23

def reimbursement
  @reimbursement
end

#wageObject (readonly)

contractor, regardless of hours worked



16
17
18
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 16

def wage
  @wage
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Contractors::PaymentGroups::PaymentGroupsCreateRequestContractorPaymentsItem



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 59

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

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


91
92
93
94
95
96
97
98
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 91

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.payment_method&.is_a?(Gusto::Contractors::PaymentGroups::PaymentGroupsCreateRequestContractorPaymentsItemPaymentMethod) != false || raise("Passed value for field obj.payment_method is not the expected type, validation failed.")
  obj.wage&.is_a?(Float) != false || raise("Passed value for field obj.wage is not the expected type, validation failed.")
  obj.hours&.is_a?(Float) != false || raise("Passed value for field obj.hours is not the expected type, validation failed.")
  obj.bonus&.is_a?(Float) != false || raise("Passed value for field obj.bonus is not the expected type, validation failed.")
  obj.reimbursement&.is_a?(Float) != false || raise("Passed value for field obj.reimbursement is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


82
83
84
# File 'lib/fern_gusto/contractors/payment_groups/types/payment_groups_create_request_contractor_payments_item.rb', line 82

def to_json
  @_field_set&.to_json
end