Class: Sydecar::CapitalCall
- Inherits:
-
Object
- Object
- Sydecar::CapitalCall
- Defined in:
- lib/sydecar/capital_call.rb
Constant Summary collapse
- CAPITAL_CALL_EVENTS_URL =
'v1/capital_call_events'
Class Method Summary collapse
-
.create_spv_capital_call(body:, idempotency_key:) ⇒ Hash
This method create an SPV capital call event } - Create one or more capital call events.
-
.delete_spv_capital_call(capital_call_event_id:) ⇒ Hash
Delete an SPV capital call event by id Delete an SPV capital call event.
-
.fetch_capital_calls_for_spv(params: {}, body: {}) ⇒ Object
Fetch all capital call events for an SPV RESPONSE DATA (Sample): { “data”: [ { “id”: “string”, “created_at”: “2019-08-24T14:15:22Z”, “updated_at”: “2019-08-24T14:15:22Z”, “spv_id”: “string”, “memo”: “string”, “percentage”: 0, “capital_calls”: [ { “id”: “string”, “created_at”: “2019-08-24T14:15:22Z”, “updated_at”: “2019-08-24T14:15:22Z”, “amount”: 0, “amount_funded”: 0, “due_date”: “2019-08-24T14:15:22Z”, “stage”: “CREATED”, “subscription_id”: “string”, “capital_call_event_id”: “string” } ] } ], “pagination”: { “limit”: 0, “offset”: 0, “total”: 0 } } See on the api-docs.sydecar.io/api/#tag/Capital-Call-Management/operation/getAllCapitalCallEvents.
-
.fetch_spv_capital_call(capital_call_event_id:, query: {}) ⇒ Hash
Fetch an SPV capital call event by id }.
-
.get_capital_call_for_disbursement(body:, query: {}) ⇒ Hash
Get the capital call needed for a disbursement Returns the capital call percentage needed for sufficient funds for a given disbursement.
-
.update_spv_capital_call(capital_call_event_id:, body: {}) ⇒ Hash
Update an SPV capital call event Update an SPV capital call event.
Class Method Details
.create_spv_capital_call(body:, idempotency_key:) ⇒ Hash
This method create an SPV capital call event }
- Create one or more capital call events. A valid SPV id is needed.
} More detail see on the api-docs.sydecar.io/api/#tag/Capital-Call-Management/operation/createOneOrMoreCapitalCallEvents
104 105 106 |
# File 'lib/sydecar/capital_call.rb', line 104 def create_spv_capital_call(body:, idempotency_key:) Connection.instance.post("#{CAPITAL_CALL_EVENTS_URL}/create", body, { 'idempotency-key': idempotency_key }) end |
.delete_spv_capital_call(capital_call_event_id:) ⇒ Hash
Delete an SPV capital call event by id Delete an SPV capital call event. You can only delete a capital call event before subscription captial calls have been made (e.g. if the capital call event has been created but no subscriptions have been created for the spv so far).
} More detail see on the api-docs.sydecar.io/api/#tag/Capital-Call-Management/operation/removeCapitalCallEvent
192 193 194 |
# File 'lib/sydecar/capital_call.rb', line 192 def delete_spv_capital_call(capital_call_event_id:) Connection.instance.delete("#{CAPITAL_CALL_EVENTS_URL}/#{capital_call_event_id}") end |
.fetch_capital_calls_for_spv(params: {}, body: {}) ⇒ Object
Fetch all capital call events for an SPV RESPONSE DATA (Sample):
{
"data": [
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"spv_id": "string",
"memo": "string",
"percentage": 0,
"capital_calls": [
{
"id": "string",
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"amount": 0,
"amount_funded": 0,
"due_date": "2019-08-24T14:15:22Z",
"stage": "CREATED",
"subscription_id": "string",
"capital_call_event_id": "string"
}
]
}
],
"pagination": {
"limit": 0,
"offset": 0,
"total": 0
}
} See on the api-docs.sydecar.io/api/#tag/Capital-Call-Management/operation/getAllCapitalCallEvents
54 55 56 57 58 |
# File 'lib/sydecar/capital_call.rb', line 54 def fetch_capital_calls_for_spv(params: {}, body: {}) query = '?' query += URI.encode_www_form(params) Connection.instance.post("#{CAPITAL_CALL_EVENTS_URL}#{query}", body) end |
.fetch_spv_capital_call(capital_call_event_id:, query: {}) ⇒ Hash
Fetch an SPV capital call event by id }
138 139 140 141 |
# File 'lib/sydecar/capital_call.rb', line 138 def fetch_spv_capital_call(capital_call_event_id:, query: {}) query = "?#{URI.encode_www_form(query)}" Connection.instance.get("#{CAPITAL_CALL_EVENTS_URL}/#{capital_call_event_id}#{query}") end |
.get_capital_call_for_disbursement(body:, query: {}) ⇒ Hash
Get the capital call needed for a disbursement Returns the capital call percentage needed for sufficient funds for a given disbursement. Uses reserved subscription amounts, unless ‘use_spv_allocation’ is passed as ‘true’.
} More detail see on the api-docs.sydecar.io/api/#tag/Capital-Call-Management/operation/getCapitalCallNeededForDisbursement
217 218 219 220 |
# File 'lib/sydecar/capital_call.rb', line 217 def get_capital_call_for_disbursement(body:, query: {}) query = "?#{URI.encode_www_form(query)}" Connection.instance.post("#{CAPITAL_CALL_EVENTS_URL}/capital_call_needed_for_disbursement#{query}", body) end |
.update_spv_capital_call(capital_call_event_id:, body: {}) ⇒ Hash
Update an SPV capital call event Update an SPV capital call event. You can only update a capital call event before subscription captial calls have been made (e.g. if the capital call event has been created and the spv has no subscriptions created yet).
More detail see on the api-docs.sydecar.io/api/#tag/Capital-Call-Management/operation/updateCapitalCallEvent
167 168 169 |
# File 'lib/sydecar/capital_call.rb', line 167 def update_spv_capital_call(capital_call_event_id:, body: {}) Connection.instance.patch("#{CAPITAL_CALL_EVENTS_URL}/#{capital_call_event_id}", body) end |