Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from flask_restx import Namespace, fields 

2from .base import ExternalBaseObj, messageObj 

3 

4 

5 

6class ExternalDto: 

7 api = Namespace( 

8 "external", description="External services related operations.") 

9 

10 # Objects 

11 api.models[ExternalBaseObj.name] = ExternalBaseObj 

12 external_base = ExternalBaseObj 

13 

14 # Responses 

15 oauth_url = api.model( 

16 "External service auth success response", 

17 { 

18 **messageObj, 

19 "url": fields.String, 

20 }, 

21 ) 

22 

23 # Expected tmdb data 

24 oauth_spotify_callback = api.model( 

25 "ExternalDataExpected", 

26 { 

27 "state": fields.String(min=300,max=350), 

28 "code": fields.String(min=10, max=350), 

29 }, 

30 ) 

31 

32 # Expected tmdb data 

33 oauth_tmdb_callback = api.model( 

34 "ExternalDataExpected", 

35 { 

36 "request_token" : fields.String(min=10, max=350), 

37 "approved" : fields.String(min=4,max=5), 

38 "denied" : fields.String(min=4,max=5) 

39 }, 

40 ) 

41 

42 # Expected data 

43 oauth_gbooks_callback = api.model( 

44 "ExternalDataExpected", 

45 { 

46 "state" : fields.String(min=300, max=350), 

47 "code" : fields.String(min=50, max=85), 

48 "scope" : fields.String(min=38, max=38) #"https://www.googleapis.com/auth/books" 

49 }, 

50 )