Class: Gusto::PaymentMethodBankAccount

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

Overview

Representation of a bank account item

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, name: OMIT, hidden_account_number: OMIT, priority: OMIT, split_amount: OMIT, additional_properties: nil) ⇒ Gusto::PaymentMethodBankAccount

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



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 35

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



20
21
22
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 20

def additional_properties
  @additional_properties
end

#hidden_account_numberString (readonly)

Returns Masked bank account number.

Returns:

  • (String)

    Masked bank account number



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

def 
  @hidden_account_number
end

#nameString (readonly)

Returns The bank account name.

Returns:

  • (String)

    The bank account name



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

def name
  @name
end

#priorityObject (readonly)

bank account paid. Priority must be unique and sequential.



16
17
18
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 16

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



18
19
20
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 18

def split_amount
  @split_amount
end

#uuidString (readonly)

Returns The bank account ID.

Returns:

  • (String)

    The bank account ID



9
10
11
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 9

def uuid
  @uuid
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::PaymentMethodBankAccount

Parameters:

  • json_object (String)

Returns:



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 50

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"]
   = parsed_json["hidden_account_number"]
  priority = parsed_json["priority"]
  split_amount = parsed_json["split_amount"]
  new(
    uuid: uuid,
    name: name,
    hidden_account_number: ,
    priority: priority,
    split_amount: split_amount,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


79
80
81
82
83
84
85
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 79

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.&.is_a?(String) != false || raise("Passed value for field obj.hidden_account_number 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)


70
71
72
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 70

def to_json
  @_field_set&.to_json
end