@@ -176,13 +176,9 @@ def update_token(
176176 raise TokenInvalidParameters (
177177 "In order to update token, at least one of token_type, or token_note must be specified"
178178 )
179- if token_type is not None and token_type not in TokenType .__members__ :
180- raise TokenInvalidParameters (
181- "Incorrect token type provided, check types at get_token_types()"
182- )
183179 data : Dict [str , Any ] = {"access_token" : token }
184180 if token_type is not None :
185- data .update ({"token_type" : token_type })
181+ data .update ({"token_type" : token_type . value })
186182 if token_note is not None :
187183 data .update ({"token_note" : token_note })
188184
@@ -209,16 +205,12 @@ def get_user_tokens(
209205 headers = {
210206 "Authorization" : f"Bearer { token } " ,
211207 }
212- if token_type is not None and token_type not in TokenType .__members__ :
213- raise TokenInvalidParameters (
214- "Incorrect token type provided, check types at get_token_types()"
215- )
216208 if active is not None and token_type is None :
217209 get_user_tokens_path += f"?active={ active } "
218210 elif active is None and token_type is not None :
219- get_user_tokens_path += f"?token_type={ token_type } "
211+ get_user_tokens_path += f"?token_type={ token_type . value } "
220212 elif active is not None and token_type is not None :
221- get_user_tokens_path += f"?active={ active } &token_type={ token_type } "
213+ get_user_tokens_path += f"?active={ active } &token_type={ token_type . value } "
222214 result = self ._call (
223215 method = Method .get , path = get_user_tokens_path , headers = headers
224216 )
0 commit comments