@@ -86,17 +86,33 @@ def get_user_by_id(
8686
8787 def find_user (
8888 self ,
89- username : str ,
89+ user_id : Optional [Union [str , uuid .UUID ]] = None ,
90+ email : Optional [str ] = None ,
91+ username : Optional [str ] = None ,
92+ application_id : Optional [Union [str , uuid .UUID ]] = None ,
9093 token : Optional [Union [str , uuid .UUID ]] = None ,
9194 ** kwargs : Dict [str , Any ],
9295 ) -> BugoutUser :
93- find_user_path = f"user/find?username={ username } "
96+ find_user_path = f"user/find"
97+
98+ query_params = {}
99+ if user_id is not None :
100+ query_params .update ({"user_id" : str (user_id )})
101+ if email is not None :
102+ query_params .update ({"email" : email })
103+ if username is not None :
104+ query_params .update ({"username" : username })
105+ if application_id is not None :
106+ query_params .update ({"application_id" : str (application_id )})
107+
94108 headers = {}
95109 if token is not None :
96110 headers .update ({"Authorization" : f"Bearer { token } " })
97111 if "headers" in kwargs .keys ():
98112 headers .update (kwargs ["headers" ])
99- result = self ._call (method = Method .get , path = find_user_path , headers = headers )
113+ result = self ._call (
114+ method = Method .get , path = find_user_path , params = query_params , headers = headers
115+ )
100116 return BugoutUser (** result )
101117
102118 def confirm_email (
0 commit comments