44ArchiveReason = Literal ["Inactive" , "FraudACHActivity" , "FraudCardActivity" , "FraudCheckActivity" ,
55 "FraudApplicationHistory" , "FraudAccountActivity" , "FraudClientIdentified" ]
66
7+ CustomerStatus = Literal ["Active" , "Archived" ]
8+
9+
710class IndividualCustomerDTO (object ):
811 def __init__ (self , id : str , created_at : datetime , full_name : FullName , date_of_birth : date , address : Address ,
912 phone : Phone , email : str , ssn : Optional [str ], passport : Optional [str ], nationality : Optional [str ],
10- tags : Optional [Dict [str , str ]], relationships : Optional [Dict [str , Relationship ]]):
13+ tags : Optional [Dict [str , str ]], relationships : Optional [Dict [str , Relationship ]],
14+ authorized_users : Optional [List [AuthorizedUser ]], status : CustomerStatus ,
15+ archive_reason : Optional [ArchiveReason ]):
1116 self .id = id
1217 self .type = 'individualCustomer'
1318 self .attributes = {"createdAt" : created_at , "fullName" : full_name , "dateOfBirth" : date_of_birth ,
1419 "address" : address , "phone" : phone , "email" : email , "ssn" : ssn , "passport" : passport ,
15- "nationality" : nationality , "tags" : tags }
20+ "status" : status , "archiveReason" : archive_reason , "nationality" : nationality ,
21+ "authorizedUsers" : authorized_users , "tags" : tags }
1622 self .relationships = relationships
1723
1824 @staticmethod
@@ -22,20 +28,24 @@ def from_json_api(_id, _type, attributes, relationships):
2228 FullName .from_json_api (attributes ["fullName" ]), date_utils .to_date (attributes ["dateOfBirth" ]),
2329 Address .from_json_api (attributes ["address" ]), Phone .from_json_api (attributes ["phone" ]),
2430 attributes ["email" ], attributes .get ("ssn" ), attributes .get ("passport" ), attributes .get ("nationality" ),
25- attributes .get ("tags" ), relationships
31+ attributes .get ("tags" ), relationships ,
32+ AuthorizedUser .from_json_api (attributes .get ("authorizedUsers" )), attributes .get ("status" ),
33+ attributes .get ("archiveReason" )
2634 )
2735
2836
2937class BusinessCustomerDTO (object ):
3038 def __init__ (self , id : str , created_at : datetime , name : str , address : Address , phone : Phone ,
3139 state_of_incorporation : str , ein : str , entity_type : EntityType , contact : BusinessContact ,
32- authorized_users : [AuthorizedUser ], dba : Optional [str ], tags : Optional [Dict [str , str ]],
33- relationships : Optional [Dict [str , Relationship ]]):
40+ authorized_users : Optional [List [AuthorizedUser ]], dba : Optional [str ], tags : Optional [Dict [str , str ]],
41+ relationships : Optional [Dict [str , Relationship ]], status : CustomerStatus ,
42+ archive_reason : Optional [ArchiveReason ]):
3443 self .id = id
3544 self .type = 'businessCustomer'
3645 self .attributes = {"createdAt" : created_at , "name" : name , "address" : address , "phone" : phone ,
3746 "stateOfIncorporation" : state_of_incorporation , "ein" : ein , "entityType" : entity_type ,
38- "contact" : contact , "authorizedUsers" : authorized_users , "dba" : dba , "tags" : tags }
47+ "contact" : contact , "authorizedUsers" : authorized_users , "dba" : dba , "tags" : tags ,
48+ "status" : status , "archiveReason" : archive_reason }
3949 self .relationships = relationships
4050
4151 @staticmethod
@@ -45,21 +55,25 @@ def from_json_api(_id, _type, attributes, relationships):
4555 Address .from_json_api (attributes ["address" ]), Phone .from_json_api (attributes ["phone" ]),
4656 attributes ["stateOfIncorporation" ], attributes ["ein" ], attributes ["entityType" ],
4757 BusinessContact .from_json_api (attributes ["contact" ]),
48- [AuthorizedUser .from_json_api (user ) for user in attributes ["authorizedUsers" ]],
49- attributes .get ("dba" ), attributes .get ("tags" ), relationships )
58+ AuthorizedUser .from_json_api (attributes .get ("authorizedUsers" )),
59+ attributes .get ("dba" ), attributes .get ("tags" ), relationships , attributes .get ("status" ),
60+ attributes .get ("archiveReason" ))
5061
5162CustomerDTO = Union [IndividualCustomerDTO , BusinessCustomerDTO ]
5263
5364
5465class PatchIndividualCustomerRequest (UnitRequest ):
5566 def __init__ (self , customer_id : str , address : Optional [Address ] = None , phone : Optional [Phone ] = None ,
56- email : Optional [str ] = None , dba : Optional [str ] = None , tags : Optional [Dict [str , str ]] = None ):
67+ email : Optional [str ] = None , dba : Optional [str ] = None , tags : Optional [Dict [str , str ]] = None ,
68+ jwt_subject : Optional [str ] = None , authorized_users : Optional [AuthorizedUser ] = None ):
5769 self .customer_id = customer_id
5870 self .address = address
5971 self .phone = phone
6072 self .email = email
6173 self .dba = dba
6274 self .tags = tags
75+ self .jwt_subject = jwt_subject
76+ self .authorized_users = authorized_users
6377
6478 def to_json_api (self ) -> Dict :
6579 payload = {
@@ -84,6 +98,12 @@ def to_json_api(self) -> Dict:
8498 if self .tags :
8599 payload ["data" ]["attributes" ]["tags" ] = self .tags
86100
101+ if self .jwt_subject :
102+ payload ["data" ]["attributes" ]["jwtSubject" ] = self .jwt_subject
103+
104+ if self .authorized_users :
105+ payload ["data" ]["attributes" ]["authorizedUsers" ] = self .authorized_users
106+
87107 return payload
88108
89109 def __repr__ (self ):
0 commit comments