Class: Gusto::PaymentMethodBankAccount
- Inherits:
-
Object
- Object
- Gusto::PaymentMethodBankAccount
- 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
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#hidden_account_number ⇒ String
readonly
Masked bank account number.
-
#name ⇒ String
readonly
The bank account name.
-
#priority ⇒ Object
readonly
bank account paid.
-
#split_amount ⇒ Integer
readonly
The cents amount allocated for each payment split.
-
#uuid ⇒ String
readonly
The bank account ID.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(uuid:, name: OMIT, hidden_account_number: OMIT, priority: OMIT, split_amount: OMIT, additional_properties: nil) ⇒ Gusto::PaymentMethodBankAccount constructor
- #to_json ⇒ String
Constructor Details
#initialize(uuid:, name: OMIT, hidden_account_number: OMIT, priority: OMIT, split_amount: OMIT, additional_properties: nil) ⇒ Gusto::PaymentMethodBankAccount
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 = hidden_account_number if hidden_account_number != 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": hidden_account_number, "priority": priority, "split_amount": split_amount }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns 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_number ⇒ String (readonly)
Returns Masked bank account number.
13 14 15 |
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 13 def hidden_account_number @hidden_account_number end |
#name ⇒ String (readonly)
Returns The bank account name.
11 12 13 |
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 11 def name @name end |
#priority ⇒ Object (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_amount ⇒ Integer (readonly)
Returns 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 |
#uuid ⇒ String (readonly)
Returns 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
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"] hidden_account_number = parsed_json["hidden_account_number"] priority = parsed_json["priority"] split_amount = parsed_json["split_amount"] new( uuid: uuid, name: name, hidden_account_number: hidden_account_number, priority: priority, split_amount: split_amount, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ 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.hidden_account_number&.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_json ⇒ String
70 71 72 |
# File 'lib/fern_gusto/types/payment_method_bank_account.rb', line 70 def to_json @_field_set&.to_json end |