Skip to content

Commit ed366d2

Browse files
committed
feat: add optional jwt_token field to CreateCustomerToken DTO
1 parent d1aa75e commit ed366d2

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

unit/models/customerToken.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ def from_json_api(_id, _type, attributes, relationships):
2121

2222
class CreateCustomerToken(UnitRequest):
2323
def __init__(self, customer_id: str, scope: str, verification_token: Optional[str] = None,
24-
verification_code: Optional[str] = None, expires_in: Optional[int] = None):
24+
verification_code: Optional[str] = None, expires_in: Optional[int] = None, jwt_token: Optional[str] = None):
2525
self.customer_id = customer_id
2626
self.scope = scope
2727
self.verification_token = verification_token
2828
self.verification_code = verification_code
2929
self.expires_in = expires_in
30+
self.jwt_token = jwt_token
3031

3132
def to_json_api(self) -> Dict:
3233
payload = {
@@ -47,6 +48,9 @@ def to_json_api(self) -> Dict:
4748
if self.verification_code:
4849
payload["data"]["attributes"]["verificationCode"] = self.verification_code
4950

51+
if self.jwt_token:
52+
payload["data"]["attributes"]["jwtToken"] = self.jwt_token
53+
5054
return payload
5155

5256
def __repr__(self):

0 commit comments

Comments
 (0)