Class: Sydecar::Person
- Inherits:
-
Object
- Object
- Sydecar::Person
- Defined in:
- lib/sydecar/person.rb
Constant Summary collapse
- URL =
'/v1/persons'
- CREATE_URL =
"#{URL}/create"
Class Method Summary collapse
- .create(body:, idempotency_key:) ⇒ Object
- .find(id:) ⇒ Object
-
.find_all(params: {}, body: {}) ⇒ Object
- String
-
sort: asc / desc [Integer] limit [Integer] offset [String] start_date (format: yyyy-mm-dd) [String] end_date (format: yyyy-mm-dd).
- .kyc(id:) ⇒ Object
- .update(id:, body:) ⇒ Object
Class Method Details
.create(body:, idempotency_key:) ⇒ Object
9 10 11 |
# File 'lib/sydecar/person.rb', line 9 def create(body:, idempotency_key:) Connection.instance.post(CREATE_URL, body, { 'idempotency-key': idempotency_key }) end |
.find(id:) ⇒ Object
14 15 16 |
# File 'lib/sydecar/person.rb', line 14 def find(id:) Connection.instance.get("#{URL}/#{id}", { reveal_pii: true }) end |
.find_all(params: {}, body: {}) ⇒ Object
- String
-
sort: asc / desc
- Integer
-
limit
- Integer
-
offset
- String
-
start_date (format: yyyy-mm-dd)
- String
-
end_date (format: yyyy-mm-dd)
31 32 33 34 35 |
# File 'lib/sydecar/person.rb', line 31 def find_all(params: {}, body: {}) query = '?' query += URI.encode_www_form(params) Connection.instance.post("#{URL}#{query}", body) end |
.kyc(id:) ⇒ Object
38 39 40 |
# File 'lib/sydecar/person.rb', line 38 def kyc(id:) Connection.instance.post("#{URL}/#{id}/kyc") end |
.update(id:, body:) ⇒ Object
20 21 22 |
# File 'lib/sydecar/person.rb', line 20 def update(id:, body:) Connection.instance.patch("#{URL}/#{id}", body) end |