Class: Sydecar::Spv
- Inherits:
-
Object
- Object
- Sydecar::Spv
- Defined in:
- lib/sydecar/spv.rb
Constant Summary collapse
- URL =
'/v1/spvs'
- CREATE_URL =
"#{URL}/create"
Class Method Summary collapse
- .adjust_disbursements(id:, body:) ⇒ Object
- .adjust_disbursements_url(id:) ⇒ Object
- .adjust_fund_deal_investments(id:) ⇒ Object
- .adjust_fund_deal_investments_url(id:) ⇒ Object
- .counter_sign_close(id:, idempotency_key:) ⇒ Object
- .counter_sign_close_url(id:) ⇒ Object
- .create(body:, idempotency_key:) ⇒ Object
- .disburse_close(id:, idempotency_key:) ⇒ Object
- .disburse_close_url(id:) ⇒ Object
- .disbursements(id:) ⇒ Object
- .disbursements_url(id:) ⇒ Object
- .find(id:, bank_accounts: false, capital_call_events: false, dates: false, docset: false, documents: false, expenses: false, profile: false, subscriptions: false) ⇒ 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).
- .initiate_close(id:, idempotency_key:) ⇒ Object
- .initiate_close_url(id:) ⇒ Object
- .request_approval(id:, body:) ⇒ Object
- .request_approval_url(id:) ⇒ Object
- .request_bank_account(id:, idempotency_key:) ⇒ Object
- .request_bank_account_url(id:) ⇒ Object
- .update(id:, body:) ⇒ Object
Class Method Details
.adjust_disbursements(id:, body:) ⇒ Object
127 128 129 130 |
# File 'lib/sydecar/spv.rb', line 127 def adjust_disbursements(id:, body:) url = adjust_disbursements_url(id: id) Connection.instance.post(url, body) end |
.adjust_disbursements_url(id:) ⇒ Object
123 124 125 |
# File 'lib/sydecar/spv.rb', line 123 def adjust_disbursements_url(id:) "/v1/spvs/#{id}/adjust_disbursements" end |
.adjust_fund_deal_investments(id:) ⇒ Object
136 137 138 139 |
# File 'lib/sydecar/spv.rb', line 136 def adjust_fund_deal_investments(id:) url = adjust_fund_deal_investments_url(id: id) Connection.instance.post(url) end |
.adjust_fund_deal_investments_url(id:) ⇒ Object
132 133 134 |
# File 'lib/sydecar/spv.rb', line 132 def adjust_fund_deal_investments_url(id:) "/v1/spvs/#{id}/adjust_fund_deal_investments" end |
.counter_sign_close(id:, idempotency_key:) ⇒ Object
91 92 93 94 |
# File 'lib/sydecar/spv.rb', line 91 def counter_sign_close(id:, idempotency_key:) url = counter_sign_close_url(id: id) Connection.instance.post(url, nil, { 'idempotency-key': idempotency_key }) end |
.counter_sign_close_url(id:) ⇒ Object
87 88 89 |
# File 'lib/sydecar/spv.rb', line 87 def counter_sign_close_url(id:) "/v1/spvs/#{id}/close/counter_sign" end |
.create(body:, idempotency_key:) ⇒ Object
9 10 11 |
# File 'lib/sydecar/spv.rb', line 9 def create(body:, idempotency_key:) Connection.instance.post(CREATE_URL, body, { 'idempotency-key': idempotency_key }) end |
.disburse_close(id:, idempotency_key:) ⇒ Object
82 83 84 85 |
# File 'lib/sydecar/spv.rb', line 82 def disburse_close(id:, idempotency_key:) url = disburse_close_url(id: id) Connection.instance.post(url, nil, { 'idempotency-key': idempotency_key }) end |
.disburse_close_url(id:) ⇒ Object
78 79 80 |
# File 'lib/sydecar/spv.rb', line 78 def disburse_close_url(id:) "/v1/spvs/#{id}/close/disburse" end |
.disbursements(id:) ⇒ Object
118 119 120 121 |
# File 'lib/sydecar/spv.rb', line 118 def disbursements(id:) url = disbursements_url(id: id) Connection.instance.get(url) end |
.disbursements_url(id:) ⇒ Object
114 115 116 |
# File 'lib/sydecar/spv.rb', line 114 def disbursements_url(id:) "/v1/spvs/#{id}/disbursements" end |
.find(id:, bank_accounts: false, capital_call_events: false, dates: false, docset: false, documents: false, expenses: false, profile: false, subscriptions: false) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/sydecar/spv.rb', line 22 def find( id:, bank_accounts: false, capital_call_events: false, dates: false, docset: false, documents: false, expenses: false, profile: false, subscriptions: false ) query = compile_find_params( bank_accounts: bank_accounts, capital_call_events: capital_call_events, dates: dates, docset: docset, documents: documents, expenses: expenses, profile: profile, subscriptions: subscriptions ) Connection.instance.get("#{URL}/#{id}", query) 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)
60 61 62 63 64 |
# File 'lib/sydecar/spv.rb', line 60 def find_all(params: {}, body: {}) query = '?' query += URI.encode_www_form(params) Connection.instance.post("#{URL}#{query}", body) end |
.initiate_close(id:, idempotency_key:) ⇒ Object
73 74 75 76 |
# File 'lib/sydecar/spv.rb', line 73 def initiate_close(id:, idempotency_key:) url = initiate_close_url(id: id) Connection.instance.post(url, nil, { 'idempotency-key': idempotency_key }) end |
.initiate_close_url(id:) ⇒ Object
67 68 69 |
# File 'lib/sydecar/spv.rb', line 67 def initiate_close_url(id:) "/v1/spvs/#{id}/close/initiate" end |
.request_approval(id:, body:) ⇒ Object
100 101 102 103 |
# File 'lib/sydecar/spv.rb', line 100 def request_approval(id:, body:) url = request_approval_url(id: id) Connection.instance.post(url, body) end |
.request_approval_url(id:) ⇒ Object
96 97 98 |
# File 'lib/sydecar/spv.rb', line 96 def request_approval_url(id:) "/v1/spvs/#{id}/request_approval" end |
.request_bank_account(id:, idempotency_key:) ⇒ Object
109 110 111 112 |
# File 'lib/sydecar/spv.rb', line 109 def request_bank_account(id:, idempotency_key:) url = request_bank_account_url(id: id) Connection.instance.post(url, nil, { 'idempotency-key': idempotency_key }) end |
.request_bank_account_url(id:) ⇒ Object
105 106 107 |
# File 'lib/sydecar/spv.rb', line 105 def request_bank_account_url(id:) "/v1/spvs/#{:id}/request_bank_account" end |
.update(id:, body:) ⇒ Object
49 50 51 |
# File 'lib/sydecar/spv.rb', line 49 def update(id:, body:) Connection.instance.patch("#{URL}/#{id}", body) end |