unit_ruby_sdk 1.4.1 → 2.0.0
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 +4 -4
- data/.rubocop.yml +3 -0
- data/README.md +113 -93
- data/lib/unit/api_resources/cash_deposit_resource.rb +47 -0
- data/lib/unit/api_resources/check_payment_resource.rb +17 -0
- data/lib/unit/api_resources/stop_payment_resource.rb +48 -0
- data/lib/unit/api_resources/tax_form_resource.rb +39 -0
- data/lib/unit/models/application/application.rb +5 -38
- data/lib/unit/models/application/create_business_application_request.rb +3 -3
- data/lib/unit/models/application/create_sole_proprietor_application_request.rb +5 -18
- data/lib/unit/models/cash_deposit/cash_deposit.rb +53 -0
- data/lib/unit/models/cash_deposit/generate_barcode_request.rb +37 -0
- data/lib/unit/models/cash_deposit/list_by_coordinates_params.rb +33 -0
- data/lib/unit/models/cash_deposit/list_by_postal_code_params.rb +33 -0
- data/lib/unit/models/check_deposit/create_check_deposit_request.rb +1 -1
- data/lib/unit/models/check_payment/check_payment.rb +25 -0
- data/lib/unit/models/check_payment/originate_check_payment_request.rb +57 -0
- data/lib/unit/models/customer/patch_business_customer_request.rb +1 -1
- data/lib/unit/models/customer/patch_individual_customer_request.rb +1 -1
- data/lib/unit/models/payment/payment.rb +2 -1
- data/lib/unit/models/recurring_payment/create_recurring_credit_book_payment_request.rb +1 -1
- data/lib/unit/models/stop_payment/create_stop_payment_request.rb +43 -0
- data/lib/unit/models/stop_payment/list_stop_payment_params.rb +63 -0
- data/lib/unit/models/stop_payment/stop_payment.rb +61 -0
- data/lib/unit/models/tax_form/list_tax_form_params.rb +37 -0
- data/lib/unit/models/tax_form/tax_form.rb +39 -0
- data/lib/unit/models/webhook/patch_webhook_request.rb +3 -3
- data/lib/unit/models/webhook/webhook.rb +6 -6
- data/lib/unit/types/check_payment_counterparty.rb +28 -0
- data/lib/unit/version.rb +1 -1
- data/lib/unit_ruby_sdk.rb +7 -7
- data/tax_form_1.pdf +0 -0
- metadata +17 -8
- data/lib/unit/models/application/create_trust_application_request.rb +0 -67
- data/lib/unit/models/application/patch_trust_application_request.rb +0 -31
- data/lib/unit/types/beneficiary.rb +0 -25
- data/lib/unit/types/grantor.rb +0 -37
- data/lib/unit/types/trust_contact.rb +0 -34
- data/lib/unit/types/trustee.rb +0 -37
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# @see https://docs.unit.co/types#check-payment-counterparty
|
4
|
+
module Unit
|
5
|
+
module Types
|
6
|
+
class CheckPaymentCounterparty
|
7
|
+
attr_reader :name, :address, :counterparty_moved
|
8
|
+
|
9
|
+
# @param name [String]
|
10
|
+
# @param address [Address]
|
11
|
+
# @param counterparty_moved [Boolean]
|
12
|
+
def initialize(name, address, counterparty_moved = nil)
|
13
|
+
@name = name
|
14
|
+
@address = address
|
15
|
+
@counterparty_moved = counterparty_moved
|
16
|
+
end
|
17
|
+
|
18
|
+
def represent
|
19
|
+
params = {
|
20
|
+
name: name,
|
21
|
+
address: address&.represent,
|
22
|
+
counterpartyMoved: counterparty_moved
|
23
|
+
}
|
24
|
+
params.compact
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/lib/unit/version.rb
CHANGED
data/lib/unit_ruby_sdk.rb
CHANGED
@@ -11,13 +11,13 @@ module Unit
|
|
11
11
|
autoload :Payment, "unit/models/payment/payment"
|
12
12
|
autoload :ReceivedPayment, "unit/models/received_payment/received_payment"
|
13
13
|
autoload :CheckPayment, "unit/models/check_payment/check_payment"
|
14
|
+
autoload :StopPayment, "unit/models/stop_payment/stop_payment"
|
14
15
|
autoload :Transaction, "unit/models/transaction/transaction"
|
15
16
|
autoload :Card, "unit/models/card/card"
|
16
17
|
autoload :Statement, "unit/models/statement/statement"
|
17
18
|
autoload :AtmLocation, "unit/models/atm_location/atm_location"
|
18
19
|
autoload :CheckDeposit, "unit/models/check_deposit/check_deposit"
|
19
20
|
autoload :Counterparty, "unit/models/counterparty/counterparty"
|
20
|
-
autoload :RecurringPayment, "unit/models/recurring_payment/recurring_payment"
|
21
21
|
autoload :Institution, "unit/models/institution/institution"
|
22
22
|
autoload :Repayment, "unit/models/repayment/repayment"
|
23
23
|
autoload :Event, "unit/models/event/event"
|
@@ -27,6 +27,8 @@ module Unit
|
|
27
27
|
autoload :Authorization, "unit/models/authorization/authorization"
|
28
28
|
autoload :AuthorizationRequest, "unit/models/authorization_request/authorization_request"
|
29
29
|
autoload :RecurringPayment, "unit/models/recurring_payment/recurring_payment"
|
30
|
+
autoload :TaxForm, "unit/models/tax_form/tax_form"
|
31
|
+
autoload :CashDeposit, "unit/models/cash_deposit/cash_deposit"
|
30
32
|
|
31
33
|
module Resource
|
32
34
|
autoload :ApplicationResource, "unit/api_resources/application_resource"
|
@@ -35,6 +37,7 @@ module Unit
|
|
35
37
|
autoload :AccountResource, "unit/api_resources/account_resource"
|
36
38
|
autoload :ApiTokenResource, "unit/api_resources/api_token_resource"
|
37
39
|
autoload :PaymentResource, "unit/api_resources/payment_resource"
|
40
|
+
autoload :StopPaymentResource, "unit/api_resources/stop_payment_resource"
|
38
41
|
autoload :ReceivedPaymentResource, "unit/api_resources/received_payment_resource"
|
39
42
|
autoload :CheckPaymentResource, "unit/api_resources/check_payment_resource"
|
40
43
|
autoload :TransactionResource, "unit/api_resources/transaction_resource"
|
@@ -43,7 +46,6 @@ module Unit
|
|
43
46
|
autoload :AtmLocationResource, "unit/api_resources/atm_location_resource"
|
44
47
|
autoload :CheckDepositResource, "unit/api_resources/check_deposit_resource"
|
45
48
|
autoload :CounterpartyResource, "unit/api_resources/counterparty_resource"
|
46
|
-
autoload :RecurringPaymentResource, "unit/api_resources/recurring_payment_resource"
|
47
49
|
autoload :InstitutionResource, "unit/api_resources/institution_resource"
|
48
50
|
autoload :RepaymentResource, "unit/api_resources/repayment_resource"
|
49
51
|
autoload :EventResource, "unit/api_resources/event_resource"
|
@@ -53,6 +55,8 @@ module Unit
|
|
53
55
|
autoload :AuthorizationResource, "unit/api_resources/authorization_resource"
|
54
56
|
autoload :AuthorizationRequestResource, "unit/api_resources/authorization_request_resource"
|
55
57
|
autoload :RecurringPaymentResource, "unit/api_resources/recurring_payment_resource"
|
58
|
+
autoload :TaxFormResource, "unit/api_resources/tax_form_resource"
|
59
|
+
autoload :CashDepositResource, "unit/api_resources/cash_deposit_resource"
|
56
60
|
end
|
57
61
|
|
58
62
|
module Types
|
@@ -64,6 +68,7 @@ module Unit
|
|
64
68
|
autoload :EvaluationParams, "unit/types/evaluation_params"
|
65
69
|
autoload :Counterparty, "unit/types/counterparty"
|
66
70
|
autoload :WireCounterparty, "unit/types/wire_counterparty"
|
71
|
+
autoload :CheckPaymentCounterparty, "unit/types/check_payment_counterparty"
|
67
72
|
autoload :FullName, "unit/types/full_name"
|
68
73
|
autoload :Officer, "unit/types/officer"
|
69
74
|
autoload :Phone, "unit/types/phone"
|
@@ -74,11 +79,6 @@ module Unit
|
|
74
79
|
autoload :DocumentFileType, "unit/types/document_file_type"
|
75
80
|
autoload :Coordinates, "unit/types/coordinates"
|
76
81
|
autoload :CreateSchedule, "unit/types/create_schedule"
|
77
|
-
autoload :TrustContact, "unit/types/trust_contact"
|
78
|
-
autoload :Trustee, "unit/types/trustee"
|
79
|
-
autoload :Grantor, "unit/types/grantor"
|
80
|
-
autoload :Beneficiary, "unit/types/beneficiary"
|
81
|
-
autoload :CreateSchedule, "unit/types/create_schedule"
|
82
82
|
autoload :ApplicationFormSettingsOverride, "unit/types/application_form_settings_override"
|
83
83
|
autoload :ApplicationFormPrefill, "unit/types/application_form_prefill"
|
84
84
|
autoload :RequireIdVerification, "unit/types/require_id_verification"
|
data/tax_form_1.pdf
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unit_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unit
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: factory_bot_rails
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/unit/api_resources/authorization_resource.rb
|
104
104
|
- lib/unit/api_resources/base_resource.rb
|
105
105
|
- lib/unit/api_resources/card_resource.rb
|
106
|
+
- lib/unit/api_resources/cash_deposit_resource.rb
|
106
107
|
- lib/unit/api_resources/check_deposit_resource.rb
|
107
108
|
- lib/unit/api_resources/check_payment_resource.rb
|
108
109
|
- lib/unit/api_resources/counterparty_resource.rb
|
@@ -116,6 +117,8 @@ files:
|
|
116
117
|
- lib/unit/api_resources/repayment_resource.rb
|
117
118
|
- lib/unit/api_resources/reward_resource.rb
|
118
119
|
- lib/unit/api_resources/statement_resource.rb
|
120
|
+
- lib/unit/api_resources/stop_payment_resource.rb
|
121
|
+
- lib/unit/api_resources/tax_form_resource.rb
|
119
122
|
- lib/unit/api_resources/transaction_resource.rb
|
120
123
|
- lib/unit/api_resources/webhook_resource.rb
|
121
124
|
- lib/unit/errors/unit_error.rb
|
@@ -143,10 +146,8 @@ files:
|
|
143
146
|
- lib/unit/models/application/create_business_application_request.rb
|
144
147
|
- lib/unit/models/application/create_individual_application_request.rb
|
145
148
|
- lib/unit/models/application/create_sole_proprietor_application_request.rb
|
146
|
-
- lib/unit/models/application/create_trust_application_request.rb
|
147
149
|
- lib/unit/models/application/list_application_params.rb
|
148
150
|
- lib/unit/models/application/patch_application_request.rb
|
149
|
-
- lib/unit/models/application/patch_trust_application_request.rb
|
150
151
|
- lib/unit/models/application/upload_document_request.rb
|
151
152
|
- lib/unit/models/application_form/application_form.rb
|
152
153
|
- lib/unit/models/application_form/create_application_form_request.rb
|
@@ -175,6 +176,10 @@ files:
|
|
175
176
|
- lib/unit/models/card/patch_business_virtual_card_request.rb
|
176
177
|
- lib/unit/models/card/patch_business_virtual_credit_card_request.rb
|
177
178
|
- lib/unit/models/card/replace_card_request.rb
|
179
|
+
- lib/unit/models/cash_deposit/cash_deposit.rb
|
180
|
+
- lib/unit/models/cash_deposit/generate_barcode_request.rb
|
181
|
+
- lib/unit/models/cash_deposit/list_by_coordinates_params.rb
|
182
|
+
- lib/unit/models/cash_deposit/list_by_postal_code_params.rb
|
178
183
|
- lib/unit/models/check_deposit/check_deposit.rb
|
179
184
|
- lib/unit/models/check_deposit/create_check_deposit_request.rb
|
180
185
|
- lib/unit/models/check_deposit/get_image_request.rb
|
@@ -186,6 +191,7 @@ files:
|
|
186
191
|
- lib/unit/models/check_payment/get_image_request.rb
|
187
192
|
- lib/unit/models/check_payment/get_request.rb
|
188
193
|
- lib/unit/models/check_payment/list_check_payment_params.rb
|
194
|
+
- lib/unit/models/check_payment/originate_check_payment_request.rb
|
189
195
|
- lib/unit/models/check_payment/return_check_payment_request.rb
|
190
196
|
- lib/unit/models/counterparty/counterparty.rb
|
191
197
|
- lib/unit/models/counterparty/create_counterparty_request.rb
|
@@ -239,6 +245,11 @@ files:
|
|
239
245
|
- lib/unit/models/statement/get_pdf_by_id_request.rb
|
240
246
|
- lib/unit/models/statement/list_statement_params.rb
|
241
247
|
- lib/unit/models/statement/statement.rb
|
248
|
+
- lib/unit/models/stop_payment/create_stop_payment_request.rb
|
249
|
+
- lib/unit/models/stop_payment/list_stop_payment_params.rb
|
250
|
+
- lib/unit/models/stop_payment/stop_payment.rb
|
251
|
+
- lib/unit/models/tax_form/list_tax_form_params.rb
|
252
|
+
- lib/unit/models/tax_form/tax_form.rb
|
242
253
|
- lib/unit/models/transaction/get_transaction_params.rb
|
243
254
|
- lib/unit/models/transaction/list_transaction_params.rb
|
244
255
|
- lib/unit/models/transaction/patch_book_transaction_request.rb
|
@@ -256,8 +267,8 @@ files:
|
|
256
267
|
- lib/unit/types/application_form_settings_override.rb
|
257
268
|
- lib/unit/types/authorized_user.rb
|
258
269
|
- lib/unit/types/beneficial_owner.rb
|
259
|
-
- lib/unit/types/beneficiary.rb
|
260
270
|
- lib/unit/types/business_contact.rb
|
271
|
+
- lib/unit/types/check_payment_counterparty.rb
|
261
272
|
- lib/unit/types/coordinates.rb
|
262
273
|
- lib/unit/types/counterparty.rb
|
263
274
|
- lib/unit/types/create_schedule.rb
|
@@ -265,7 +276,6 @@ files:
|
|
265
276
|
- lib/unit/types/document_file_type.rb
|
266
277
|
- lib/unit/types/evaluation_params.rb
|
267
278
|
- lib/unit/types/full_name.rb
|
268
|
-
- lib/unit/types/grantor.rb
|
269
279
|
- lib/unit/types/officer.rb
|
270
280
|
- lib/unit/types/phone.rb
|
271
281
|
- lib/unit/types/power_of_attorney_agent.rb
|
@@ -273,12 +283,11 @@ files:
|
|
273
283
|
- lib/unit/types/relationship_array.rb
|
274
284
|
- lib/unit/types/require_id_verification.rb
|
275
285
|
- lib/unit/types/restricted_resource.rb
|
276
|
-
- lib/unit/types/trust_contact.rb
|
277
|
-
- lib/unit/types/trustee.rb
|
278
286
|
- lib/unit/types/wire_counterparty.rb
|
279
287
|
- lib/unit/utils/http_helper.rb
|
280
288
|
- lib/unit/version.rb
|
281
289
|
- lib/unit_ruby_sdk.rb
|
290
|
+
- tax_form_1.pdf
|
282
291
|
homepage: https://github.com/unit-finance/unit-ruby-sdk
|
283
292
|
licenses:
|
284
293
|
- Mozilla Public License 2.0
|
@@ -1,67 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Request to create a trust application
|
4
|
-
# @see https://docs.unit.co/applications#create-trust-application
|
5
|
-
module Unit
|
6
|
-
module Application
|
7
|
-
class CreateTrustApplicationRequest
|
8
|
-
attr_reader :name, :state_of_incorporation, :revocability, :source_of_funds, :tax_id,
|
9
|
-
:grantor, :trustees, :beneficiaries, :contact, :ip, :tags, :idempotency_key, :device_fingerprints
|
10
|
-
|
11
|
-
# @param name [String]
|
12
|
-
# @param state_of_incorporation [String]
|
13
|
-
# @param revocability [String]
|
14
|
-
# @param source_of_funds [String]
|
15
|
-
# @param tax_id [String]
|
16
|
-
# @param grantor [Grantor]
|
17
|
-
# @param trustees [Array<Trustee>]
|
18
|
-
# @param beneficiaries [Array<Beneficiary>]
|
19
|
-
# @param contact [TrustContact]
|
20
|
-
# @param ip [String] - optional
|
21
|
-
# @param tags [Hash] - optional
|
22
|
-
# @param idempotency_key [String] - optional
|
23
|
-
# @param device_fingerprints [Array<DeviceFingerprint>] - optional
|
24
|
-
def initialize(name, state_of_incorporation, revocability, source_of_funds, tax_id,
|
25
|
-
grantor, trustees, beneficiaries, contact, ip = nil, tags = nil, idempotency_key = nil, device_fingerprints = nil)
|
26
|
-
@name = name
|
27
|
-
@state_of_incorporation = state_of_incorporation
|
28
|
-
@revocability = revocability
|
29
|
-
@source_of_funds = source_of_funds
|
30
|
-
@tax_id = tax_id
|
31
|
-
@grantor = grantor
|
32
|
-
@trustees = trustees
|
33
|
-
@beneficiaries = beneficiaries
|
34
|
-
@contact = contact
|
35
|
-
@ip = ip
|
36
|
-
@tags = tags
|
37
|
-
@idempotency_key = idempotency_key
|
38
|
-
@device_fingerprints = device_fingerprints
|
39
|
-
end
|
40
|
-
|
41
|
-
def to_json_api
|
42
|
-
payload = {
|
43
|
-
data: {
|
44
|
-
type: "trustApplication",
|
45
|
-
attributes: {
|
46
|
-
name: name,
|
47
|
-
stateOfIncorporation: state_of_incorporation,
|
48
|
-
revocability: revocability,
|
49
|
-
sourceOfFunds: source_of_funds,
|
50
|
-
taxId: tax_id,
|
51
|
-
grantor: grantor&.represent,
|
52
|
-
trustees: trustees,
|
53
|
-
beneficiaries: beneficiaries,
|
54
|
-
contact: contact&.represent,
|
55
|
-
ip: ip,
|
56
|
-
tags: tags,
|
57
|
-
idempotencyKey: idempotency_key,
|
58
|
-
deviceFingerprints: device_fingerprints
|
59
|
-
}
|
60
|
-
}
|
61
|
-
}
|
62
|
-
payload[:data][:attributes].compact!
|
63
|
-
payload.to_json
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Request to update a trust application
|
4
|
-
# @see https://docs.unit.co/applications/#update-trust-application
|
5
|
-
module Unit
|
6
|
-
module Application
|
7
|
-
class PatchTrustApplicationRequest
|
8
|
-
attr_reader :application_id, :tags
|
9
|
-
|
10
|
-
# @param application_id [String]
|
11
|
-
# @param tags [Hash] - optional
|
12
|
-
def initialize(application_id, tags = nil)
|
13
|
-
@application_id = application_id
|
14
|
-
@tags = tags
|
15
|
-
end
|
16
|
-
|
17
|
-
def to_json_api
|
18
|
-
payload = {
|
19
|
-
data: {
|
20
|
-
type: "trustApplication",
|
21
|
-
attributes: {
|
22
|
-
tags: tags
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
payload[:data][:attributes].compact!
|
27
|
-
payload.to_json
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# @see https://docs.unit.co/types#beneficiary
|
4
|
-
module Unit
|
5
|
-
module Types
|
6
|
-
class Beneficiary
|
7
|
-
attr_reader :full_name, :date_of_birth
|
8
|
-
|
9
|
-
# @param full_name [FullName]
|
10
|
-
# @param date_of_birth [Date]
|
11
|
-
def initialize(full_name, date_of_birth = nil)
|
12
|
-
@full_name = full_name
|
13
|
-
@date_of_birth = date_of_birth
|
14
|
-
end
|
15
|
-
|
16
|
-
def represent
|
17
|
-
payload = {
|
18
|
-
fullName: full_name.represent,
|
19
|
-
dateOfBirth: date_of_birth
|
20
|
-
}
|
21
|
-
payload.compact
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
data/lib/unit/types/grantor.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# @see https://docs.unit.co/types#grantor
|
4
|
-
module Unit
|
5
|
-
module Types
|
6
|
-
class Grantor
|
7
|
-
attr_reader :full_name, :date_of_birth, :ssn, :email, :phone, :address
|
8
|
-
|
9
|
-
# @param full_name [FullName]
|
10
|
-
# @param ssn [String]
|
11
|
-
# @param email [String]
|
12
|
-
# @param phone [Phone]
|
13
|
-
# @param address [Address]
|
14
|
-
# @param date_of_birth [Date] - optional
|
15
|
-
def initialize(full_name, ssn, email, phone, address, date_of_birth = nil)
|
16
|
-
@full_name = full_name
|
17
|
-
@date_of_birth = date_of_birth
|
18
|
-
@ssn = ssn
|
19
|
-
@email = email
|
20
|
-
@phone = phone
|
21
|
-
@address = address
|
22
|
-
end
|
23
|
-
|
24
|
-
def represent
|
25
|
-
payload = {
|
26
|
-
fullName: full_name.represent,
|
27
|
-
dateOfBirth: date_of_birth,
|
28
|
-
ssn: ssn,
|
29
|
-
email: email,
|
30
|
-
phone: phone.represent,
|
31
|
-
address: address.represent
|
32
|
-
}
|
33
|
-
payload.compact
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# @see https://docs.unit.co/types#trustcontact
|
4
|
-
module Unit
|
5
|
-
module Types
|
6
|
-
class TrustContact
|
7
|
-
attr_reader :full_name, :email, :phone, :address, :jwt_subject
|
8
|
-
|
9
|
-
# @param full_name [FullName]
|
10
|
-
# @param email [String]
|
11
|
-
# @param phone [Phone]
|
12
|
-
# @param address [Address]
|
13
|
-
# @param jwt_subject [String] - optional
|
14
|
-
def initialize(full_name, email, phone, address, jwt_subject = nil)
|
15
|
-
@full_name = full_name
|
16
|
-
@email = email
|
17
|
-
@phone = phone
|
18
|
-
@address = address
|
19
|
-
@jwt_subject = jwt_subject
|
20
|
-
end
|
21
|
-
|
22
|
-
def represent
|
23
|
-
payload = {
|
24
|
-
fullName: full_name.represent,
|
25
|
-
email: email,
|
26
|
-
phone: phone.represent,
|
27
|
-
address: address.represent,
|
28
|
-
jwtSubject: jwt_subject
|
29
|
-
}
|
30
|
-
payload.compact
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
data/lib/unit/types/trustee.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# @see https://docs.unit.co/types#trustee
|
4
|
-
module Unit
|
5
|
-
module Types
|
6
|
-
class Trustee
|
7
|
-
attr_reader :full_name, :ssn, :email, :phone, :address, :date_of_birth
|
8
|
-
|
9
|
-
# @param full_name [FullName]
|
10
|
-
# @param ssn [String]
|
11
|
-
# @param email [String]
|
12
|
-
# @param phone [Phone]
|
13
|
-
# @param address [Address]
|
14
|
-
# @param date_of_birth [Date] - optional
|
15
|
-
def initialize(full_name, ssn, email, phone, address, date_of_birth = nil)
|
16
|
-
@full_name = full_name
|
17
|
-
@ssn = ssn
|
18
|
-
@email = email
|
19
|
-
@phone = phone
|
20
|
-
@address = address
|
21
|
-
@date_of_birth = date_of_birth
|
22
|
-
end
|
23
|
-
|
24
|
-
def represent
|
25
|
-
payload = {
|
26
|
-
fullName: full_name.represent,
|
27
|
-
ssn: ssn,
|
28
|
-
email: email,
|
29
|
-
phone: phone.represent,
|
30
|
-
address: address.represent,
|
31
|
-
dateOfBirth: date_of_birth
|
32
|
-
}
|
33
|
-
payload.compact
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|