unit-python-sdk 1.1.1__tar.gz → 1.2.0__tar.gz
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.
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/PKG-INFO +1 -1
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/setup.py +1 -1
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/application_resource.py +17 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/__init__.py +7 -2
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/application.py +206 -26
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/codecs.py +9 -2
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/utils/configuration.py +1 -1
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit_python_sdk.egg-info/PKG-INFO +1 -1
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/LICENSE +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/README.md +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/setup.cfg +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/__init__.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/__init__.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/account_end_of_day_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/account_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/api_token_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/applicationForm_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/atmLocation_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/authorization_request_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/authorization_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/base_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/batch_release_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/card_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/checkDeposit_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/check_payment_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/counterparty_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/customerToken_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/customer_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/dispute_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/event_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/fee_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/institution_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/payment_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/received_payment_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/recurring_payment_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/repayment_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/returnAch_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/reward_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/statement_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/tax_form_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/transaction_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/api/webhook_resource.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/account.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/account_end_of_day.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/api_token.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/applicationForm.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/atm_location.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/authorization.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/authorization_request.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/batch_release.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/benificial_owner.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/card.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/check_deposit.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/check_payment.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/counterparty.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/customer.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/customerToken.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/dispute.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/event.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/fee.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/institution.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/payment.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/received_payment.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/repayment.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/returnAch.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/reward.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/statement.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/tax_form.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/transaction.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/models/webhook.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/utils/__init__.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit/utils/date_utils.py +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit_python_sdk.egg-info/SOURCES.txt +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit_python_sdk.egg-info/dependency_links.txt +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit_python_sdk.egg-info/requires.txt +0 -0
- {unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit_python_sdk.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unit-python-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: This library provides a python wrapper to http://unit.co API. See https://docs.unit.co/
|
|
5
5
|
Home-page: https://github.com/unit-finance/unit-python-sdk
|
|
6
6
|
Download-URL: https://github.com/unit-finance/unit-python-sdk.git
|
|
@@ -3,7 +3,7 @@ from distutils.core import setup
|
|
|
3
3
|
setup(
|
|
4
4
|
name='unit-python-sdk',
|
|
5
5
|
packages=['unit', 'unit.api', 'unit.models', 'unit.utils'],
|
|
6
|
-
version="1.
|
|
6
|
+
version="1.2.0",
|
|
7
7
|
license='Mozilla Public License 2.0',
|
|
8
8
|
description='This library provides a python wrapper to http://unit.co API. See https://docs.unit.co/',
|
|
9
9
|
author='unit.co',
|
|
@@ -115,3 +115,20 @@ class ApplicationResource(BaseResource):
|
|
|
115
115
|
return UnitResponse[ApplicationDTO](DtoDecoder.decode(data), DtoDecoder.decode(included))
|
|
116
116
|
else:
|
|
117
117
|
return UnitError.from_json_api(response.json())
|
|
118
|
+
|
|
119
|
+
def upgrade_to_thread_application(self, request: UpgradeToThreadApplicationRequest) -> Union[UnitResponse[ThreadApplicationDTO], UnitError]:
|
|
120
|
+
payload = request.to_json_api()
|
|
121
|
+
response = super().patch(f"{self.resource}/{request.application_id}", payload)
|
|
122
|
+
if super().is_20x(response.status_code):
|
|
123
|
+
data = response.json().get("data")
|
|
124
|
+
return UnitResponse[ThreadApplicationDTO](DtoDecoder.decode(data), None)
|
|
125
|
+
else:
|
|
126
|
+
return UnitError.from_json_api(response.json())
|
|
127
|
+
|
|
128
|
+
def get_missing_fields(self, application_id: str) -> Union[UnitResponse[ApplicationMissingFieldsDTO], UnitError]:
|
|
129
|
+
response = super().get(f"{self.resource}/{application_id}/missing-fields")
|
|
130
|
+
if super().is_20x(response.status_code):
|
|
131
|
+
data = response.json().get("data")
|
|
132
|
+
return UnitResponse[ApplicationMissingFieldsDTO](DtoDecoder.decode(data), None)
|
|
133
|
+
else:
|
|
134
|
+
return UnitError.from_json_api(response.json())
|
|
@@ -347,7 +347,8 @@ class BeneficialOwnerDTO(UnitDTO):
|
|
|
347
347
|
class ThreadBeneficialOwner(UnitDTO):
|
|
348
348
|
def __init__(self, status: Optional[Status], full_name: FullName, ssn: Optional[str],
|
|
349
349
|
passport: Optional[str], nationality: Optional[str], date_of_birth: date,
|
|
350
|
-
address: Address, phone: Phone, email: str
|
|
350
|
+
address: Address, phone: Phone, email: str, percentage: Optional[int] = None,
|
|
351
|
+
id_theft_score: Optional[int] = None):
|
|
351
352
|
self.status = status
|
|
352
353
|
self.full_name = full_name
|
|
353
354
|
self.ssn = ssn
|
|
@@ -357,6 +358,8 @@ class ThreadBeneficialOwner(UnitDTO):
|
|
|
357
358
|
self.address = address
|
|
358
359
|
self.phone = phone
|
|
359
360
|
self.email = email
|
|
361
|
+
self.percentage = percentage
|
|
362
|
+
self.id_theft_score = id_theft_score
|
|
360
363
|
|
|
361
364
|
@staticmethod
|
|
362
365
|
def create(data: Dict):
|
|
@@ -369,7 +372,9 @@ class ThreadBeneficialOwner(UnitDTO):
|
|
|
369
372
|
data.get("dateOfBirth"),
|
|
370
373
|
Address.from_json_api(data.get("address")),
|
|
371
374
|
Phone.from_json_api(data.get("phone")),
|
|
372
|
-
data.get("email")
|
|
375
|
+
data.get("email"),
|
|
376
|
+
data.get("percentage"),
|
|
377
|
+
data.get("idTheftScore"))
|
|
373
378
|
|
|
374
379
|
@staticmethod
|
|
375
380
|
def from_json_api(l: Union[List, Dict]):
|
|
@@ -4,6 +4,41 @@ from typing import IO
|
|
|
4
4
|
|
|
5
5
|
ApplicationStatus = Literal["Approved", "Denied", "Pending", "PendingReview", "AwaitingDocuments", "Canceled"]
|
|
6
6
|
|
|
7
|
+
|
|
8
|
+
class MissingField(object):
|
|
9
|
+
def __init__(self, field_name: str, description: str):
|
|
10
|
+
self.field_name = field_name
|
|
11
|
+
self.description = description
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def from_json_api(data: Dict):
|
|
15
|
+
return MissingField(data.get("fieldName"), data.get("description"))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class IndividualApplicationMissingFieldsDTO(object):
|
|
19
|
+
def __init__(self, missing_fields: List["MissingField"]):
|
|
20
|
+
self.type = "individualApplicationMissingFields"
|
|
21
|
+
self.attributes = {"missingFields": missing_fields}
|
|
22
|
+
|
|
23
|
+
@staticmethod
|
|
24
|
+
def from_json_api(_id, _type, attributes, relationships):
|
|
25
|
+
missing_fields = [MissingField.from_json_api(mf) for mf in attributes.get("missingFields", [])]
|
|
26
|
+
return IndividualApplicationMissingFieldsDTO(missing_fields)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class BusinessApplicationMissingFieldsDTO(object):
|
|
30
|
+
def __init__(self, missing_fields: List["MissingField"]):
|
|
31
|
+
self.type = "businessApplicationMissingFields"
|
|
32
|
+
self.attributes = {"missingFields": missing_fields}
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
def from_json_api(_id, _type, attributes, relationships):
|
|
36
|
+
missing_fields = [MissingField.from_json_api(mf) for mf in attributes.get("missingFields", [])]
|
|
37
|
+
return BusinessApplicationMissingFieldsDTO(missing_fields)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
ApplicationMissingFieldsDTO = Union[IndividualApplicationMissingFieldsDTO, BusinessApplicationMissingFieldsDTO]
|
|
41
|
+
|
|
7
42
|
DocumentType = Literal["IdDocument", "Passport", "AddressVerification", "CertificateOfIncorporation",
|
|
8
43
|
"EmployerIdentificationNumberConfirmation"]
|
|
9
44
|
|
|
@@ -334,7 +369,7 @@ class BaseCreateIndividualApplicationRequest(UnitRequest):
|
|
|
334
369
|
tags: Optional[Dict[str, str]] = None, jwt_subject: Optional[str] = None,
|
|
335
370
|
power_of_attorney_agent: Optional[Agent] = None, evaluation_params: Optional[EvaluationParams] = None,
|
|
336
371
|
occupation: Optional[Occupation] = None, annual_income: Optional[AnnualIncome] = None,
|
|
337
|
-
source_of_income: Optional[SourceOfIncome] = None):
|
|
372
|
+
source_of_income: Optional[SourceOfIncome] = None, operating_address: Optional[Address] = None):
|
|
338
373
|
self.full_name = full_name
|
|
339
374
|
self.date_of_birth = date_of_birth
|
|
340
375
|
self.address = address
|
|
@@ -356,6 +391,7 @@ class BaseCreateIndividualApplicationRequest(UnitRequest):
|
|
|
356
391
|
self.occupation = occupation
|
|
357
392
|
self.annual_income = annual_income
|
|
358
393
|
self.source_of_income = source_of_income
|
|
394
|
+
self.operating_address = operating_address
|
|
359
395
|
|
|
360
396
|
def to_json_api(self) -> Dict:
|
|
361
397
|
return super().to_payload("individualApplication")
|
|
@@ -380,7 +416,8 @@ class CreateIndividualThreadApplicationRequest(UnitRequest):
|
|
|
380
416
|
source_of_funds: Optional[ThreadApplicationIndividualSourceOfFunds] = None,
|
|
381
417
|
transaction_volume: Optional[ThreadApplicationIndividualTransactionVolume] = None,
|
|
382
418
|
transaction_volume_description: Optional[str] = None,
|
|
383
|
-
profession: Optional[ThreadApplicationProfession] = None
|
|
419
|
+
profession: Optional[ThreadApplicationProfession] = None,
|
|
420
|
+
operating_address: Optional[Address] = None):
|
|
384
421
|
self.ssn = ssn
|
|
385
422
|
self.passport = passport
|
|
386
423
|
self.nationality = nationality
|
|
@@ -402,6 +439,7 @@ class CreateIndividualThreadApplicationRequest(UnitRequest):
|
|
|
402
439
|
self.transaction_volume = transaction_volume
|
|
403
440
|
self.transaction_volume_description = transaction_volume_description
|
|
404
441
|
self.profession = profession
|
|
442
|
+
self.operating_address = operating_address
|
|
405
443
|
|
|
406
444
|
def to_json_api(self) -> Dict:
|
|
407
445
|
return super().to_payload("individualApplication")
|
|
@@ -413,17 +451,25 @@ class CreateIndividualThreadApplicationRequest(UnitRequest):
|
|
|
413
451
|
class CreateSoleProprietorThreadApplicationRequest(UnitRequest):
|
|
414
452
|
def __init__(self, ssn: Optional[str], passport: Optional[str], nationality: Optional[str],
|
|
415
453
|
full_name: FullName, date_of_birth: date, address: Address, phone: Phone, email: str,
|
|
454
|
+
sole_proprietorship: bool = True,
|
|
416
455
|
dba: Optional[str] = None, ein: Optional[str] = None, website: Optional[str] = None,
|
|
417
456
|
evaluation_params: Optional[EvaluationParams] = None, ip: Optional[str] = None,
|
|
418
457
|
tags: Optional[Dict[str, str]] = None, idempotency_key: Optional[str] = None,
|
|
419
458
|
device_fingerprints: Optional[List[DeviceFingerprint]] = None,
|
|
420
459
|
jwt_subject: Optional[str] = None, banks: Optional[List[str]] = None,
|
|
421
|
-
account_purpose: Optional[ThreadApplicationBusinessAccountPurpose] = None,
|
|
422
|
-
account_purpose_detail: Optional[str] = None,
|
|
423
460
|
source_of_funds: Optional[ThreadApplicationBusinessSourceOfFunds] = None,
|
|
461
|
+
source_of_funds_description: Optional[str] = None,
|
|
462
|
+
business_industry: Optional[ThreadApplicationBusinessIndustry] = None,
|
|
463
|
+
is_incorporated: Optional[bool] = None,
|
|
464
|
+
state_of_incorporation: Optional[str] = None,
|
|
465
|
+
year_of_incorporation: Optional[str] = None,
|
|
466
|
+
countries_of_operation: Optional[List[str]] = None,
|
|
467
|
+
us_nexus: Optional[List[ThreadApplicationUSNexus]] = None,
|
|
424
468
|
transaction_volume: Optional[ThreadApplicationSoleProprietorTransactionVolume] = None,
|
|
425
469
|
transaction_volume_description: Optional[str] = None,
|
|
426
|
-
|
|
470
|
+
account_purpose: Optional[ThreadApplicationBusinessAccountPurpose] = None,
|
|
471
|
+
account_purpose_detail: Optional[str] = None,
|
|
472
|
+
operating_address: Optional[Address] = None):
|
|
427
473
|
self.ssn = ssn
|
|
428
474
|
self.passport = passport
|
|
429
475
|
self.nationality = nationality
|
|
@@ -432,6 +478,7 @@ class CreateSoleProprietorThreadApplicationRequest(UnitRequest):
|
|
|
432
478
|
self.address = address
|
|
433
479
|
self.phone = phone
|
|
434
480
|
self.email = email
|
|
481
|
+
self.sole_proprietorship = sole_proprietorship
|
|
435
482
|
self.dba = dba
|
|
436
483
|
self.ein = ein
|
|
437
484
|
self.website = website
|
|
@@ -442,12 +489,19 @@ class CreateSoleProprietorThreadApplicationRequest(UnitRequest):
|
|
|
442
489
|
self.device_fingerprints = device_fingerprints
|
|
443
490
|
self.jwt_subject = jwt_subject
|
|
444
491
|
self.banks = banks
|
|
445
|
-
self.account_purpose = account_purpose
|
|
446
|
-
self.account_purpose_detail = account_purpose_detail
|
|
447
492
|
self.source_of_funds = source_of_funds
|
|
493
|
+
self.source_of_funds_description = source_of_funds_description
|
|
494
|
+
self.business_industry = business_industry
|
|
495
|
+
self.is_incorporated = is_incorporated
|
|
496
|
+
self.state_of_incorporation = state_of_incorporation
|
|
497
|
+
self.year_of_incorporation = year_of_incorporation
|
|
498
|
+
self.countries_of_operation = countries_of_operation
|
|
499
|
+
self.us_nexus = us_nexus
|
|
448
500
|
self.transaction_volume = transaction_volume
|
|
449
501
|
self.transaction_volume_description = transaction_volume_description
|
|
450
|
-
self.
|
|
502
|
+
self.account_purpose = account_purpose
|
|
503
|
+
self.account_purpose_detail = account_purpose_detail
|
|
504
|
+
self.operating_address = operating_address
|
|
451
505
|
|
|
452
506
|
def to_json_api(self) -> Dict:
|
|
453
507
|
return super().to_payload("individualApplication")
|
|
@@ -471,7 +525,8 @@ class CreateBusinessThreadApplicationRequest(UnitRequest):
|
|
|
471
525
|
account_purpose_detail: Optional[str] = None,
|
|
472
526
|
source_of_funds: Optional[ThreadApplicationBusinessSourceOfFunds] = None,
|
|
473
527
|
transaction_volume: Optional[ThreadApplicationBusinessTransactionVolume] = None,
|
|
474
|
-
transaction_volume_description: Optional[str] = None
|
|
528
|
+
transaction_volume_description: Optional[str] = None,
|
|
529
|
+
operating_address: Optional[Address] = None):
|
|
475
530
|
self.name = name
|
|
476
531
|
self.address = address
|
|
477
532
|
self.phone = phone
|
|
@@ -498,6 +553,7 @@ class CreateBusinessThreadApplicationRequest(UnitRequest):
|
|
|
498
553
|
self.source_of_funds = source_of_funds
|
|
499
554
|
self.transaction_volume = transaction_volume
|
|
500
555
|
self.transaction_volume_description = transaction_volume_description
|
|
556
|
+
self.operating_address = operating_address
|
|
501
557
|
|
|
502
558
|
def to_payload(self, payload_type: str) -> Dict:
|
|
503
559
|
payload = super().to_payload(payload_type)
|
|
@@ -523,8 +579,8 @@ class CreateBusinessApplicationRequest(UnitRequest):
|
|
|
523
579
|
countries_of_operation: Optional[List[str]] = None, stock_symbol: Optional[str] = None,
|
|
524
580
|
business_vertical: Optional[BusinessVertical] = None,
|
|
525
581
|
device_fingerprints: Optional[List[DeviceFingerprint]] = None,
|
|
526
|
-
tags: Optional[Dict[str, str]] = None, idempotency_key: Optional[str] = None
|
|
527
|
-
):
|
|
582
|
+
tags: Optional[Dict[str, str]] = None, idempotency_key: Optional[str] = None,
|
|
583
|
+
operating_address: Optional[Address] = None):
|
|
528
584
|
self.name = name
|
|
529
585
|
self.address = address
|
|
530
586
|
self.phone = phone
|
|
@@ -548,6 +604,7 @@ class CreateBusinessApplicationRequest(UnitRequest):
|
|
|
548
604
|
self.device_fingerprints = device_fingerprints
|
|
549
605
|
self.tags = tags
|
|
550
606
|
self.idempotency_key = idempotency_key
|
|
607
|
+
self.operating_address = operating_address
|
|
551
608
|
|
|
552
609
|
def to_payload(self, payload_type: str) -> Dict:
|
|
553
610
|
payload = super().to_payload(payload_type)
|
|
@@ -573,10 +630,12 @@ class CreateSoleProprietorApplicationRequest(BaseCreateIndividualApplicationRequ
|
|
|
573
630
|
occupation: Optional[Occupation] = None, annual_income: Optional[AnnualIncome] = None,
|
|
574
631
|
source_of_income: Optional[SourceOfIncome] = None, annual_revenue: Optional[AnnualRevenue] = None,
|
|
575
632
|
number_of_employees: Optional[NumberOfEmployees] = None,
|
|
576
|
-
business_vertical: Optional[BusinessVertical] = None
|
|
633
|
+
business_vertical: Optional[BusinessVertical] = None,
|
|
634
|
+
operating_address: Optional[Address] = None):
|
|
577
635
|
super().__init__(full_name, date_of_birth, address, email, phone, ip, ein, dba, sole_proprietorship, passport,
|
|
578
636
|
nationality, ssn, device_fingerprints, idempotency_key, tags, jwt_subject,
|
|
579
|
-
power_of_attorney_agent, evaluation_params, occupation, annual_income, source_of_income
|
|
637
|
+
power_of_attorney_agent, evaluation_params, occupation, annual_income, source_of_income,
|
|
638
|
+
operating_address)
|
|
580
639
|
self.annual_revenue = annual_revenue
|
|
581
640
|
self.number_of_employees = number_of_employees
|
|
582
641
|
self.business_vertical = business_vertical
|
|
@@ -648,10 +707,11 @@ class ListApplicationParams(UnitParams):
|
|
|
648
707
|
|
|
649
708
|
class PatchApplicationRequest(UnitRequest):
|
|
650
709
|
def __init__(self, application_id: str, type: ApplicationTypes = "individualApplication",
|
|
651
|
-
tags: Optional[Dict[str, str]] = None):
|
|
710
|
+
tags: Optional[Dict[str, str]] = None, operating_address: Optional[Address] = None):
|
|
652
711
|
self.application_id = application_id
|
|
653
712
|
self.type = type
|
|
654
713
|
self.tags = tags
|
|
714
|
+
self.operating_address = operating_address
|
|
655
715
|
|
|
656
716
|
def to_json_api(self) -> Dict:
|
|
657
717
|
return super().to_payload(self.type, ignore=['application_id', 'type'])
|
|
@@ -660,8 +720,8 @@ class PatchApplicationRequest(UnitRequest):
|
|
|
660
720
|
class PatchIndividualApplicationRequest(PatchApplicationRequest):
|
|
661
721
|
def __init__(self, application_id: str, occupation: Optional[Occupation] = None,
|
|
662
722
|
annual_income: Optional[AnnualIncome] = None, source_of_income: Optional[SourceOfIncome] = None,
|
|
663
|
-
tags: Optional[Dict[str, str]] = None):
|
|
664
|
-
super().__init__(application_id, tags=tags)
|
|
723
|
+
tags: Optional[Dict[str, str]] = None, operating_address: Optional[Address] = None):
|
|
724
|
+
super().__init__(application_id, tags=tags, operating_address=operating_address)
|
|
665
725
|
self.occupation = occupation
|
|
666
726
|
self.annual_income = annual_income
|
|
667
727
|
self.source_of_income = source_of_income
|
|
@@ -671,8 +731,8 @@ class PatchSoleProprietorApplicationRequest(PatchApplicationRequest):
|
|
|
671
731
|
def __init__(self, application_id: str, annual_revenue: Optional[AnnualRevenue] = None,
|
|
672
732
|
number_of_employees: Optional[NumberOfEmployees] = None,
|
|
673
733
|
business_vertical: Optional[BusinessVertical] = None, website: Optional[str] = None,
|
|
674
|
-
tags: Optional[Dict[str, str]] = None):
|
|
675
|
-
super().__init__(application_id, tags=tags)
|
|
734
|
+
tags: Optional[Dict[str, str]] = None, operating_address: Optional[Address] = None):
|
|
735
|
+
super().__init__(application_id, tags=tags, operating_address=operating_address)
|
|
676
736
|
self.annual_revenue = annual_revenue
|
|
677
737
|
self.number_of_employees = number_of_employees
|
|
678
738
|
self.business_vertical = business_vertical
|
|
@@ -719,8 +779,9 @@ class PatchBusinessApplicationRequest(PatchApplicationRequest):
|
|
|
719
779
|
number_of_employees: Optional[NumberOfEmployees] = None, cash_flow: Optional[CashFlow] = None,
|
|
720
780
|
year_of_incorporation: Optional[str] = None, countries_of_operation: Optional[str] = None,
|
|
721
781
|
stock_symbol: Optional[str] = None, business_vertical: Optional[BusinessVertical] = None,
|
|
722
|
-
officer: Optional[UpdateBusinessAttributes] = None, tags: Optional[Dict[str, str]] = None
|
|
723
|
-
|
|
782
|
+
officer: Optional[UpdateBusinessAttributes] = None, tags: Optional[Dict[str, str]] = None,
|
|
783
|
+
operating_address: Optional[Address] = None):
|
|
784
|
+
super().__init__(application_id, "businessApplication", tags=tags, operating_address=operating_address)
|
|
724
785
|
self.annual_revenue = annual_revenue
|
|
725
786
|
self.number_of_employees = number_of_employees
|
|
726
787
|
self.cash_flow = cash_flow
|
|
@@ -732,18 +793,21 @@ class PatchBusinessApplicationRequest(PatchApplicationRequest):
|
|
|
732
793
|
|
|
733
794
|
|
|
734
795
|
class PatchIndividualThreadApplicationRequest(PatchApplicationRequest):
|
|
735
|
-
def __init__(self, application_id: str, tags: Optional[Dict[str, str]] = None
|
|
736
|
-
|
|
796
|
+
def __init__(self, application_id: str, tags: Optional[Dict[str, str]] = None,
|
|
797
|
+
operating_address: Optional[Address] = None):
|
|
798
|
+
super().__init__(application_id, "individualApplication", tags=tags, operating_address=operating_address)
|
|
737
799
|
|
|
738
800
|
|
|
739
801
|
class PatchSoleProprietorThreadApplicationRequest(PatchApplicationRequest):
|
|
740
|
-
def __init__(self, application_id: str, tags: Optional[Dict[str, str]] = None
|
|
741
|
-
|
|
802
|
+
def __init__(self, application_id: str, tags: Optional[Dict[str, str]] = None,
|
|
803
|
+
operating_address: Optional[Address] = None):
|
|
804
|
+
super().__init__(application_id, "individualApplication", tags=tags, operating_address=operating_address)
|
|
742
805
|
|
|
743
806
|
|
|
744
807
|
class PatchBusinessThreadApplicationRequest(PatchApplicationRequest):
|
|
745
|
-
def __init__(self, application_id: str, tags: Optional[Dict[str, str]] = None
|
|
746
|
-
|
|
808
|
+
def __init__(self, application_id: str, tags: Optional[Dict[str, str]] = None,
|
|
809
|
+
operating_address: Optional[Address] = None):
|
|
810
|
+
super().__init__(application_id, "businessApplication", tags=tags, operating_address=operating_address)
|
|
747
811
|
|
|
748
812
|
|
|
749
813
|
UnionPatchApplicationRequest = Union[PatchApplicationRequest, PatchIndividualApplicationRequest,
|
|
@@ -754,6 +818,122 @@ UnionPatchThreadApplicationRequest = Union[PatchIndividualThreadApplicationReque
|
|
|
754
818
|
PatchBusinessThreadApplicationRequest]
|
|
755
819
|
|
|
756
820
|
|
|
821
|
+
class UpgradeIndividualToThreadApplicationRequest(UnitRequest):
|
|
822
|
+
def __init__(self, application_id: str,
|
|
823
|
+
tags: Optional[Dict[str, str]] = None,
|
|
824
|
+
account_purpose: Optional[ThreadApplicationIndividualAccountPurpose] = None,
|
|
825
|
+
account_purpose_description: Optional[str] = None,
|
|
826
|
+
source_of_funds: Optional[ThreadApplicationIndividualSourceOfFunds] = None,
|
|
827
|
+
transaction_volume: Optional[ThreadApplicationIndividualTransactionVolume] = None,
|
|
828
|
+
transaction_volume_description: Optional[str] = None,
|
|
829
|
+
profession: Optional[ThreadApplicationProfession] = None):
|
|
830
|
+
self.application_id = application_id
|
|
831
|
+
self.tags = tags
|
|
832
|
+
self.account_purpose = account_purpose
|
|
833
|
+
self.account_purpose_description = account_purpose_description
|
|
834
|
+
self.source_of_funds = source_of_funds
|
|
835
|
+
self.transaction_volume = transaction_volume
|
|
836
|
+
self.transaction_volume_description = transaction_volume_description
|
|
837
|
+
self.profession = profession
|
|
838
|
+
|
|
839
|
+
def to_json_api(self) -> Dict:
|
|
840
|
+
return super().to_payload("individualApplication", ignore=['application_id'])
|
|
841
|
+
|
|
842
|
+
def __repr__(self):
|
|
843
|
+
return json.dumps(self.to_json_api())
|
|
844
|
+
|
|
845
|
+
|
|
846
|
+
class UpgradeSoleProprietorToThreadApplicationRequest(UnitRequest):
|
|
847
|
+
def __init__(self, application_id: str,
|
|
848
|
+
tags: Optional[Dict[str, str]] = None,
|
|
849
|
+
website: Optional[str] = None,
|
|
850
|
+
source_of_funds: Optional[ThreadApplicationBusinessSourceOfFunds] = None,
|
|
851
|
+
source_of_funds_description: Optional[str] = None,
|
|
852
|
+
business_industry: Optional[ThreadApplicationBusinessIndustry] = None,
|
|
853
|
+
is_incorporated: Optional[bool] = None,
|
|
854
|
+
state_of_incorporation: Optional[str] = None,
|
|
855
|
+
year_of_incorporation: Optional[str] = None,
|
|
856
|
+
countries_of_operation: Optional[List[str]] = None,
|
|
857
|
+
us_nexus: Optional[List[ThreadApplicationUSNexus]] = None,
|
|
858
|
+
transaction_volume: Optional[ThreadApplicationSoleProprietorTransactionVolume] = None,
|
|
859
|
+
transaction_volume_description: Optional[str] = None,
|
|
860
|
+
account_purpose: Optional[ThreadApplicationBusinessAccountPurpose] = None,
|
|
861
|
+
account_purpose_description: Optional[str] = None):
|
|
862
|
+
self.application_id = application_id
|
|
863
|
+
self.tags = tags
|
|
864
|
+
self.website = website
|
|
865
|
+
self.source_of_funds = source_of_funds
|
|
866
|
+
self.source_of_funds_description = source_of_funds_description
|
|
867
|
+
self.business_industry = business_industry
|
|
868
|
+
self.is_incorporated = is_incorporated
|
|
869
|
+
self.state_of_incorporation = state_of_incorporation
|
|
870
|
+
self.year_of_incorporation = year_of_incorporation
|
|
871
|
+
self.countries_of_operation = countries_of_operation
|
|
872
|
+
self.us_nexus = us_nexus
|
|
873
|
+
self.transaction_volume = transaction_volume
|
|
874
|
+
self.transaction_volume_description = transaction_volume_description
|
|
875
|
+
self.account_purpose = account_purpose
|
|
876
|
+
self.account_purpose_description = account_purpose_description
|
|
877
|
+
|
|
878
|
+
def to_json_api(self) -> Dict:
|
|
879
|
+
return super().to_payload("individualApplication", ignore=['application_id'])
|
|
880
|
+
|
|
881
|
+
def __repr__(self):
|
|
882
|
+
return json.dumps(self.to_json_api())
|
|
883
|
+
|
|
884
|
+
|
|
885
|
+
class UpgradeBusinessToThreadApplicationRequest(UnitRequest):
|
|
886
|
+
def __init__(self, application_id: str,
|
|
887
|
+
tags: Optional[Dict[str, str]] = None,
|
|
888
|
+
source_of_funds: Optional[ThreadApplicationBusinessSourceOfFunds] = None,
|
|
889
|
+
source_of_funds_description: Optional[str] = None,
|
|
890
|
+
business_industry: Optional[ThreadApplicationBusinessIndustry] = None,
|
|
891
|
+
business_description: Optional[str] = None,
|
|
892
|
+
is_regulated: Optional[bool] = None,
|
|
893
|
+
regulator_name: Optional[str] = None,
|
|
894
|
+
us_nexus: Optional[List[ThreadApplicationUSNexus]] = None,
|
|
895
|
+
account_purpose: Optional[ThreadApplicationBusinessAccountPurpose] = None,
|
|
896
|
+
account_purpose_description: Optional[str] = None,
|
|
897
|
+
transaction_volume: Optional[ThreadApplicationBusinessTransactionVolume] = None,
|
|
898
|
+
transaction_volume_description: Optional[str] = None,
|
|
899
|
+
stock_exchange_name: Optional[str] = None,
|
|
900
|
+
stock_symbol: Optional[str] = None,
|
|
901
|
+
countries_of_operation: Optional[List[str]] = None,
|
|
902
|
+
year_of_incorporation: Optional[str] = None,
|
|
903
|
+
entity_type: Optional[ThreadApplicationEntityType] = None,
|
|
904
|
+
website: Optional[str] = None):
|
|
905
|
+
self.application_id = application_id
|
|
906
|
+
self.tags = tags
|
|
907
|
+
self.source_of_funds = source_of_funds
|
|
908
|
+
self.source_of_funds_description = source_of_funds_description
|
|
909
|
+
self.business_industry = business_industry
|
|
910
|
+
self.business_description = business_description
|
|
911
|
+
self.is_regulated = is_regulated
|
|
912
|
+
self.regulator_name = regulator_name
|
|
913
|
+
self.us_nexus = us_nexus
|
|
914
|
+
self.account_purpose = account_purpose
|
|
915
|
+
self.account_purpose_description = account_purpose_description
|
|
916
|
+
self.transaction_volume = transaction_volume
|
|
917
|
+
self.transaction_volume_description = transaction_volume_description
|
|
918
|
+
self.stock_exchange_name = stock_exchange_name
|
|
919
|
+
self.stock_symbol = stock_symbol
|
|
920
|
+
self.countries_of_operation = countries_of_operation
|
|
921
|
+
self.year_of_incorporation = year_of_incorporation
|
|
922
|
+
self.entity_type = entity_type
|
|
923
|
+
self.website = website
|
|
924
|
+
|
|
925
|
+
def to_json_api(self) -> Dict:
|
|
926
|
+
return super().to_payload("businessApplication", ignore=['application_id'])
|
|
927
|
+
|
|
928
|
+
def __repr__(self):
|
|
929
|
+
return json.dumps(self.to_json_api())
|
|
930
|
+
|
|
931
|
+
|
|
932
|
+
UpgradeToThreadApplicationRequest = Union[UpgradeIndividualToThreadApplicationRequest,
|
|
933
|
+
UpgradeSoleProprietorToThreadApplicationRequest,
|
|
934
|
+
UpgradeBusinessToThreadApplicationRequest]
|
|
935
|
+
|
|
936
|
+
|
|
757
937
|
class CancelApplicationRequest(UnitRequest):
|
|
758
938
|
def __init__(self, application_id: str, reason: str):
|
|
759
939
|
self.application_id = application_id
|
|
@@ -4,7 +4,8 @@ from typing import Dict
|
|
|
4
4
|
|
|
5
5
|
from unit.models import BeneficialOwnerDTO, RelationshipArray, Relationship, RawUnitObject
|
|
6
6
|
from unit.models.applicationForm import ApplicationFormDTO
|
|
7
|
-
from unit.models.application import IndividualApplicationDTO, BusinessApplicationDTO, ApplicationDocumentDTO
|
|
7
|
+
from unit.models.application import IndividualApplicationDTO, BusinessApplicationDTO, ApplicationDocumentDTO, \
|
|
8
|
+
IndividualApplicationMissingFieldsDTO, BusinessApplicationMissingFieldsDTO
|
|
8
9
|
from unit.models.account import DepositAccountDTO, AccountDepositProductDTO, CreditAccountDTO, \
|
|
9
10
|
CreditAccountLimitsDTO, DepositAccountLimitsDTO
|
|
10
11
|
from unit.models.check_payment import CheckPaymentDTO
|
|
@@ -191,7 +192,13 @@ mappings = {
|
|
|
191
192
|
TaxFormDTO.from_json_api(_id, _type, attributes, relationships),
|
|
192
193
|
|
|
193
194
|
"batchRelease": lambda _id, _type, attributes, relationships:
|
|
194
|
-
BatchReleaseDTO.from_json_api(_id, _type, attributes, relationships)
|
|
195
|
+
BatchReleaseDTO.from_json_api(_id, _type, attributes, relationships),
|
|
196
|
+
|
|
197
|
+
"individualApplicationMissingFields": lambda _id, _type, attributes, relationships:
|
|
198
|
+
IndividualApplicationMissingFieldsDTO.from_json_api(_id, _type, attributes, relationships),
|
|
199
|
+
|
|
200
|
+
"businessApplicationMissingFields": lambda _id, _type, attributes, relationships:
|
|
201
|
+
BusinessApplicationMissingFieldsDTO.from_json_api(_id, _type, attributes, relationships)
|
|
195
202
|
}
|
|
196
203
|
|
|
197
204
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: unit-python-sdk
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: This library provides a python wrapper to http://unit.co API. See https://docs.unit.co/
|
|
5
5
|
Home-page: https://github.com/unit-finance/unit-python-sdk
|
|
6
6
|
Download-URL: https://github.com/unit-finance/unit-python-sdk.git
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{unit_python_sdk-1.1.1 → unit_python_sdk-1.2.0}/unit_python_sdk.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|