unit_ruby_sdk 0.1.0 → 0.1.2
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 +6 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +5 -3
- data/lib/unit/api_resources/application_resource.rb +51 -57
- data/lib/unit/api_resources/base_resource.rb +31 -25
- data/lib/unit/api_resources/customer_resource.rb +52 -50
- data/lib/unit/errors/unit_error.rb +11 -9
- data/lib/unit/models/application/create_business_application_request.rb +82 -0
- data/lib/unit/models/application/create_individual_application_request.rb +92 -0
- data/lib/unit/models/application/list_application_params.rb +42 -0
- data/lib/unit/models/application/patch_application_request.rb +33 -0
- data/lib/unit/models/application/upload_document_request.rb +27 -0
- data/lib/unit/models/customer/add_authorized_users_request.rb +31 -0
- data/lib/unit/models/customer/archive_customer_request.rb +30 -0
- data/lib/unit/models/customer/list_customer_params.rb +42 -0
- data/lib/unit/models/customer/patch_business_customer_request.rb +48 -0
- data/lib/unit/models/customer/patch_individual_customer_request.rb +49 -0
- data/lib/unit/models/customer/remove_authorized_users_request.rb +31 -0
- data/lib/unit/models/unit_resource.rb +13 -11
- data/lib/unit/models/unit_response.rb +10 -8
- data/lib/unit/types/address.rb +29 -25
- data/lib/unit/types/authorized_user.rb +24 -20
- data/lib/unit/types/beneficial_owner.rb +46 -42
- data/lib/unit/types/business_contact.rb +20 -16
- data/lib/unit/types/device_fingerprint.rb +17 -13
- data/lib/unit/types/evaluation_params.rb +15 -11
- data/lib/unit/types/full_name.rb +17 -13
- data/lib/unit/types/officer.rb +46 -42
- data/lib/unit/types/phone.rb +17 -13
- data/lib/unit/types/power_of_attorney_agent.rb +42 -38
- data/lib/unit/types/relationship.rb +15 -11
- data/lib/unit/types/relationship_array.rb +21 -16
- data/lib/unit/version.rb +1 -1
- data/lib/unit_ruby_sdk.rb +48 -2
- metadata +27 -13
- data/lib/unit/models/applications/create_business_application_request.rb +0 -78
- data/lib/unit/models/applications/create_individual_application_request.rb +0 -88
- data/lib/unit/models/applications/list_application_params.rb +0 -38
- data/lib/unit/models/applications/patch_application_request.rb +0 -29
- data/lib/unit/models/applications/upload_document_request.rb +0 -24
- data/lib/unit/models/customers/add_authorized_users_request.rb +0 -27
- data/lib/unit/models/customers/archive_customer_request.rb +0 -26
- data/lib/unit/models/customers/list_customer_params.rb +0 -38
- data/lib/unit/models/customers/patch_business_customer_request.rb +0 -44
- data/lib/unit/models/customers/patch_individual_customer_request.rb +0 -45
- data/lib/unit/models/customers/remove_authorized_users_request.rb +0 -27
data/lib/unit/types/full_name.rb
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module Unit
|
4
|
+
module Types
|
5
|
+
class FullName
|
6
|
+
attr_reader :first, :last
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
# @param first [String] The first name
|
9
|
+
# @param last [String] The last name
|
10
|
+
def initialize(first, last)
|
11
|
+
@first = first
|
12
|
+
@last = last
|
13
|
+
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
def represent
|
16
|
+
{
|
17
|
+
first: first,
|
18
|
+
last: last
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
data/lib/unit/types/officer.rb
CHANGED
@@ -1,48 +1,52 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
module Unit
|
4
|
+
module Types
|
5
|
+
class Officer
|
6
|
+
attr_reader :full_name, :date_of_birth, :address, :phone, :email,
|
7
|
+
:status, :title, :ssn, :passport, :nationality
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
9
|
+
# @param [FullName] full_name
|
10
|
+
# @param [Date] date_of_birth
|
11
|
+
# @param [Address] address
|
12
|
+
# @param [Phone] phone
|
13
|
+
# @param [String] email
|
14
|
+
# @param [String] ssn
|
15
|
+
# @param optional [String] status
|
16
|
+
# @param optional [String] title
|
17
|
+
# @param optional [String] passport
|
18
|
+
# @param optional [String] nationality
|
19
|
+
def initialize(full_name, date_of_birth, address, phone, email, ssn,
|
20
|
+
status = nil, title = nil, passport = nil,
|
21
|
+
nationality = nil)
|
22
|
+
@full_name = full_name
|
23
|
+
@date_of_birth = date_of_birth
|
24
|
+
@address = address
|
25
|
+
@phone = phone
|
26
|
+
@email = email
|
27
|
+
@status = status
|
28
|
+
@title = title
|
29
|
+
@ssn = ssn
|
30
|
+
@passport = passport
|
31
|
+
@nationality = nationality
|
32
|
+
end
|
31
33
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
34
|
+
def represent
|
35
|
+
payload =
|
36
|
+
{
|
37
|
+
fullName: full_name.represent,
|
38
|
+
dateOfBirth: date_of_birth,
|
39
|
+
address: address.represent,
|
40
|
+
phone: phone.represent,
|
41
|
+
email: email,
|
42
|
+
ssn: ssn,
|
43
|
+
status: status,
|
44
|
+
title: title,
|
45
|
+
passport: passport,
|
46
|
+
nationality: nationality
|
47
|
+
}
|
48
|
+
payload.compact
|
49
|
+
end
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
data/lib/unit/types/phone.rb
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
module Unit
|
4
|
+
module Types
|
5
|
+
class Phone
|
6
|
+
attr_reader :country_code, :number
|
5
7
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
# @param country_code [String] The country code
|
9
|
+
# @param number [String] The number
|
10
|
+
def initialize(country_code, number)
|
11
|
+
@country_code = country_code
|
12
|
+
@number = number
|
13
|
+
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
def represent
|
16
|
+
{
|
17
|
+
countryCode: country_code,
|
18
|
+
number: number
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
18
22
|
end
|
19
23
|
end
|
@@ -4,45 +4,49 @@ require_relative "full_name"
|
|
4
4
|
require_relative "address"
|
5
5
|
require_relative "phone"
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
module Unit
|
8
|
+
module Types
|
9
|
+
class PowerOfAttorneyAgent
|
10
|
+
attr_reader :status, :full_name, :ssn, :passport, :nationality,
|
11
|
+
:date_of_birth, :address, :phone, :email, :jwt_subject
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
# @param [String] status
|
14
|
+
# @param [FullName] full_name
|
15
|
+
# @param [String] ssn
|
16
|
+
# @param [String] passport
|
17
|
+
# @param [String] nationality
|
18
|
+
# @param [Date] date_of_birth
|
19
|
+
# @param [Address] address
|
20
|
+
# @param [Phone] phone
|
21
|
+
# @param [String] email
|
22
|
+
# @param [String] jwt_subject
|
23
|
+
def initialize(status, full_name, ssn, passport, nationality, date_of_birth, address, phone, email, jwt_subject)
|
24
|
+
@status = status
|
25
|
+
@full_name = full_name
|
26
|
+
@ssn = ssn
|
27
|
+
@passport = passport
|
28
|
+
@nationality = nationality
|
29
|
+
@date_of_birth = date_of_birth
|
30
|
+
@address = address
|
31
|
+
@phone = phone
|
32
|
+
@email = email
|
33
|
+
@jwt_subject = jwt_subject
|
34
|
+
end
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
36
|
+
def represent
|
37
|
+
{
|
38
|
+
status: status,
|
39
|
+
fullName: full_name.represent,
|
40
|
+
ssn: ssn,
|
41
|
+
passport: passport,
|
42
|
+
nationality: nationality,
|
43
|
+
dateOfBirth: date_of_birth,
|
44
|
+
address: address.represent,
|
45
|
+
phone: phone.represent,
|
46
|
+
email: email,
|
47
|
+
jwtSubject: jwt_subject
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
47
51
|
end
|
48
52
|
end
|
@@ -1,18 +1,22 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# represents relationships in the JSON API payload
|
4
|
-
|
5
|
-
|
4
|
+
module Unit
|
5
|
+
module Types
|
6
|
+
class Relationship
|
7
|
+
attr_accessor :id, :type
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
# @param id [String] The id of the relationship
|
10
|
+
# @param type [String] The type
|
11
|
+
def initialize(id, type)
|
12
|
+
@id = id
|
13
|
+
@type = type
|
14
|
+
end
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
16
|
+
# @param nested [Boolean] Whether or not the relationship is nested
|
17
|
+
def represent(nested: true)
|
18
|
+
nested ? { "data": { "id": id, "type": type } } : { "id": id, "type": type }
|
19
|
+
end
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
@@ -1,23 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
# represents relationship Array in the JSON API payload
|
4
|
-
|
5
|
-
|
4
|
+
module Unit
|
5
|
+
module Types
|
6
|
+
class RelationshipArray
|
7
|
+
attr_reader :data
|
6
8
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
# @param array [Array] The array of relationships
|
10
|
+
def initialize(array)
|
11
|
+
relationships = []
|
12
|
+
array.map do |item|
|
13
|
+
relationships << if item.is_a?(Relationship)
|
14
|
+
item
|
15
|
+
else
|
16
|
+
Relationship.new(item[:data][:id], item[:data][:type]).represent
|
17
|
+
end
|
18
|
+
p item
|
19
|
+
end
|
20
|
+
@data = relationships
|
21
|
+
end
|
19
22
|
|
20
|
-
|
21
|
-
|
23
|
+
def represent
|
24
|
+
{ "data": data }
|
25
|
+
end
|
26
|
+
end
|
22
27
|
end
|
23
28
|
end
|
data/lib/unit/version.rb
CHANGED
data/lib/unit_ruby_sdk.rb
CHANGED
@@ -3,6 +3,52 @@
|
|
3
3
|
require_relative "unit/version"
|
4
4
|
|
5
5
|
module Unit
|
6
|
-
|
7
|
-
|
6
|
+
module Resource
|
7
|
+
autoload :ApplicationResource, "unit/api_resources/application_resource"
|
8
|
+
autoload :CustomerResource, "unit/api_resources/customer_resource"
|
9
|
+
end
|
10
|
+
|
11
|
+
module Application
|
12
|
+
autoload :CreateBusinessApplicationRequest, "unit/models/application/create_business_application_request"
|
13
|
+
autoload :CreateIndividualApplicationRequest, "unit/models/application/create_individual_application_request"
|
14
|
+
autoload :ListApplicationParams, "unit/models/application/list_application_params"
|
15
|
+
autoload :PatchApplicationRequest, "unit/models/application/patch_application_request"
|
16
|
+
autoload :UploadDocumentRequest, "unit/models/application/upload_document_request"
|
17
|
+
end
|
18
|
+
|
19
|
+
module Customer
|
20
|
+
autoload :AddAuthorizedUsersRequest, "unit/models/customer/add_authorized_users_request"
|
21
|
+
autoload :ArchiveCustomerRequest, "unit/models/customer/archive_customer_request"
|
22
|
+
autoload :ListCustomerParams, "unit/models/customer/list_customer_params"
|
23
|
+
autoload :PatchBusinessCustomerRequest, "unit/models/customer/patch_business_customer_request"
|
24
|
+
autoload :PatchIndividualCustomerRequest, "unit/models/customer/patch_individual_customer_request"
|
25
|
+
autoload :RemoveAuthorizedUsersRequest, "unit/models/customer/remove_authorized_users_request"
|
26
|
+
end
|
27
|
+
|
28
|
+
module Types
|
29
|
+
autoload :Address, "unit/types/address"
|
30
|
+
autoload :AuthorizedUser, "unit/types/authorized_user"
|
31
|
+
autoload :BeneficialOwner, "unit/types/beneficial_owner"
|
32
|
+
autoload :BusinessContact, "unit/types/business_contact"
|
33
|
+
autoload :DeviceFingerprint, "unit/types/device_fingerprint"
|
34
|
+
autoload :EvaluationParams, "unit/types/evaluation_params"
|
35
|
+
autoload :FullName, "unit/types/full_name"
|
36
|
+
autoload :Officer, "unit/types/officer"
|
37
|
+
autoload :Phone, "unit/types/phone"
|
38
|
+
autoload :PowerOfAttorneyAgent, "unit/types/power_of_attorney_agent"
|
39
|
+
autoload :Relationship, "unit/types/relationship"
|
40
|
+
autoload :RelationshipArray, "unit/types/relationship_array"
|
41
|
+
end
|
42
|
+
|
43
|
+
autoload :UnitErrorPayload, "unit/errors/unit_error_payload"
|
44
|
+
autoload :UnitError, "unit/errors/unit_error"
|
45
|
+
autoload :UnitResponse, "unit/models/unit_response"
|
46
|
+
autoload :UnitResource, "unit/models/unit_resource"
|
47
|
+
|
48
|
+
# Configure Unit SDK - acts both as a setter and a getter
|
49
|
+
# @param [Hash] new_config If passed, update config
|
50
|
+
# @return [Hash] current config
|
51
|
+
def self.config(new_config = nil)
|
52
|
+
@@config ||= new_config
|
53
|
+
end
|
8
54
|
end
|
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: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unit
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-12-
|
11
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: httparty
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.20.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.20.0
|
27
41
|
description: This library provides a Ruby wrapper to http://unit.co API. See https://docs.unit.co/
|
28
42
|
email:
|
29
43
|
- engineering@unit.co
|
@@ -44,17 +58,17 @@ files:
|
|
44
58
|
- lib/unit/api_resources/customer_resource.rb
|
45
59
|
- lib/unit/errors/unit_error.rb
|
46
60
|
- lib/unit/errors/unit_error_payload.rb
|
47
|
-
- lib/unit/models/
|
48
|
-
- lib/unit/models/
|
49
|
-
- lib/unit/models/
|
50
|
-
- lib/unit/models/
|
51
|
-
- lib/unit/models/
|
52
|
-
- lib/unit/models/
|
53
|
-
- lib/unit/models/
|
54
|
-
- lib/unit/models/
|
55
|
-
- lib/unit/models/
|
56
|
-
- lib/unit/models/
|
57
|
-
- lib/unit/models/
|
61
|
+
- lib/unit/models/application/create_business_application_request.rb
|
62
|
+
- lib/unit/models/application/create_individual_application_request.rb
|
63
|
+
- lib/unit/models/application/list_application_params.rb
|
64
|
+
- lib/unit/models/application/patch_application_request.rb
|
65
|
+
- lib/unit/models/application/upload_document_request.rb
|
66
|
+
- lib/unit/models/customer/add_authorized_users_request.rb
|
67
|
+
- lib/unit/models/customer/archive_customer_request.rb
|
68
|
+
- lib/unit/models/customer/list_customer_params.rb
|
69
|
+
- lib/unit/models/customer/patch_business_customer_request.rb
|
70
|
+
- lib/unit/models/customer/patch_individual_customer_request.rb
|
71
|
+
- lib/unit/models/customer/remove_authorized_users_request.rb
|
58
72
|
- lib/unit/models/unit_resource.rb
|
59
73
|
- lib/unit/models/unit_response.rb
|
60
74
|
- lib/unit/types/address.rb
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "unit/types/full_name"
|
4
|
-
require "unit/types/address"
|
5
|
-
require "unit/types/phone"
|
6
|
-
require "unit/types/business_contact"
|
7
|
-
require "unit/types/beneficial_owner"
|
8
|
-
require "unit/types/officer"
|
9
|
-
|
10
|
-
# Request to create a business application
|
11
|
-
# See: https://docs.unit.co/applications/#create-business-application
|
12
|
-
class CreateBusinessApplicationRequest
|
13
|
-
attr_reader :name, :address, :phone, :state_of_incorporation, :ein, :industry, :contact, :officer, :beneficial_owners,
|
14
|
-
:entity_type, :dba, :ip, :website, :tags, :idempotency_key, :device_fingerprints, :type
|
15
|
-
|
16
|
-
# @param name [String]
|
17
|
-
# @param address [Address]
|
18
|
-
# @param phone [Phone]
|
19
|
-
# @param state_of_incorporation [String]
|
20
|
-
# @param ein [String]
|
21
|
-
# @param industry [String]
|
22
|
-
# @param contact [BusinessContact]
|
23
|
-
# @param officer [Officer]
|
24
|
-
# @param beneficial_owners [Array]
|
25
|
-
# @param entity_type [String]
|
26
|
-
# @param optional dba [String]
|
27
|
-
# @param optional ip [String]
|
28
|
-
# @param optional website [String]
|
29
|
-
# @param optional tags [Hash]
|
30
|
-
# @param optional idempotency_key [String]
|
31
|
-
# @param optional device_fingerprints [DeviceFingerprint]
|
32
|
-
def initialize(name, address, phone, state_of_incorporation, ein, industry, contact, officer,
|
33
|
-
beneficial_owners, entity_type, dba = nil, ip = nil, website = nil, tags = nil, idempotency_key = nil,
|
34
|
-
device_fingerprints = nil)
|
35
|
-
@name = name
|
36
|
-
@address = address
|
37
|
-
@phone = phone
|
38
|
-
@state_of_incorporation = state_of_incorporation
|
39
|
-
@ein = ein
|
40
|
-
@industry = industry
|
41
|
-
@contact = contact
|
42
|
-
@officer = officer
|
43
|
-
@beneficial_owners = beneficial_owners.map(&:represent)
|
44
|
-
@entity_type = entity_type
|
45
|
-
@dba = dba
|
46
|
-
@ip = ip
|
47
|
-
@website = website
|
48
|
-
@tags = tags
|
49
|
-
@idempotency_key = idempotency_key
|
50
|
-
@device_fingerprints = device_fingerprints
|
51
|
-
@type = "businessApplication"
|
52
|
-
end
|
53
|
-
|
54
|
-
def to_json_api
|
55
|
-
payload = {
|
56
|
-
data: {
|
57
|
-
type: type,
|
58
|
-
attributes: {
|
59
|
-
name: name,
|
60
|
-
address: address.represent,
|
61
|
-
phone: phone.represent,
|
62
|
-
stateOfIncorporation: state_of_incorporation,
|
63
|
-
ein: ein,
|
64
|
-
industry: industry,
|
65
|
-
contact: contact.represent,
|
66
|
-
officer: officer.represent,
|
67
|
-
beneficialOwners: beneficial_owners,
|
68
|
-
entityType: entity_type,
|
69
|
-
dba: dba,
|
70
|
-
ip: ip,
|
71
|
-
website: website
|
72
|
-
}
|
73
|
-
}
|
74
|
-
}
|
75
|
-
payload[:data][:attributes].compact!
|
76
|
-
payload.to_json
|
77
|
-
end
|
78
|
-
end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "unit/types/full_name"
|
4
|
-
require "unit/types/address"
|
5
|
-
require "unit/types/phone"
|
6
|
-
require "unit/types/device_fingerprint"
|
7
|
-
|
8
|
-
# Request to create an individual application
|
9
|
-
# See https://docs.unit.co/applications/#create-individual-application
|
10
|
-
class CreateIndividualApplicationRequest
|
11
|
-
attr_reader :type, :ssn, :full_name, :date_of_birth, :address, :email, :phone, :ip, :ein, :industry, :dba, :sole_proprietorship,
|
12
|
-
:passport, :nationality, :device_fingerprints, :idempotency_key, :tags, :jwt_subject, :power_of_attorney_agent,
|
13
|
-
:evaluation_params
|
14
|
-
|
15
|
-
# @param ssn [String]
|
16
|
-
# @param full_name [FullName]
|
17
|
-
# @param date_of_birth [Date]
|
18
|
-
# @param address [Address]
|
19
|
-
# @param email [String]
|
20
|
-
# @param phone [Phone]
|
21
|
-
# @param optional ip [String]
|
22
|
-
# @param optional ein [String]
|
23
|
-
# @param optional industry [String]
|
24
|
-
# @param optional dba [String]
|
25
|
-
# @param optional sole_proprietorship [Boolean]
|
26
|
-
# @param optional passport [String]
|
27
|
-
# @param optional nationality [String]
|
28
|
-
# @param optional device_fingerprints [DeviceFingerprint]
|
29
|
-
# @param optional idempotency_key [String]
|
30
|
-
# @param optional tags [Hash]
|
31
|
-
# @param optional jwt_subject [String]
|
32
|
-
# @param optional power_of_attorney_agent [PowerOfAttorneyAgent]
|
33
|
-
# @param optional evaluation_params [EvaluationParams]
|
34
|
-
def initialize(ssn, full_name, date_of_birth, address, email, phone, ip = nil, ein = nil, industry = nil, dba = nil, sole_proprietorship = nil, passport = nil,
|
35
|
-
nationality = nil, device_fingerprints = nil, idempotency_key = nil, tags = nil, jwt_subject = nil, power_of_attorney_agent = nil,
|
36
|
-
evaluation_params = nil)
|
37
|
-
@ssn = ssn
|
38
|
-
@full_name = full_name
|
39
|
-
@date_of_birth = date_of_birth
|
40
|
-
@address = address
|
41
|
-
@phone = phone
|
42
|
-
@email = email
|
43
|
-
@ip = ip
|
44
|
-
@ein = ein
|
45
|
-
@industry = industry
|
46
|
-
@dba = dba
|
47
|
-
@sole_proprietorship = sole_proprietorship
|
48
|
-
@passport = passport
|
49
|
-
@nationality = nationality
|
50
|
-
@device_fingerprints = device_fingerprints
|
51
|
-
@idempotency_key = idempotency_key
|
52
|
-
@tags = tags
|
53
|
-
@jwt_object = jwt_subject
|
54
|
-
@power_of_attorney_agent = power_of_attorney_agent
|
55
|
-
@evaluation_params = evaluation_params
|
56
|
-
@type = "individualApplication"
|
57
|
-
end
|
58
|
-
|
59
|
-
def to_json_api
|
60
|
-
payload = {
|
61
|
-
data: {
|
62
|
-
type: type,
|
63
|
-
attributes: {
|
64
|
-
ssn: ssn,
|
65
|
-
fullName: full_name.represent,
|
66
|
-
dateOfBirth: date_of_birth,
|
67
|
-
address: address.represent,
|
68
|
-
email: email,
|
69
|
-
phone: phone.represent,
|
70
|
-
ip: ip,
|
71
|
-
ein: ein,
|
72
|
-
industry: industry,
|
73
|
-
dba: dba,
|
74
|
-
soleProprietorship: sole_proprietorship,
|
75
|
-
passport: passport,
|
76
|
-
nationality: nationality,
|
77
|
-
idempotencyKey: idempotency_key,
|
78
|
-
tags: tags,
|
79
|
-
jwtSubject: jwt_subject,
|
80
|
-
powerOfAttorneyAgent: power_of_attorney_agent&.represent,
|
81
|
-
evaluationParams: evaluation_params&.represent
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
payload[:data][:attributes].compact!
|
86
|
-
payload.to_json
|
87
|
-
end
|
88
|
-
end
|