voltaria_sdk 2.34.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rubocop.yml +69 -0
- data/README.md +202 -0
- data/Rakefile +20 -0
- data/custom.gemspec.rb +16 -0
- data/lib/voltaria/accounts/client.rb +168 -0
- data/lib/voltaria/accounts/types/get_client_account_request.rb +12 -0
- data/lib/voltaria/accounts/types/list_client_account_fields_request.rb +11 -0
- data/lib/voltaria/accounts/types/list_client_accounts_request.rb +14 -0
- data/lib/voltaria/accounts/types/partner_client_account_create_request.rb +23 -0
- data/lib/voltaria/accounts/types/partner_client_account_create_request_status.rb +14 -0
- data/lib/voltaria/client.rb +74 -0
- data/lib/voltaria/clients/client.rb +557 -0
- data/lib/voltaria/clients/types/approve_onboarding_request.rb +11 -0
- data/lib/voltaria/clients/types/client_create_payload.rb +16 -0
- data/lib/voltaria/clients/types/client_data_create_payload.rb +12 -0
- data/lib/voltaria/clients/types/client_user_invite_request.rb +16 -0
- data/lib/voltaria/clients/types/delete_client_request.rb +11 -0
- data/lib/voltaria/clients/types/get_client_by_id_request.rb +11 -0
- data/lib/voltaria/clients/types/get_limit_request_request.rb +11 -0
- data/lib/voltaria/clients/types/limit_request_create_payload.rb +14 -0
- data/lib/voltaria/clients/types/limit_request_create_payload_requested_limit.rb +15 -0
- data/lib/voltaria/clients/types/list_client_checklist_summaries_request.rb +13 -0
- data/lib/voltaria/clients/types/list_client_waivers_request.rb +15 -0
- data/lib/voltaria/clients/types/list_clients_request.rb +14 -0
- data/lib/voltaria/clients/types/list_limit_requests_request.rb +15 -0
- data/lib/voltaria/clients/types/list_onboarding_clients_request.rb +12 -0
- data/lib/voltaria/clients/types/reject_onboarding_request.rb +11 -0
- data/lib/voltaria/documents/client.rb +221 -0
- data/lib/voltaria/documents/types/delete_document_request.rb +11 -0
- data/lib/voltaria/documents/types/document_create_payload.rb +14 -0
- data/lib/voltaria/documents/types/get_document_by_id_request.rb +11 -0
- data/lib/voltaria/documents/types/list_documents_request.rb +18 -0
- data/lib/voltaria/drawdowns/client.rb +141 -0
- data/lib/voltaria/drawdowns/types/drawdown_create_payload.rb +12 -0
- data/lib/voltaria/drawdowns/types/drawdown_create_payload_amount.rb +15 -0
- data/lib/voltaria/drawdowns/types/list_drawdown_checklists_request.rb +15 -0
- data/lib/voltaria/drawdowns/types/list_drawdowns_request.rb +14 -0
- data/lib/voltaria/environment.rb +8 -0
- data/lib/voltaria/errors/api_error.rb +8 -0
- data/lib/voltaria/errors/client_error.rb +17 -0
- data/lib/voltaria/errors/redirect_error.rb +8 -0
- data/lib/voltaria/errors/response_error.rb +42 -0
- data/lib/voltaria/errors/server_error.rb +11 -0
- data/lib/voltaria/errors/timeout_error.rb +8 -0
- data/lib/voltaria/installments/client.rb +292 -0
- data/lib/voltaria/installments/types/delete_installment_request.rb +11 -0
- data/lib/voltaria/installments/types/get_installment_by_id_request.rb +11 -0
- data/lib/voltaria/installments/types/installment_create_payload.rb +12 -0
- data/lib/voltaria/installments/types/installment_edit_payload.rb +13 -0
- data/lib/voltaria/installments/types/installment_edit_payload_amount.rb +15 -0
- data/lib/voltaria/installments/types/list_installments_request.rb +16 -0
- data/lib/voltaria/installments/types/list_payment_promises_request.rb +16 -0
- data/lib/voltaria/installments/types/payment_promise_create_payload.rb +14 -0
- data/lib/voltaria/installments/types/payment_promise_create_payload_amount.rb +15 -0
- data/lib/voltaria/internal/errors/constraint_error.rb +10 -0
- data/lib/voltaria/internal/errors/type_error.rb +10 -0
- data/lib/voltaria/internal/http/base_request.rb +51 -0
- data/lib/voltaria/internal/http/raw_client.rb +214 -0
- data/lib/voltaria/internal/iterators/cursor_item_iterator.rb +28 -0
- data/lib/voltaria/internal/iterators/cursor_page_iterator.rb +51 -0
- data/lib/voltaria/internal/iterators/item_iterator.rb +59 -0
- data/lib/voltaria/internal/iterators/offset_item_iterator.rb +30 -0
- data/lib/voltaria/internal/iterators/offset_page_iterator.rb +83 -0
- data/lib/voltaria/internal/json/request.rb +41 -0
- data/lib/voltaria/internal/json/serializable.rb +25 -0
- data/lib/voltaria/internal/multipart/multipart_encoder.rb +141 -0
- data/lib/voltaria/internal/multipart/multipart_form_data.rb +78 -0
- data/lib/voltaria/internal/multipart/multipart_form_data_part.rb +51 -0
- data/lib/voltaria/internal/multipart/multipart_request.rb +40 -0
- data/lib/voltaria/internal/types/array.rb +47 -0
- data/lib/voltaria/internal/types/boolean.rb +34 -0
- data/lib/voltaria/internal/types/enum.rb +56 -0
- data/lib/voltaria/internal/types/hash.rb +36 -0
- data/lib/voltaria/internal/types/model/field.rb +38 -0
- data/lib/voltaria/internal/types/model.rb +208 -0
- data/lib/voltaria/internal/types/type.rb +35 -0
- data/lib/voltaria/internal/types/union.rb +161 -0
- data/lib/voltaria/internal/types/unknown.rb +15 -0
- data/lib/voltaria/internal/types/utils.rb +116 -0
- data/lib/voltaria/investors/client.rb +312 -0
- data/lib/voltaria/investors/types/investor_get_client_request.rb +11 -0
- data/lib/voltaria/investors/types/investor_get_installment_request.rb +11 -0
- data/lib/voltaria/investors/types/investor_get_loan_request.rb +11 -0
- data/lib/voltaria/investors/types/investor_list_clients_request.rb +14 -0
- data/lib/voltaria/investors/types/investor_list_installments_request.rb +16 -0
- data/lib/voltaria/investors/types/investor_list_loans_request.rb +15 -0
- data/lib/voltaria/investors/types/investor_list_repayments_request.rb +17 -0
- data/lib/voltaria/loans/client.rb +271 -0
- data/lib/voltaria/loans/types/bulk_loan_create_payload.rb +11 -0
- data/lib/voltaria/loans/types/delete_loan_request.rb +11 -0
- data/lib/voltaria/loans/types/get_bulk_loan_status_request.rb +11 -0
- data/lib/voltaria/loans/types/get_loan_by_id_request.rb +11 -0
- data/lib/voltaria/loans/types/list_loans_request.rb +15 -0
- data/lib/voltaria/loans/types/loan_create_payload.rb +17 -0
- data/lib/voltaria/loans/types/loan_create_payload_amount.rb +15 -0
- data/lib/voltaria/loans/types/loan_default_payload.rb +13 -0
- data/lib/voltaria/loans/types/loan_default_payload_sold_amount.rb +15 -0
- data/lib/voltaria/partners/client.rb +129 -0
- data/lib/voltaria/partners/types/list_partner_waterfalls_request.rb +14 -0
- data/lib/voltaria/partners/types/partner_data_create_payload.rb +11 -0
- data/lib/voltaria/prefix_routing.rb +80 -0
- data/lib/voltaria/repayments/client.rb +183 -0
- data/lib/voltaria/repayments/types/bulk_repayment_create_payload.rb +11 -0
- data/lib/voltaria/repayments/types/get_bulk_repayment_status_request.rb +11 -0
- data/lib/voltaria/repayments/types/list_repayment_logs_request.rb +17 -0
- data/lib/voltaria/repayments/types/repayment_create_payload.rb +17 -0
- data/lib/voltaria/repayments/types/repayment_create_payload_amount.rb +15 -0
- data/lib/voltaria/sandbox/client.rb +124 -0
- data/lib/voltaria/sandbox/types/client_update_sandbox.rb +13 -0
- data/lib/voltaria/sandbox/types/client_update_sandbox_limit.rb +15 -0
- data/lib/voltaria/sandbox/types/loan_update_sandbox.rb +12 -0
- data/lib/voltaria/sandbox/types/webhook_test_sandbox.rb +12 -0
- data/lib/voltaria/types/account_address.rb +14 -0
- data/lib/voltaria/types/account_holder_type_enum.rb +12 -0
- data/lib/voltaria/types/account_status_enum.rb +13 -0
- data/lib/voltaria/types/available_document_categories_response.rb +9 -0
- data/lib/voltaria/types/available_funding.rb +15 -0
- data/lib/voltaria/types/bulk_loan_item_payload.rb +15 -0
- data/lib/voltaria/types/bulk_loan_item_payload_amount.rb +13 -0
- data/lib/voltaria/types/bulk_loan_item_result.rb +15 -0
- data/lib/voltaria/types/bulk_loan_result.rb +13 -0
- data/lib/voltaria/types/bulk_loan_task_response.rb +11 -0
- data/lib/voltaria/types/bulk_loan_task_status.rb +14 -0
- data/lib/voltaria/types/bulk_repayment_item_payload.rb +15 -0
- data/lib/voltaria/types/bulk_repayment_item_payload_amount.rb +13 -0
- data/lib/voltaria/types/bulk_repayment_item_result.rb +15 -0
- data/lib/voltaria/types/bulk_repayment_result.rb +13 -0
- data/lib/voltaria/types/bulk_repayment_task_response.rb +11 -0
- data/lib/voltaria/types/bulk_repayment_task_status.rb +14 -0
- data/lib/voltaria/types/checklist_summary_partner_response.rb +14 -0
- data/lib/voltaria/types/checklist_type_enum.rb +12 -0
- data/lib/voltaria/types/client_account_response.rb +21 -0
- data/lib/voltaria/types/client_base_info.rb +13 -0
- data/lib/voltaria/types/client_data_response.rb +12 -0
- data/lib/voltaria/types/client_investor_response.rb +17 -0
- data/lib/voltaria/types/client_limit_response.rb +16 -0
- data/lib/voltaria/types/client_response.rb +19 -0
- data/lib/voltaria/types/client_status_enum.rb +18 -0
- data/lib/voltaria/types/client_type_enum.rb +12 -0
- data/lib/voltaria/types/client_user_response.rb +24 -0
- data/lib/voltaria/types/client_user_status_enum.rb +13 -0
- data/lib/voltaria/types/currency_enum.rb +16 -0
- data/lib/voltaria/types/currency_field_spec.rb +10 -0
- data/lib/voltaria/types/document_response.rb +20 -0
- data/lib/voltaria/types/drawdown_checklist_response.rb +16 -0
- data/lib/voltaria/types/drawdown_response.rb +15 -0
- data/lib/voltaria/types/drawdown_status_enum.rb +13 -0
- data/lib/voltaria/types/http_validation_error.rb +9 -0
- data/lib/voltaria/types/installment_response.rb +24 -0
- data/lib/voltaria/types/installment_response_with_client_info.rb +25 -0
- data/lib/voltaria/types/installment_status_enum.rb +19 -0
- data/lib/voltaria/types/jurisdiction_enum.rb +13 -0
- data/lib/voltaria/types/kyc_status_enum.rb +14 -0
- data/lib/voltaria/types/limit_request_response.rb +16 -0
- data/lib/voltaria/types/limit_request_status_enum.rb +13 -0
- data/lib/voltaria/types/loan_installment_create_payload.rb +10 -0
- data/lib/voltaria/types/loan_installment_create_payload_amount.rb +13 -0
- data/lib/voltaria/types/loan_installment_response.rb +15 -0
- data/lib/voltaria/types/loan_investor_response.rb +27 -0
- data/lib/voltaria/types/loan_payment_status_enum.rb +12 -0
- data/lib/voltaria/types/loan_response_with_client_info.rb +26 -0
- data/lib/voltaria/types/loan_response_with_installments.rb +26 -0
- data/lib/voltaria/types/loan_status_enum.rb +21 -0
- data/lib/voltaria/types/paginated_response_checklist_summary_partner_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_client_account_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_client_investor_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_client_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_document_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_drawdown_checklist_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_drawdown_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_installment_response_with_client_info.rb +16 -0
- data/lib/voltaria/types/paginated_response_limit_request_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_loan_investor_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_loan_response_with_client_info.rb +16 -0
- data/lib/voltaria/types/paginated_response_payment_promise_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_repayment_response_with_client_info.rb +16 -0
- data/lib/voltaria/types/paginated_response_waiver_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_waterfall_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_webhook_log_response.rb +16 -0
- data/lib/voltaria/types/paginated_response_webhook_subscription_response.rb +16 -0
- data/lib/voltaria/types/partner_data_response.rb +11 -0
- data/lib/voltaria/types/payment_promise_response.rb +19 -0
- data/lib/voltaria/types/payment_promise_status_enum.rb +14 -0
- data/lib/voltaria/types/repayment_response.rb +21 -0
- data/lib/voltaria/types/repayment_response_with_client_info.rb +22 -0
- data/lib/voltaria/types/role_response.rb +11 -0
- data/lib/voltaria/types/validation_error.rb +13 -0
- data/lib/voltaria/types/validation_error_loc_item.rb +12 -0
- data/lib/voltaria/types/waiver_response.rb +18 -0
- data/lib/voltaria/types/waiver_status_enum.rb +14 -0
- data/lib/voltaria/types/waterfall_response.rb +19 -0
- data/lib/voltaria/types/waterfall_status_enum.rb +12 -0
- data/lib/voltaria/types/webhook_event_type_enum.rb +15 -0
- data/lib/voltaria/types/webhook_log_response.rb +19 -0
- data/lib/voltaria/types/webhook_log_response_request_body.rb +13 -0
- data/lib/voltaria/types/webhook_status_enum.rb +13 -0
- data/lib/voltaria/types/webhook_subscription_response.rb +17 -0
- data/lib/voltaria/version.rb +5 -0
- data/lib/voltaria/webhooks/client.rb +241 -0
- data/lib/voltaria/webhooks/types/delete_webhook_subscription_request.rb +11 -0
- data/lib/voltaria/webhooks/types/get_webhook_subscription_request.rb +11 -0
- data/lib/voltaria/webhooks/types/list_webhook_logs_request.rb +13 -0
- data/lib/voltaria/webhooks/types/list_webhook_subscriptions_request.rb +13 -0
- data/lib/voltaria/webhooks/types/webhook_create_payload.rb +16 -0
- data/lib/voltaria/webhooks/types/webhook_update_payload.rb +17 -0
- data/lib/voltaria.rb +205 -0
- data/reference.md +5135 -0
- metadata +250 -0
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Voltaria
|
|
4
|
+
module Internal
|
|
5
|
+
module Types
|
|
6
|
+
# Define a union between two types
|
|
7
|
+
module Union
|
|
8
|
+
include Voltaria::Internal::Types::Type
|
|
9
|
+
|
|
10
|
+
def members
|
|
11
|
+
@members ||= []
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
# Add a member to this union
|
|
15
|
+
#
|
|
16
|
+
# @param type [Object]
|
|
17
|
+
# @option key [Symbol, String]
|
|
18
|
+
# @return [void]
|
|
19
|
+
def member(type, key: nil)
|
|
20
|
+
members.push([key, Utils.wrap_type(type)])
|
|
21
|
+
self
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def type_member?(type)
|
|
25
|
+
members.any? { |_key, type_fn| type == type_fn.call }
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
# Set the discriminant for this union
|
|
29
|
+
#
|
|
30
|
+
# @param key [Symbol, String]
|
|
31
|
+
# @return [void]
|
|
32
|
+
def discriminant(key)
|
|
33
|
+
@discriminant = key
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# @api private
|
|
37
|
+
private def discriminated?
|
|
38
|
+
!@discriminant.nil?
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Check if value matches a type, handling type wrapper instances
|
|
42
|
+
# (Internal::Types::Hash and Internal::Types::Array instances)
|
|
43
|
+
#
|
|
44
|
+
# @param value [Object]
|
|
45
|
+
# @param member_type [Object]
|
|
46
|
+
# @return [Boolean]
|
|
47
|
+
private def type_matches?(value, member_type)
|
|
48
|
+
case member_type
|
|
49
|
+
when Voltaria::Internal::Types::Hash
|
|
50
|
+
value.is_a?(::Hash)
|
|
51
|
+
when Voltaria::Internal::Types::Array
|
|
52
|
+
value.is_a?(::Array)
|
|
53
|
+
when Class, Module
|
|
54
|
+
value.is_a?(member_type)
|
|
55
|
+
else
|
|
56
|
+
false
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# Resolves the type of a value to be one of the members
|
|
61
|
+
#
|
|
62
|
+
# @param value [Object]
|
|
63
|
+
# @return [Class]
|
|
64
|
+
private def resolve_member(value)
|
|
65
|
+
if discriminated? && value.is_a?(::Hash)
|
|
66
|
+
# Try both symbol and string keys for the discriminant
|
|
67
|
+
discriminant_value = value.fetch(@discriminant, nil) || value.fetch(@discriminant.to_s, nil)
|
|
68
|
+
|
|
69
|
+
return if discriminant_value.nil?
|
|
70
|
+
|
|
71
|
+
# Convert to string for consistent comparison
|
|
72
|
+
discriminant_str = discriminant_value.to_s
|
|
73
|
+
|
|
74
|
+
# First try exact match
|
|
75
|
+
members_hash = members.to_h
|
|
76
|
+
result = members_hash[discriminant_str]&.call
|
|
77
|
+
return result if result
|
|
78
|
+
|
|
79
|
+
# Try case-insensitive match as fallback
|
|
80
|
+
discriminant_lower = discriminant_str.downcase
|
|
81
|
+
matching_keys = members_hash.keys.select { |k| k.to_s.downcase == discriminant_lower }
|
|
82
|
+
|
|
83
|
+
# Only use case-insensitive match if exactly one key matches (avoid ambiguity)
|
|
84
|
+
return members_hash[matching_keys.first]&.call if matching_keys.length == 1
|
|
85
|
+
|
|
86
|
+
nil
|
|
87
|
+
else
|
|
88
|
+
# First try exact type matching
|
|
89
|
+
result = members.find do |_key, mem|
|
|
90
|
+
member_type = Utils.unwrap_type(mem)
|
|
91
|
+
type_matches?(value, member_type)
|
|
92
|
+
end&.last&.call
|
|
93
|
+
|
|
94
|
+
return result if result
|
|
95
|
+
|
|
96
|
+
# For Hash values, try to coerce into Model member types
|
|
97
|
+
if value.is_a?(::Hash)
|
|
98
|
+
members.find do |_key, mem|
|
|
99
|
+
member_type = Utils.unwrap_type(mem)
|
|
100
|
+
# Check if member_type is a Model class
|
|
101
|
+
next unless member_type.is_a?(Class) && member_type <= Model
|
|
102
|
+
|
|
103
|
+
# Try to coerce the hash into this model type with strict mode
|
|
104
|
+
begin
|
|
105
|
+
candidate = Utils.coerce(member_type, value, strict: true)
|
|
106
|
+
|
|
107
|
+
# Validate that all required (non-optional) fields are present
|
|
108
|
+
# This ensures undiscriminated unions properly distinguish between member types
|
|
109
|
+
member_type.fields.each do |field_name, field|
|
|
110
|
+
raise Errors::TypeError, "Required field `#{field_name}` missing for union member #{member_type.name}" if candidate.instance_variable_get(:@data)[field_name].nil? && !field.optional
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
true
|
|
114
|
+
rescue Errors::TypeError
|
|
115
|
+
false
|
|
116
|
+
end
|
|
117
|
+
end&.last&.call
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
def coerce(value, strict: strict?)
|
|
123
|
+
type = resolve_member(value)
|
|
124
|
+
|
|
125
|
+
unless type
|
|
126
|
+
return value unless strict
|
|
127
|
+
|
|
128
|
+
if discriminated?
|
|
129
|
+
raise Errors::TypeError,
|
|
130
|
+
"value of type `#{value.class}` not member of union #{self}"
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
raise Errors::TypeError, "could not resolve to member of union #{self}"
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
coerced = Utils.coerce(type, value, strict: strict)
|
|
137
|
+
|
|
138
|
+
# For discriminated unions, store the discriminant info on the coerced instance
|
|
139
|
+
# so it can be injected back during serialization (to_h)
|
|
140
|
+
if discriminated? && value.is_a?(::Hash) && coerced.is_a?(Model)
|
|
141
|
+
discriminant_value = value.fetch(@discriminant, nil) || value.fetch(@discriminant.to_s, nil)
|
|
142
|
+
if discriminant_value
|
|
143
|
+
coerced.instance_variable_set(:@_fern_union_discriminant_key, @discriminant.to_s)
|
|
144
|
+
coerced.instance_variable_set(:@_fern_union_discriminant_value, discriminant_value)
|
|
145
|
+
end
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
coerced
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# Parse JSON string and coerce to the correct union member type
|
|
152
|
+
#
|
|
153
|
+
# @param str [String] JSON string to parse
|
|
154
|
+
# @return [Object] Coerced value matching a union member
|
|
155
|
+
def load(str)
|
|
156
|
+
coerce(::JSON.parse(str, symbolize_names: true))
|
|
157
|
+
end
|
|
158
|
+
end
|
|
159
|
+
end
|
|
160
|
+
end
|
|
161
|
+
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Voltaria
|
|
4
|
+
module Internal
|
|
5
|
+
module Types
|
|
6
|
+
# Utilities for dealing with and checking types
|
|
7
|
+
module Utils
|
|
8
|
+
# Wraps a type into a type function
|
|
9
|
+
#
|
|
10
|
+
# @param type [Proc, Object]
|
|
11
|
+
# @return [Proc]
|
|
12
|
+
def self.wrap_type(type)
|
|
13
|
+
case type
|
|
14
|
+
when Proc
|
|
15
|
+
type
|
|
16
|
+
else
|
|
17
|
+
-> { type }
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
# Resolves a type or type function into a type
|
|
22
|
+
#
|
|
23
|
+
# @param type [Proc, Object]
|
|
24
|
+
# @return [Object]
|
|
25
|
+
def self.unwrap_type(type)
|
|
26
|
+
type.is_a?(Proc) ? type.call : type
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.coerce(target, value, strict: false)
|
|
30
|
+
type = unwrap_type(target)
|
|
31
|
+
|
|
32
|
+
case type
|
|
33
|
+
in Array
|
|
34
|
+
case value
|
|
35
|
+
when ::Array
|
|
36
|
+
return type.coerce(value, strict: strict)
|
|
37
|
+
when Set, ::Hash
|
|
38
|
+
return coerce(type, value.to_a)
|
|
39
|
+
end
|
|
40
|
+
in Hash
|
|
41
|
+
case value
|
|
42
|
+
when ::Hash
|
|
43
|
+
return type.coerce(value, strict: strict)
|
|
44
|
+
when ::Array
|
|
45
|
+
return coerce(type, value.to_h)
|
|
46
|
+
end
|
|
47
|
+
in ->(t) { t <= NilClass }
|
|
48
|
+
return nil
|
|
49
|
+
in ->(t) { t <= String }
|
|
50
|
+
case value
|
|
51
|
+
when String, Symbol, Numeric, TrueClass, FalseClass
|
|
52
|
+
return value.to_s
|
|
53
|
+
end
|
|
54
|
+
in ->(t) { t <= Symbol }
|
|
55
|
+
case value
|
|
56
|
+
when Symbol, String
|
|
57
|
+
return value.to_sym
|
|
58
|
+
end
|
|
59
|
+
in ->(t) { t <= Integer }
|
|
60
|
+
case value
|
|
61
|
+
when Numeric, String, Time
|
|
62
|
+
return value.to_i
|
|
63
|
+
end
|
|
64
|
+
in ->(t) { t <= Float }
|
|
65
|
+
case value
|
|
66
|
+
when Numeric, Time, String
|
|
67
|
+
return value.to_f
|
|
68
|
+
end
|
|
69
|
+
in ->(t) { t <= Model }
|
|
70
|
+
case value
|
|
71
|
+
when type
|
|
72
|
+
return value
|
|
73
|
+
when ::Hash
|
|
74
|
+
return type.coerce(value, strict: strict)
|
|
75
|
+
end
|
|
76
|
+
in Module
|
|
77
|
+
case type
|
|
78
|
+
in ->(t) {
|
|
79
|
+
t.singleton_class.include?(Enum) ||
|
|
80
|
+
t.singleton_class.include?(Union)
|
|
81
|
+
}
|
|
82
|
+
return type.coerce(value, strict: strict)
|
|
83
|
+
else
|
|
84
|
+
value # rubocop:disable Lint/Void
|
|
85
|
+
end
|
|
86
|
+
else
|
|
87
|
+
value # rubocop:disable Lint/Void
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
raise Errors::TypeError, "cannot coerce value of type `#{value.class}` to `#{target}`" if strict
|
|
91
|
+
|
|
92
|
+
value
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
def self.symbolize_keys(hash)
|
|
96
|
+
hash.transform_keys(&:to_sym)
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Converts camelCase keys to snake_case symbols
|
|
100
|
+
# This allows SDK methods to accept both snake_case and camelCase keys
|
|
101
|
+
# e.g., { refundMethod: ... } becomes { refund_method: ... }
|
|
102
|
+
#
|
|
103
|
+
# @param hash [Hash]
|
|
104
|
+
# @return [Hash]
|
|
105
|
+
def self.normalize_keys(hash)
|
|
106
|
+
hash.transform_keys do |key|
|
|
107
|
+
key_str = key.to_s
|
|
108
|
+
# Convert camelCase to snake_case
|
|
109
|
+
snake_case = key_str.gsub(/([a-z\d])([A-Z])/, '\1_\2').downcase
|
|
110
|
+
snake_case.to_sym
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Voltaria
|
|
4
|
+
module Investors
|
|
5
|
+
class Client
|
|
6
|
+
# @param client [Voltaria::Internal::Http::RawClient]
|
|
7
|
+
#
|
|
8
|
+
# @return [void]
|
|
9
|
+
def initialize(client:)
|
|
10
|
+
@client = client
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
# Retrieve all clients with at least one loan funded by this investor.
|
|
14
|
+
#
|
|
15
|
+
# @param request_options [Hash]
|
|
16
|
+
# @param params [Hash]
|
|
17
|
+
# @option request_options [String] :base_url
|
|
18
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
19
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
20
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
21
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
22
|
+
# @option params [Integer, nil] :page
|
|
23
|
+
# @option params [Integer, nil] :page_size
|
|
24
|
+
# @option params [String, nil] :order_by
|
|
25
|
+
# @option params [String, nil] :q
|
|
26
|
+
#
|
|
27
|
+
# @return [Voltaria::Types::PaginatedResponseClientInvestorResponse]
|
|
28
|
+
def investor_list_clients(request_options: {}, **params)
|
|
29
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
30
|
+
query_param_names = %i[page page_size order_by q]
|
|
31
|
+
query_params = {}
|
|
32
|
+
query_params["page"] = params[:page] if params.key?(:page)
|
|
33
|
+
query_params["page_size"] = params[:page_size] if params.key?(:page_size)
|
|
34
|
+
query_params["order_by"] = params[:order_by] if params.key?(:order_by)
|
|
35
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
36
|
+
params.except(*query_param_names)
|
|
37
|
+
|
|
38
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
39
|
+
base_url: request_options[:base_url],
|
|
40
|
+
method: "GET",
|
|
41
|
+
path: "v2/investors/clients",
|
|
42
|
+
query: query_params,
|
|
43
|
+
request_options: request_options
|
|
44
|
+
)
|
|
45
|
+
begin
|
|
46
|
+
response = @client.send(request)
|
|
47
|
+
rescue Net::HTTPRequestTimeout
|
|
48
|
+
raise Voltaria::Errors::TimeoutError
|
|
49
|
+
end
|
|
50
|
+
code = response.code.to_i
|
|
51
|
+
if code.between?(200, 299)
|
|
52
|
+
Voltaria::Types::PaginatedResponseClientInvestorResponse.load(response.body)
|
|
53
|
+
else
|
|
54
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
55
|
+
raise error_class.new(response.body, code: code)
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Retrieve a specific client that has a loan funded by this investor.
|
|
60
|
+
#
|
|
61
|
+
# @param request_options [Hash]
|
|
62
|
+
# @param params [Hash]
|
|
63
|
+
# @option request_options [String] :base_url
|
|
64
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
65
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
66
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
67
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
68
|
+
# @option params [String] :client_id
|
|
69
|
+
#
|
|
70
|
+
# @return [Voltaria::Types::ClientInvestorResponse]
|
|
71
|
+
def investor_get_client(request_options: {}, **params)
|
|
72
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
73
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
74
|
+
base_url: request_options[:base_url],
|
|
75
|
+
method: "GET",
|
|
76
|
+
path: "v2/investors/clients/#{URI.encode_uri_component(params[:client_id].to_s)}",
|
|
77
|
+
request_options: request_options
|
|
78
|
+
)
|
|
79
|
+
begin
|
|
80
|
+
response = @client.send(request)
|
|
81
|
+
rescue Net::HTTPRequestTimeout
|
|
82
|
+
raise Voltaria::Errors::TimeoutError
|
|
83
|
+
end
|
|
84
|
+
code = response.code.to_i
|
|
85
|
+
if code.between?(200, 299)
|
|
86
|
+
Voltaria::Types::ClientInvestorResponse.load(response.body)
|
|
87
|
+
else
|
|
88
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
89
|
+
raise error_class.new(response.body, code: code)
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Retrieve all loans funded by the current investor.
|
|
94
|
+
#
|
|
95
|
+
# @param request_options [Hash]
|
|
96
|
+
# @param params [Hash]
|
|
97
|
+
# @option request_options [String] :base_url
|
|
98
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
99
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
100
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
101
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
102
|
+
# @option params [Integer, nil] :page
|
|
103
|
+
# @option params [Integer, nil] :page_size
|
|
104
|
+
# @option params [String, nil] :client_id
|
|
105
|
+
# @option params [String, nil] :order_by
|
|
106
|
+
# @option params [String, nil] :q
|
|
107
|
+
#
|
|
108
|
+
# @return [Voltaria::Types::PaginatedResponseLoanInvestorResponse]
|
|
109
|
+
def investor_list_loans(request_options: {}, **params)
|
|
110
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
111
|
+
query_param_names = %i[page page_size client_id order_by q]
|
|
112
|
+
query_params = {}
|
|
113
|
+
query_params["page"] = params[:page] if params.key?(:page)
|
|
114
|
+
query_params["page_size"] = params[:page_size] if params.key?(:page_size)
|
|
115
|
+
query_params["client_id"] = params[:client_id] if params.key?(:client_id)
|
|
116
|
+
query_params["order_by"] = params[:order_by] if params.key?(:order_by)
|
|
117
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
118
|
+
params.except(*query_param_names)
|
|
119
|
+
|
|
120
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
121
|
+
base_url: request_options[:base_url],
|
|
122
|
+
method: "GET",
|
|
123
|
+
path: "v2/investors/loans",
|
|
124
|
+
query: query_params,
|
|
125
|
+
request_options: request_options
|
|
126
|
+
)
|
|
127
|
+
begin
|
|
128
|
+
response = @client.send(request)
|
|
129
|
+
rescue Net::HTTPRequestTimeout
|
|
130
|
+
raise Voltaria::Errors::TimeoutError
|
|
131
|
+
end
|
|
132
|
+
code = response.code.to_i
|
|
133
|
+
if code.between?(200, 299)
|
|
134
|
+
Voltaria::Types::PaginatedResponseLoanInvestorResponse.load(response.body)
|
|
135
|
+
else
|
|
136
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
137
|
+
raise error_class.new(response.body, code: code)
|
|
138
|
+
end
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Retrieve a specific loan funded by the current investor, with its installments.
|
|
142
|
+
#
|
|
143
|
+
# @param request_options [Hash]
|
|
144
|
+
# @param params [Hash]
|
|
145
|
+
# @option request_options [String] :base_url
|
|
146
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
147
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
148
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
149
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
150
|
+
# @option params [String] :loan_id
|
|
151
|
+
#
|
|
152
|
+
# @return [Voltaria::Types::LoanResponseWithInstallments]
|
|
153
|
+
def investor_get_loan(request_options: {}, **params)
|
|
154
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
155
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
156
|
+
base_url: request_options[:base_url],
|
|
157
|
+
method: "GET",
|
|
158
|
+
path: "v2/investors/loans/#{URI.encode_uri_component(params[:loan_id].to_s)}",
|
|
159
|
+
request_options: request_options
|
|
160
|
+
)
|
|
161
|
+
begin
|
|
162
|
+
response = @client.send(request)
|
|
163
|
+
rescue Net::HTTPRequestTimeout
|
|
164
|
+
raise Voltaria::Errors::TimeoutError
|
|
165
|
+
end
|
|
166
|
+
code = response.code.to_i
|
|
167
|
+
if code.between?(200, 299)
|
|
168
|
+
Voltaria::Types::LoanResponseWithInstallments.load(response.body)
|
|
169
|
+
else
|
|
170
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
171
|
+
raise error_class.new(response.body, code: code)
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Retrieve all installments for loans funded by the current investor.
|
|
176
|
+
#
|
|
177
|
+
# @param request_options [Hash]
|
|
178
|
+
# @param params [Hash]
|
|
179
|
+
# @option request_options [String] :base_url
|
|
180
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
181
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
182
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
183
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
184
|
+
# @option params [Integer, nil] :page
|
|
185
|
+
# @option params [Integer, nil] :page_size
|
|
186
|
+
# @option params [String, nil] :client_id
|
|
187
|
+
# @option params [String, nil] :loan_id
|
|
188
|
+
# @option params [String, nil] :order_by
|
|
189
|
+
# @option params [String, nil] :q
|
|
190
|
+
#
|
|
191
|
+
# @return [Voltaria::Types::PaginatedResponseInstallmentResponseWithClientInfo]
|
|
192
|
+
def investor_list_installments(request_options: {}, **params)
|
|
193
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
194
|
+
query_param_names = %i[page page_size client_id loan_id order_by q]
|
|
195
|
+
query_params = {}
|
|
196
|
+
query_params["page"] = params[:page] if params.key?(:page)
|
|
197
|
+
query_params["page_size"] = params[:page_size] if params.key?(:page_size)
|
|
198
|
+
query_params["client_id"] = params[:client_id] if params.key?(:client_id)
|
|
199
|
+
query_params["loan_id"] = params[:loan_id] if params.key?(:loan_id)
|
|
200
|
+
query_params["order_by"] = params[:order_by] if params.key?(:order_by)
|
|
201
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
202
|
+
params.except(*query_param_names)
|
|
203
|
+
|
|
204
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
205
|
+
base_url: request_options[:base_url],
|
|
206
|
+
method: "GET",
|
|
207
|
+
path: "v2/investors/installments",
|
|
208
|
+
query: query_params,
|
|
209
|
+
request_options: request_options
|
|
210
|
+
)
|
|
211
|
+
begin
|
|
212
|
+
response = @client.send(request)
|
|
213
|
+
rescue Net::HTTPRequestTimeout
|
|
214
|
+
raise Voltaria::Errors::TimeoutError
|
|
215
|
+
end
|
|
216
|
+
code = response.code.to_i
|
|
217
|
+
if code.between?(200, 299)
|
|
218
|
+
Voltaria::Types::PaginatedResponseInstallmentResponseWithClientInfo.load(response.body)
|
|
219
|
+
else
|
|
220
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
221
|
+
raise error_class.new(response.body, code: code)
|
|
222
|
+
end
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Retrieve a specific installment for a loan funded by the current investor.
|
|
226
|
+
#
|
|
227
|
+
# @param request_options [Hash]
|
|
228
|
+
# @param params [Hash]
|
|
229
|
+
# @option request_options [String] :base_url
|
|
230
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
231
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
232
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
233
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
234
|
+
# @option params [String] :installment_id
|
|
235
|
+
#
|
|
236
|
+
# @return [Voltaria::Types::InstallmentResponse]
|
|
237
|
+
def investor_get_installment(request_options: {}, **params)
|
|
238
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
239
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
240
|
+
base_url: request_options[:base_url],
|
|
241
|
+
method: "GET",
|
|
242
|
+
path: "v2/investors/installments/#{URI.encode_uri_component(params[:installment_id].to_s)}",
|
|
243
|
+
request_options: request_options
|
|
244
|
+
)
|
|
245
|
+
begin
|
|
246
|
+
response = @client.send(request)
|
|
247
|
+
rescue Net::HTTPRequestTimeout
|
|
248
|
+
raise Voltaria::Errors::TimeoutError
|
|
249
|
+
end
|
|
250
|
+
code = response.code.to_i
|
|
251
|
+
if code.between?(200, 299)
|
|
252
|
+
Voltaria::Types::InstallmentResponse.load(response.body)
|
|
253
|
+
else
|
|
254
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
255
|
+
raise error_class.new(response.body, code: code)
|
|
256
|
+
end
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
# Retrieve all repayment logs for loans funded by the current investor.
|
|
260
|
+
#
|
|
261
|
+
# @param request_options [Hash]
|
|
262
|
+
# @param params [Hash]
|
|
263
|
+
# @option request_options [String] :base_url
|
|
264
|
+
# @option request_options [Hash{String => Object}] :additional_headers
|
|
265
|
+
# @option request_options [Hash{String => Object}] :additional_query_parameters
|
|
266
|
+
# @option request_options [Hash{String => Object}] :additional_body_parameters
|
|
267
|
+
# @option request_options [Integer] :timeout_in_seconds
|
|
268
|
+
# @option params [String, nil] :client_id
|
|
269
|
+
# @option params [String, nil] :loan_id
|
|
270
|
+
# @option params [String, nil] :installment_id
|
|
271
|
+
# @option params [Integer, nil] :page
|
|
272
|
+
# @option params [Integer, nil] :page_size
|
|
273
|
+
# @option params [String, nil] :order_by
|
|
274
|
+
# @option params [String, nil] :q
|
|
275
|
+
#
|
|
276
|
+
# @return [Voltaria::Types::PaginatedResponseRepaymentResponseWithClientInfo]
|
|
277
|
+
def investor_list_repayments(request_options: {}, **params)
|
|
278
|
+
params = Voltaria::Internal::Types::Utils.normalize_keys(params)
|
|
279
|
+
query_param_names = %i[client_id loan_id installment_id page page_size order_by q]
|
|
280
|
+
query_params = {}
|
|
281
|
+
query_params["client_id"] = params[:client_id] if params.key?(:client_id)
|
|
282
|
+
query_params["loan_id"] = params[:loan_id] if params.key?(:loan_id)
|
|
283
|
+
query_params["installment_id"] = params[:installment_id] if params.key?(:installment_id)
|
|
284
|
+
query_params["page"] = params[:page] if params.key?(:page)
|
|
285
|
+
query_params["page_size"] = params[:page_size] if params.key?(:page_size)
|
|
286
|
+
query_params["order_by"] = params[:order_by] if params.key?(:order_by)
|
|
287
|
+
query_params["q"] = params[:q] if params.key?(:q)
|
|
288
|
+
params.except(*query_param_names)
|
|
289
|
+
|
|
290
|
+
request = Voltaria::Internal::JSON::Request.new(
|
|
291
|
+
base_url: request_options[:base_url],
|
|
292
|
+
method: "GET",
|
|
293
|
+
path: "v2/investors/repayments",
|
|
294
|
+
query: query_params,
|
|
295
|
+
request_options: request_options
|
|
296
|
+
)
|
|
297
|
+
begin
|
|
298
|
+
response = @client.send(request)
|
|
299
|
+
rescue Net::HTTPRequestTimeout
|
|
300
|
+
raise Voltaria::Errors::TimeoutError
|
|
301
|
+
end
|
|
302
|
+
code = response.code.to_i
|
|
303
|
+
if code.between?(200, 299)
|
|
304
|
+
Voltaria::Types::PaginatedResponseRepaymentResponseWithClientInfo.load(response.body)
|
|
305
|
+
else
|
|
306
|
+
error_class = Voltaria::Errors::ResponseError.subclass_for_code(code)
|
|
307
|
+
raise error_class.new(response.body, code: code)
|
|
308
|
+
end
|
|
309
|
+
end
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Voltaria
|
|
4
|
+
module Investors
|
|
5
|
+
module Types
|
|
6
|
+
class InvestorListClientsRequest < Internal::Types::Model
|
|
7
|
+
field :page, -> { Integer }, optional: true, nullable: false
|
|
8
|
+
field :page_size, -> { Integer }, optional: true, nullable: false
|
|
9
|
+
field :order_by, -> { String }, optional: true, nullable: false
|
|
10
|
+
field :q, -> { String }, optional: true, nullable: false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Voltaria
|
|
4
|
+
module Investors
|
|
5
|
+
module Types
|
|
6
|
+
class InvestorListInstallmentsRequest < Internal::Types::Model
|
|
7
|
+
field :page, -> { Integer }, optional: true, nullable: false
|
|
8
|
+
field :page_size, -> { Integer }, optional: true, nullable: false
|
|
9
|
+
field :client_id, -> { String }, optional: true, nullable: false
|
|
10
|
+
field :loan_id, -> { String }, optional: true, nullable: false
|
|
11
|
+
field :order_by, -> { String }, optional: true, nullable: false
|
|
12
|
+
field :q, -> { String }, optional: true, nullable: false
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Voltaria
|
|
4
|
+
module Investors
|
|
5
|
+
module Types
|
|
6
|
+
class InvestorListLoansRequest < Internal::Types::Model
|
|
7
|
+
field :page, -> { Integer }, optional: true, nullable: false
|
|
8
|
+
field :page_size, -> { Integer }, optional: true, nullable: false
|
|
9
|
+
field :client_id, -> { String }, optional: true, nullable: false
|
|
10
|
+
field :order_by, -> { String }, optional: true, nullable: false
|
|
11
|
+
field :q, -> { String }, optional: true, nullable: false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|