Class: Gusto::CompanyBankAccounts::CompanyBankAccount

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

Overview

The company bank account

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, company_uuid: OMIT, account_type: OMIT, routing_number: OMIT, hidden_account_number: OMIT, verification_status: OMIT, verification_type: OMIT, plaid_status: OMIT, last_cached_balance: OMIT, balance_fetched_date: OMIT, name: OMIT, additional_properties: nil) ⇒ Gusto::CompanyBankAccounts::CompanyBankAccount

Parameters:

  • name (String) (defaults to: OMIT)

    Name of bank account

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 80

def initialize(uuid:, company_uuid: OMIT, account_type: OMIT, routing_number: OMIT, hidden_account_number: OMIT, verification_status: OMIT, verification_type: OMIT, plaid_status: OMIT, last_cached_balance: OMIT, balance_fetched_date: OMIT, name: OMIT, additional_properties: nil)
  @uuid = uuid
  @company_uuid = company_uuid if company_uuid != OMIT
  @account_type =  if  != OMIT
  @routing_number = routing_number if routing_number != OMIT
  @hidden_account_number =  if  != OMIT
  @verification_status = verification_status if verification_status != OMIT
  @verification_type = verification_type if verification_type != OMIT
  @plaid_status = plaid_status if plaid_status != OMIT
  @last_cached_balance = last_cached_balance if last_cached_balance != OMIT
  @balance_fetched_date = balance_fetched_date if balance_fetched_date != OMIT
  @name = name if name != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "company_uuid": company_uuid, "account_type": , "routing_number": routing_number, "hidden_account_number": , "verification_status": verification_status, "verification_type": verification_type, "plaid_status": plaid_status, "last_cached_balance": last_cached_balance, "balance_fetched_date": balance_fetched_date, "name": name }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#account_typeGusto::CompanyBankAccounts::CompanyBankAccountAccountType (readonly)

Returns Bank account type.



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

def 
  @account_type
end

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



48
49
50
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 48

def additional_properties
  @additional_properties
end

#balance_fetched_dateObject (readonly)

when verification type is Plaid.



44
45
46
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 44

def balance_fetched_date
  @balance_fetched_date
end

#company_uuidString (readonly)

Returns UUID of the company.

Returns:

  • (String)

    UUID of the company



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

def company_uuid
  @company_uuid
end

#hidden_account_numberString (readonly)

Returns Masked bank account number.

Returns:

  • (String)

    Masked bank account number



22
23
24
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 22

def 
  @hidden_account_number
end

#last_cached_balanceObject (readonly)

verification type is Plaid.



41
42
43
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 41

def last_cached_balance
  @last_cached_balance
end

#nameString (readonly)

Returns Name of bank account.

Returns:

  • (String)

    Name of bank account



46
47
48
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 46

def name
  @name
end

#plaid_statusObject (readonly)

type is Plaid.



37
38
39
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 37

def plaid_status
  @plaid_status
end

#routing_numberString (readonly)

Returns The bank account’s routing number.

Returns:

  • (String)

    The bank account’s routing number



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

def routing_number
  @routing_number
end

#uuidString (readonly)

Returns UUID of the bank account.

Returns:

  • (String)

    UUID of the bank account



14
15
16
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 14

def uuid
  @uuid
end

#verification_statusObject (readonly)

‘verified’ means the bank account is verified.



29
30
31
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 29

def verification_status
  @verification_status
end

#verification_typeObject (readonly)

‘plaid’ means the bank account is connected through Plaid.



34
35
36
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 34

def verification_type
  @verification_type
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::CompanyBankAccounts::CompanyBankAccount

Parameters:

  • json_object (String)

Returns:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 101

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  company_uuid = parsed_json["company_uuid"]
   = parsed_json["account_type"]
  routing_number = parsed_json["routing_number"]
   = parsed_json["hidden_account_number"]
  verification_status = parsed_json["verification_status"]
  verification_type = parsed_json["verification_type"]
  plaid_status = parsed_json["plaid_status"]
  last_cached_balance = parsed_json["last_cached_balance"]
  balance_fetched_date = parsed_json["balance_fetched_date"]
  name = parsed_json["name"]
  new(
    uuid: uuid,
    company_uuid: company_uuid,
    account_type: ,
    routing_number: routing_number,
    hidden_account_number: ,
    verification_status: verification_status,
    verification_type: verification_type,
    plaid_status: plaid_status,
    last_cached_balance: last_cached_balance,
    balance_fetched_date: balance_fetched_date,
    name: name,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 142

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.company_uuid&.is_a?(String) != false || raise("Passed value for field obj.company_uuid is not the expected type, validation failed.")
  obj.&.is_a?(Gusto::CompanyBankAccounts::CompanyBankAccountAccountType) != false || raise("Passed value for field obj.account_type is not the expected type, validation failed.")
  obj.routing_number&.is_a?(String) != false || raise("Passed value for field obj.routing_number 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.verification_status&.is_a?(Gusto::CompanyBankAccounts::CompanyBankAccountVerificationStatus) != false || raise("Passed value for field obj.verification_status is not the expected type, validation failed.")
  obj.verification_type&.is_a?(Gusto::CompanyBankAccounts::CompanyBankAccountVerificationType) != false || raise("Passed value for field obj.verification_type is not the expected type, validation failed.")
  obj.plaid_status&.is_a?(Gusto::CompanyBankAccounts::CompanyBankAccountPlaidStatus) != false || raise("Passed value for field obj.plaid_status is not the expected type, validation failed.")
  obj.last_cached_balance&.is_a?(String) != false || raise("Passed value for field obj.last_cached_balance is not the expected type, validation failed.")
  obj.balance_fetched_date&.is_a?(String) != false || raise("Passed value for field obj.balance_fetched_date 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.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


133
134
135
# File 'lib/fern_gusto/company_bank_accounts/types/company_bank_account.rb', line 133

def to_json
  @_field_set&.to_json
end