Class: Gusto::Employees::PaymentMethod::PaymentMethodUpdateRequestSplitsItem

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid: OMIT, name: OMIT, priority: OMIT, split_amount: OMIT, additional_properties: nil) ⇒ Gusto::Employees::PaymentMethod::PaymentMethodUpdateRequestSplitsItem

Parameters:

  • split_amount (Integer) (defaults to: OMIT)

    The cents amount allocated for each payment split

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



33
34
35
36
37
38
39
40
41
42
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 33

def initialize(uuid: OMIT, name: OMIT, priority: OMIT, split_amount: OMIT, additional_properties: nil)
  @uuid = uuid if uuid != OMIT
  @name = name if name != OMIT
  @priority = priority if priority != OMIT
  @split_amount = split_amount if split_amount != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "name": name, "priority": priority, "split_amount": split_amount }.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



19
20
21
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 19

def additional_properties
  @additional_properties
end

#nameString (readonly)

Returns The bank account name.

Returns:

  • (String)

    The bank account name



12
13
14
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 12

def name
  @name
end

#priorityObject (readonly)

bank account paid. Priority must be unique and sequential.



15
16
17
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 15

def priority
  @priority
end

#split_amountInteger (readonly)

Returns The cents amount allocated for each payment split.

Returns:

  • (Integer)

    The cents amount allocated for each payment split



17
18
19
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 17

def split_amount
  @split_amount
end

#uuidString (readonly)

Returns The bank account ID.

Returns:

  • (String)

    The bank account ID



10
11
12
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 10

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::Employees::PaymentMethod::PaymentMethodUpdateRequestSplitsItem

Parameters:

  • json_object (String)

Returns:



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 47

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  name = parsed_json["name"]
  priority = parsed_json["priority"]
  split_amount = parsed_json["split_amount"]
  new(
    uuid: uuid,
    name: name,
    priority: priority,
    split_amount: split_amount,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


74
75
76
77
78
79
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 74

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.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.priority&.is_a?(Integer) != false || raise("Passed value for field obj.priority is not the expected type, validation failed.")
  obj.split_amount&.is_a?(Integer) != false || raise("Passed value for field obj.split_amount is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


65
66
67
# File 'lib/fern_gusto/employees/payment_method/types/payment_method_update_request_splits_item.rb', line 65

def to_json
  @_field_set&.to_json
end