11from unit .models import *
22
3+
34class CustomerTokenDTO (object ):
45 def __init__ (self , token : str , expires_in : int ):
56 self .type = "customerBearerToken"
@@ -9,6 +10,7 @@ def __init__(self, token: str, expires_in: int):
910 def from_json_api (_id , _type , attributes , relationships ):
1011 return CustomerTokenDTO (attributes ["token" ], attributes ["expiresIn" ])
1112
13+
1214class CustomerVerificationTokenDTO (object ):
1315 def __init__ (self , verification_token : str ):
1416 self .type = "customerTokenVerification"
@@ -22,13 +24,13 @@ def from_json_api(_id, _type, attributes, relationships):
2224class CreateCustomerToken (UnitRequest ):
2325 def __init__ (self , customer_id : str , scope : str , verification_token : Optional [str ] = None ,
2426 verification_code : Optional [str ] = None , expires_in : Optional [int ] = None ,
25- jwt_subject : Optional [str ] = None ):
27+ jwt_token : Optional [str ] = None ):
2628 self .customer_id = customer_id
2729 self .scope = scope
2830 self .verification_token = verification_token
2931 self .verification_code = verification_code
3032 self .expires_in = expires_in
31- self .jwt_subject = jwt_subject
33+ self .jwt_token = jwt_token
3234
3335 def to_json_api (self ) -> Dict :
3436 payload = {
@@ -49,8 +51,8 @@ def to_json_api(self) -> Dict:
4951 if self .verification_code :
5052 payload ["data" ]["attributes" ]["verificationCode" ] = self .verification_code
5153
52- if self .jwt_subject :
53- payload ["data" ]["attributes" ]["jwtSubject " ] = self .jwt_subject
54+ if self .jwt_token :
55+ payload ["data" ]["attributes" ]["jwtToken " ] = self .jwt_token
5456
5557 return payload
5658
0 commit comments