Class: PersonaApi::Client
- Inherits:
-
Object
- Object
- PersonaApi::Client
- Defined in:
- lib/persona_api/client.rb
Constant Summary collapse
- BASE_URL =
'https://withpersona.com/api/v1/'
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
- #accounts ⇒ Object
- #api_logs ⇒ Object
- #cases ⇒ Object
- #connection ⇒ Object
- #database_verifications ⇒ Object
- #documents ⇒ Object
- #events ⇒ Object
- #files ⇒ Object
- #government_id_verifications ⇒ Object
-
#initialize(api_key:, adapter: Faraday.default_adapter) ⇒ Client
constructor
A new instance of Client.
- #inquiries ⇒ Object
- #list_items ⇒ Object
- #lists ⇒ Object
- #phone_carrier_verifications ⇒ Object
- #phone_number_verifications ⇒ Object
- #reports ⇒ Object
- #selfie_verifications ⇒ Object
- #tin_database_verifications ⇒ Object
- #transactions ⇒ Object
- #user_audit_logs ⇒ Object
- #verifications ⇒ Object
Constructor Details
#initialize(api_key:, adapter: Faraday.default_adapter) ⇒ Client
Returns a new instance of Client.
10 11 12 13 |
# File 'lib/persona_api/client.rb', line 10 def initialize(api_key:, adapter: Faraday.default_adapter) @api_key = api_key @adapter = adapter end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
8 9 10 |
# File 'lib/persona_api/client.rb', line 8 def adapter @adapter end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/persona_api/client.rb', line 8 def api_key @api_key end |
Instance Method Details
#accounts ⇒ Object
15 16 17 |
# File 'lib/persona_api/client.rb', line 15 def accounts AccountsResource.new(self) end |
#api_logs ⇒ Object
19 20 21 |
# File 'lib/persona_api/client.rb', line 19 def api_logs ApiLogsResource.new(self) end |
#cases ⇒ Object
23 24 25 |
# File 'lib/persona_api/client.rb', line 23 def cases CasesResource.new(self) end |
#connection ⇒ Object
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/persona_api/client.rb', line 91 def connection @connection ||= Faraday.new do |connection| connection.url_prefix = BASE_URL connection.request :authorization, :Bearer, api_key connection.headers['Key-Inflection'] = "snake" connection.request :json connection.response :json, content_type: "application/json" connection.adapter adapter end end |
#database_verifications ⇒ Object
27 28 29 |
# File 'lib/persona_api/client.rb', line 27 def database_verifications DatabaseVerificationsResource.new(self) end |
#documents ⇒ Object
31 32 33 |
# File 'lib/persona_api/client.rb', line 31 def documents DocumentsResource.new(self) end |
#events ⇒ Object
35 36 37 |
# File 'lib/persona_api/client.rb', line 35 def events EventsResource.new(self) end |
#files ⇒ Object
39 40 41 |
# File 'lib/persona_api/client.rb', line 39 def files FilesResource.new(self) end |
#government_id_verifications ⇒ Object
43 44 45 |
# File 'lib/persona_api/client.rb', line 43 def government_id_verifications GovernmentIdVerificationsResource.new(self) end |
#inquiries ⇒ Object
47 48 49 |
# File 'lib/persona_api/client.rb', line 47 def inquiries InquiriesResource.new(self) end |
#list_items ⇒ Object
55 56 57 |
# File 'lib/persona_api/client.rb', line 55 def list_items ListItemsResource.new(self) end |
#lists ⇒ Object
51 52 53 |
# File 'lib/persona_api/client.rb', line 51 def lists ListsResource.new(self) end |
#phone_carrier_verifications ⇒ Object
59 60 61 |
# File 'lib/persona_api/client.rb', line 59 def phone_carrier_verifications PhoneCarrierVerificationsResource.new(self) end |
#phone_number_verifications ⇒ Object
63 64 65 |
# File 'lib/persona_api/client.rb', line 63 def phone_number_verifications PhoneNumberVerificationsResource.new(self) end |
#reports ⇒ Object
67 68 69 |
# File 'lib/persona_api/client.rb', line 67 def reports ReportsResource.new(self) end |
#selfie_verifications ⇒ Object
71 72 73 |
# File 'lib/persona_api/client.rb', line 71 def selfie_verifications SelfieVerificationsResource.new(self) end |
#tin_database_verifications ⇒ Object
75 76 77 |
# File 'lib/persona_api/client.rb', line 75 def tin_database_verifications TinDatabaseVerificationsResource.new(self) end |
#transactions ⇒ Object
79 80 81 |
# File 'lib/persona_api/client.rb', line 79 def transactions TransactionsResource.new(self) end |
#user_audit_logs ⇒ Object
83 84 85 |
# File 'lib/persona_api/client.rb', line 83 def user_audit_logs UserAuditLogsResource.new(self) end |
#verifications ⇒ Object
87 88 89 |
# File 'lib/persona_api/client.rb', line 87 def verifications VerificationsResource.new(self) end |