plex-api-client 0.5.0__tar.gz → 0.6.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. {plex-api-client-0.5.0/src/plex_api_client.egg-info → plex-api-client-0.6.1}/PKG-INFO +79 -79
  2. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/README.md +2 -2
  3. plex-api-client-0.6.1/setup.py +53 -0
  4. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/_hooks/sdkhooks.py +10 -8
  5. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/_hooks/types.py +7 -3
  6. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/activities.py +28 -30
  7. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/authentication.py +27 -29
  8. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/butler.py +67 -72
  9. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/hubs.py +29 -31
  10. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/library.py +150 -161
  11. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/log.py +40 -43
  12. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/media.py +40 -43
  13. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/playlists.py +123 -132
  14. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/plex.py +28 -30
  15. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/sdk.py +3 -2
  16. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/sdkconfiguration.py +9 -9
  17. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/search.py +41 -44
  18. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/server.py +112 -120
  19. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/sessions.py +56 -60
  20. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/statistics.py +15 -16
  21. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/updater.py +41 -44
  22. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/utils/retries.py +2 -2
  23. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/video.py +27 -29
  24. {plex-api-client-0.5.0 → plex-api-client-0.6.1/src/plex_api_client.egg-info}/PKG-INFO +79 -79
  25. plex-api-client-0.5.0/setup.py +0 -43
  26. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/LICENSE.md +0 -0
  27. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/setup.cfg +0 -0
  28. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/__init__.py +0 -0
  29. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/_hooks/__init__.py +0 -0
  30. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/_hooks/registration.py +0 -0
  31. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/__init__.py +0 -0
  32. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/components/__init__.py +0 -0
  33. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/components/security.py +0 -0
  34. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/__init__.py +0 -0
  35. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/addplaylistcontents.py +0 -0
  36. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/applyupdates.py +0 -0
  37. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/cancelserveractivities.py +0 -0
  38. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/checkforupdates.py +0 -0
  39. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/clearplaylistcontents.py +0 -0
  40. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/createplaylist.py +0 -0
  41. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/deletelibrary.py +0 -0
  42. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/deleteplaylist.py +0 -0
  43. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/enablepapertrail.py +0 -0
  44. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getavailableclients.py +0 -0
  45. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getbutlertasks.py +0 -0
  46. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getdevices.py +0 -0
  47. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getfilehash.py +0 -0
  48. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getglobalhubs.py +0 -0
  49. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getlibraries.py +0 -0
  50. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getlibrary.py +0 -0
  51. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getlibraryhubs.py +0 -0
  52. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getmetadata.py +0 -0
  53. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getmetadatachildren.py +0 -0
  54. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getmyplexaccount.py +0 -0
  55. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getondeck.py +0 -0
  56. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getpin.py +0 -0
  57. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getplaylist.py +0 -0
  58. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getplaylistcontents.py +0 -0
  59. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getplaylists.py +0 -0
  60. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getrecentlyadded.py +0 -0
  61. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getresizedphoto.py +0 -0
  62. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getsearchresults.py +0 -0
  63. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getserveractivities.py +0 -0
  64. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getservercapabilities.py +0 -0
  65. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getserveridentity.py +0 -0
  66. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getserverlist.py +0 -0
  67. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getserverpreferences.py +0 -0
  68. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getsessionhistory.py +0 -0
  69. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getsessions.py +0 -0
  70. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getsourceconnectioninformation.py +0 -0
  71. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getstatistics.py +0 -0
  72. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/gettimeline.py +0 -0
  73. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/gettoken.py +0 -0
  74. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/gettranscodesessions.py +0 -0
  75. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/gettransienttoken.py +0 -0
  76. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/getupdatestatus.py +0 -0
  77. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/logline.py +0 -0
  78. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/logmultiline.py +0 -0
  79. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/markplayed.py +0 -0
  80. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/markunplayed.py +0 -0
  81. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/performsearch.py +0 -0
  82. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/performvoicesearch.py +0 -0
  83. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/refreshlibrary.py +0 -0
  84. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/sdkerror.py +0 -0
  85. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/startalltasks.py +0 -0
  86. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/starttask.py +0 -0
  87. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/startuniversaltranscode.py +0 -0
  88. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/stopalltasks.py +0 -0
  89. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/stoptask.py +0 -0
  90. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/stoptranscodesession.py +0 -0
  91. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/updateplaylist.py +0 -0
  92. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/updateplayprogress.py +0 -0
  93. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/errors/uploadplaylist.py +0 -0
  94. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/__init__.py +0 -0
  95. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/addplaylistcontents.py +0 -0
  96. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/applyupdates.py +0 -0
  97. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/cancelserveractivities.py +0 -0
  98. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/checkforupdates.py +0 -0
  99. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/clearplaylistcontents.py +0 -0
  100. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/createplaylist.py +0 -0
  101. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/deletelibrary.py +0 -0
  102. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/deleteplaylist.py +0 -0
  103. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/enablepapertrail.py +0 -0
  104. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getavailableclients.py +0 -0
  105. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getbutlertasks.py +0 -0
  106. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getdevices.py +0 -0
  107. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getfilehash.py +0 -0
  108. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getglobalhubs.py +0 -0
  109. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getlibraries.py +0 -0
  110. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getlibrary.py +0 -0
  111. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getlibraryhubs.py +0 -0
  112. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getlibraryitems.py +0 -0
  113. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getmetadata.py +0 -0
  114. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getmetadatachildren.py +0 -0
  115. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getmyplexaccount.py +0 -0
  116. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getondeck.py +0 -0
  117. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getpin.py +0 -0
  118. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getplaylist.py +0 -0
  119. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getplaylistcontents.py +0 -0
  120. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getplaylists.py +0 -0
  121. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getrecentlyadded.py +0 -0
  122. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getresizedphoto.py +0 -0
  123. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getsearchresults.py +0 -0
  124. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getserveractivities.py +0 -0
  125. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getservercapabilities.py +0 -0
  126. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getserveridentity.py +0 -0
  127. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getserverlist.py +0 -0
  128. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getserverpreferences.py +0 -0
  129. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getsessionhistory.py +0 -0
  130. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getsessions.py +0 -0
  131. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getsourceconnectioninformation.py +0 -0
  132. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getstatistics.py +0 -0
  133. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/gettimeline.py +0 -0
  134. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/gettoken.py +0 -0
  135. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/gettranscodesessions.py +0 -0
  136. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/gettransienttoken.py +0 -0
  137. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/getupdatestatus.py +0 -0
  138. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/logline.py +0 -0
  139. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/logmultiline.py +0 -0
  140. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/markplayed.py +0 -0
  141. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/markunplayed.py +0 -0
  142. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/performsearch.py +0 -0
  143. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/performvoicesearch.py +0 -0
  144. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/refreshlibrary.py +0 -0
  145. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/searchlibrary.py +0 -0
  146. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/startalltasks.py +0 -0
  147. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/starttask.py +0 -0
  148. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/startuniversaltranscode.py +0 -0
  149. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/stopalltasks.py +0 -0
  150. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/stoptask.py +0 -0
  151. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/stoptranscodesession.py +0 -0
  152. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/updateplaylist.py +0 -0
  153. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/updateplayprogress.py +0 -0
  154. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/models/operations/uploadplaylist.py +0 -0
  155. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/utils/__init__.py +0 -0
  156. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api/utils/utils.py +0 -0
  157. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api_client.egg-info/SOURCES.txt +0 -0
  158. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api_client.egg-info/dependency_links.txt +0 -0
  159. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api_client.egg-info/requires.txt +0 -0
  160. {plex-api-client-0.5.0 → plex-api-client-0.6.1}/src/plex_api_client.egg-info/top_level.txt +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: plex-api-client
3
- Version: 0.5.0
3
+ Version: 0.6.1
4
4
  Summary: Python Client SDK Generated by Speakeasy
5
- Home-page: UNKNOWN
5
+ Home-page: https://github.com/LukeHagar/plexpy.git
6
6
  Author: LukeHagar
7
7
  License: UNKNOWN
8
8
  Description: # plexpy
@@ -48,110 +48,110 @@ Description: # plexpy
48
48
  <!-- Start Available Resources and Operations [operations] -->
49
49
  ## Available Resources and Operations
50
50
 
51
- ### [server](docs/sdks/server/README.md)
51
+ ### [server](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md)
52
52
 
53
- * [get_server_capabilities](docs/sdks/server/README.md#get_server_capabilities) - Server Capabilities
54
- * [get_server_preferences](docs/sdks/server/README.md#get_server_preferences) - Get Server Preferences
55
- * [get_available_clients](docs/sdks/server/README.md#get_available_clients) - Get Available Clients
56
- * [get_devices](docs/sdks/server/README.md#get_devices) - Get Devices
57
- * [get_server_identity](docs/sdks/server/README.md#get_server_identity) - Get Server Identity
58
- * [get_my_plex_account](docs/sdks/server/README.md#get_my_plex_account) - Get MyPlex Account
59
- * [get_resized_photo](docs/sdks/server/README.md#get_resized_photo) - Get a Resized Photo
60
- * [get_server_list](docs/sdks/server/README.md#get_server_list) - Get Server List
53
+ * [get_server_capabilities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_capabilities) - Server Capabilities
54
+ * [get_server_preferences](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_preferences) - Get Server Preferences
55
+ * [get_available_clients](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_available_clients) - Get Available Clients
56
+ * [get_devices](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_devices) - Get Devices
57
+ * [get_server_identity](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_identity) - Get Server Identity
58
+ * [get_my_plex_account](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_my_plex_account) - Get MyPlex Account
59
+ * [get_resized_photo](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_resized_photo) - Get a Resized Photo
60
+ * [get_server_list](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/server/README.md#get_server_list) - Get Server List
61
61
 
62
- ### [media](docs/sdks/media/README.md)
62
+ ### [media](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md)
63
63
 
64
- * [mark_played](docs/sdks/media/README.md#mark_played) - Mark Media Played
65
- * [mark_unplayed](docs/sdks/media/README.md#mark_unplayed) - Mark Media Unplayed
66
- * [update_play_progress](docs/sdks/media/README.md#update_play_progress) - Update Media Play Progress
64
+ * [mark_played](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md#mark_played) - Mark Media Played
65
+ * [mark_unplayed](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md#mark_unplayed) - Mark Media Unplayed
66
+ * [update_play_progress](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/media/README.md#update_play_progress) - Update Media Play Progress
67
67
 
68
- ### [video](docs/sdks/video/README.md)
68
+ ### [video](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/video/README.md)
69
69
 
70
- * [get_timeline](docs/sdks/video/README.md#get_timeline) - Get the timeline for a media item
71
- * [start_universal_transcode](docs/sdks/video/README.md#start_universal_transcode) - Start Universal Transcode
70
+ * [get_timeline](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/video/README.md#get_timeline) - Get the timeline for a media item
71
+ * [start_universal_transcode](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/video/README.md#start_universal_transcode) - Start Universal Transcode
72
72
 
73
- ### [activities](docs/sdks/activities/README.md)
73
+ ### [activities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/activities/README.md)
74
74
 
75
- * [get_server_activities](docs/sdks/activities/README.md#get_server_activities) - Get Server Activities
76
- * [cancel_server_activities](docs/sdks/activities/README.md#cancel_server_activities) - Cancel Server Activities
75
+ * [get_server_activities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/activities/README.md#get_server_activities) - Get Server Activities
76
+ * [cancel_server_activities](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/activities/README.md#cancel_server_activities) - Cancel Server Activities
77
77
 
78
- ### [butler](docs/sdks/butler/README.md)
78
+ ### [butler](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md)
79
79
 
80
- * [get_butler_tasks](docs/sdks/butler/README.md#get_butler_tasks) - Get Butler tasks
81
- * [start_all_tasks](docs/sdks/butler/README.md#start_all_tasks) - Start all Butler tasks
82
- * [stop_all_tasks](docs/sdks/butler/README.md#stop_all_tasks) - Stop all Butler tasks
83
- * [start_task](docs/sdks/butler/README.md#start_task) - Start a single Butler task
84
- * [stop_task](docs/sdks/butler/README.md#stop_task) - Stop a single Butler task
80
+ * [get_butler_tasks](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#get_butler_tasks) - Get Butler tasks
81
+ * [start_all_tasks](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#start_all_tasks) - Start all Butler tasks
82
+ * [stop_all_tasks](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#stop_all_tasks) - Stop all Butler tasks
83
+ * [start_task](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#start_task) - Start a single Butler task
84
+ * [stop_task](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/butler/README.md#stop_task) - Stop a single Butler task
85
85
 
86
- ### [hubs](docs/sdks/hubs/README.md)
86
+ ### [hubs](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/hubs/README.md)
87
87
 
88
- * [get_global_hubs](docs/sdks/hubs/README.md#get_global_hubs) - Get Global Hubs
89
- * [get_library_hubs](docs/sdks/hubs/README.md#get_library_hubs) - Get library specific hubs
88
+ * [get_global_hubs](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/hubs/README.md#get_global_hubs) - Get Global Hubs
89
+ * [get_library_hubs](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/hubs/README.md#get_library_hubs) - Get library specific hubs
90
90
 
91
- ### [search](docs/sdks/search/README.md)
91
+ ### [search](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md)
92
92
 
93
- * [perform_search](docs/sdks/search/README.md#perform_search) - Perform a search
94
- * [perform_voice_search](docs/sdks/search/README.md#perform_voice_search) - Perform a voice search
95
- * [get_search_results](docs/sdks/search/README.md#get_search_results) - Get Search Results
93
+ * [perform_search](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md#perform_search) - Perform a search
94
+ * [perform_voice_search](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md#perform_voice_search) - Perform a voice search
95
+ * [get_search_results](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/search/README.md#get_search_results) - Get Search Results
96
96
 
97
- ### [library](docs/sdks/library/README.md)
97
+ ### [library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md)
98
98
 
99
- * [get_file_hash](docs/sdks/library/README.md#get_file_hash) - Get Hash Value
100
- * [get_recently_added](docs/sdks/library/README.md#get_recently_added) - Get Recently Added
101
- * [get_libraries](docs/sdks/library/README.md#get_libraries) - Get All Libraries
102
- * [get_library](docs/sdks/library/README.md#get_library) - Get Library Details
103
- * [delete_library](docs/sdks/library/README.md#delete_library) - Delete Library Section
104
- * [get_library_items](docs/sdks/library/README.md#get_library_items) - Get Library Items
105
- * [refresh_library](docs/sdks/library/README.md#refresh_library) - Refresh Library
106
- * [search_library](docs/sdks/library/README.md#search_library) - Search Library
107
- * [get_metadata](docs/sdks/library/README.md#get_metadata) - Get Items Metadata
108
- * [get_metadata_children](docs/sdks/library/README.md#get_metadata_children) - Get Items Children
109
- * [get_on_deck](docs/sdks/library/README.md#get_on_deck) - Get On Deck
99
+ * [get_file_hash](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_file_hash) - Get Hash Value
100
+ * [get_recently_added](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_recently_added) - Get Recently Added
101
+ * [get_libraries](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_libraries) - Get All Libraries
102
+ * [get_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_library) - Get Library Details
103
+ * [delete_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#delete_library) - Delete Library Section
104
+ * [get_library_items](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_library_items) - Get Library Items
105
+ * [refresh_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#refresh_library) - Refresh Library
106
+ * [search_library](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#search_library) - Search Library
107
+ * [get_metadata](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_metadata) - Get Items Metadata
108
+ * [get_metadata_children](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_metadata_children) - Get Items Children
109
+ * [get_on_deck](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/library/README.md#get_on_deck) - Get On Deck
110
110
 
111
- ### [log](docs/sdks/log/README.md)
111
+ ### [log](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md)
112
112
 
113
- * [log_line](docs/sdks/log/README.md#log_line) - Logging a single line message.
114
- * [log_multi_line](docs/sdks/log/README.md#log_multi_line) - Logging a multi-line message
115
- * [enable_paper_trail](docs/sdks/log/README.md#enable_paper_trail) - Enabling Papertrail
113
+ * [log_line](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md#log_line) - Logging a single line message.
114
+ * [log_multi_line](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md#log_multi_line) - Logging a multi-line message
115
+ * [enable_paper_trail](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/log/README.md#enable_paper_trail) - Enabling Papertrail
116
116
 
117
- ### [plex](docs/sdks/plex/README.md)
117
+ ### [plex](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/plex/README.md)
118
118
 
119
- * [get_pin](docs/sdks/plex/README.md#get_pin) - Get a Pin
120
- * [get_token](docs/sdks/plex/README.md#get_token) - Get Access Token
119
+ * [get_pin](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/plex/README.md#get_pin) - Get a Pin
120
+ * [get_token](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/plex/README.md#get_token) - Get Access Token
121
121
 
122
- ### [playlists](docs/sdks/playlists/README.md)
122
+ ### [playlists](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md)
123
123
 
124
- * [create_playlist](docs/sdks/playlists/README.md#create_playlist) - Create a Playlist
125
- * [get_playlists](docs/sdks/playlists/README.md#get_playlists) - Get All Playlists
126
- * [get_playlist](docs/sdks/playlists/README.md#get_playlist) - Retrieve Playlist
127
- * [delete_playlist](docs/sdks/playlists/README.md#delete_playlist) - Deletes a Playlist
128
- * [update_playlist](docs/sdks/playlists/README.md#update_playlist) - Update a Playlist
129
- * [get_playlist_contents](docs/sdks/playlists/README.md#get_playlist_contents) - Retrieve Playlist Contents
130
- * [clear_playlist_contents](docs/sdks/playlists/README.md#clear_playlist_contents) - Delete Playlist Contents
131
- * [add_playlist_contents](docs/sdks/playlists/README.md#add_playlist_contents) - Adding to a Playlist
132
- * [upload_playlist](docs/sdks/playlists/README.md#upload_playlist) - Upload Playlist
124
+ * [create_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#create_playlist) - Create a Playlist
125
+ * [get_playlists](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#get_playlists) - Get All Playlists
126
+ * [get_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#get_playlist) - Retrieve Playlist
127
+ * [delete_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#delete_playlist) - Deletes a Playlist
128
+ * [update_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#update_playlist) - Update a Playlist
129
+ * [get_playlist_contents](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#get_playlist_contents) - Retrieve Playlist Contents
130
+ * [clear_playlist_contents](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#clear_playlist_contents) - Delete Playlist Contents
131
+ * [add_playlist_contents](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#add_playlist_contents) - Adding to a Playlist
132
+ * [upload_playlist](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/playlists/README.md#upload_playlist) - Upload Playlist
133
133
 
134
- ### [authentication](docs/sdks/authentication/README.md)
134
+ ### [authentication](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/authentication/README.md)
135
135
 
136
- * [get_transient_token](docs/sdks/authentication/README.md#get_transient_token) - Get a Transient Token.
137
- * [get_source_connection_information](docs/sdks/authentication/README.md#get_source_connection_information) - Get Source Connection Information
136
+ * [get_transient_token](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/authentication/README.md#get_transient_token) - Get a Transient Token.
137
+ * [get_source_connection_information](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/authentication/README.md#get_source_connection_information) - Get Source Connection Information
138
138
 
139
- ### [statistics](docs/sdks/statistics/README.md)
139
+ ### [statistics](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/statistics/README.md)
140
140
 
141
- * [get_statistics](docs/sdks/statistics/README.md#get_statistics) - Get Media Statistics
141
+ * [get_statistics](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/statistics/README.md#get_statistics) - Get Media Statistics
142
142
 
143
- ### [sessions](docs/sdks/sessions/README.md)
143
+ ### [sessions](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md)
144
144
 
145
- * [get_sessions](docs/sdks/sessions/README.md#get_sessions) - Get Active Sessions
146
- * [get_session_history](docs/sdks/sessions/README.md#get_session_history) - Get Session History
147
- * [get_transcode_sessions](docs/sdks/sessions/README.md#get_transcode_sessions) - Get Transcode Sessions
148
- * [stop_transcode_session](docs/sdks/sessions/README.md#stop_transcode_session) - Stop a Transcode Session
145
+ * [get_sessions](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#get_sessions) - Get Active Sessions
146
+ * [get_session_history](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#get_session_history) - Get Session History
147
+ * [get_transcode_sessions](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#get_transcode_sessions) - Get Transcode Sessions
148
+ * [stop_transcode_session](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/sessions/README.md#stop_transcode_session) - Stop a Transcode Session
149
149
 
150
- ### [updater](docs/sdks/updater/README.md)
150
+ ### [updater](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md)
151
151
 
152
- * [get_update_status](docs/sdks/updater/README.md#get_update_status) - Querying status of updates
153
- * [check_for_updates](docs/sdks/updater/README.md#check_for_updates) - Checking for updates
154
- * [apply_updates](docs/sdks/updater/README.md#apply_updates) - Apply Updates
152
+ * [get_update_status](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md#get_update_status) - Querying status of updates
153
+ * [check_for_updates](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md#check_for_updates) - Checking for updates
154
+ * [apply_updates](https://github.com/LukeHagar/plexpy/blob/master/docs/sdks/updater/README.md#apply_updates) - Apply Updates
155
155
  <!-- End Available Resources and Operations [operations] -->
156
156
 
157
157
  <!-- Start Error Handling [errors] -->
@@ -162,7 +162,7 @@ Description: # plexpy
162
162
  | Error Object | Status Code | Content Type |
163
163
  | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
164
164
  | errors.GetServerCapabilitiesResponseBody | 401 | application/json |
165
- | errors.SDKError | 4x-5xx | */* |
165
+ | errors.SDKError | 4xx-5xx | */* |
166
166
 
167
167
  ### Example
168
168
 
@@ -284,7 +284,7 @@ Description: # plexpy
284
284
 
285
285
  http_client = requests.Session()
286
286
  http_client.headers.update({'x-custom-header': 'someValue'})
287
- s = plex_api.PlexAPI(client: http_client)
287
+ s = plex_api.PlexAPI(client=http_client)
288
288
  ```
289
289
  <!-- End Custom HTTP Client [http-client] -->
290
290
 
@@ -155,7 +155,7 @@ Handling errors in this SDK should largely match your expectations. All operati
155
155
  | Error Object | Status Code | Content Type |
156
156
  | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- |
157
157
  | errors.GetServerCapabilitiesResponseBody | 401 | application/json |
158
- | errors.SDKError | 4x-5xx | */* |
158
+ | errors.SDKError | 4xx-5xx | */* |
159
159
 
160
160
  ### Example
161
161
 
@@ -277,7 +277,7 @@ import requests
277
277
 
278
278
  http_client = requests.Session()
279
279
  http_client.headers.update({'x-custom-header': 'someValue'})
280
- s = plex_api.PlexAPI(client: http_client)
280
+ s = plex_api.PlexAPI(client=http_client)
281
281
  ```
282
282
  <!-- End Custom HTTP Client [http-client] -->
283
283
 
@@ -0,0 +1,53 @@
1
+ """Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT."""
2
+
3
+ import setuptools
4
+ import re
5
+
6
+ try:
7
+ with open('README.md', 'r') as fh:
8
+ long_description = fh.read()
9
+ GITHUB_URL = 'https://github.com/LukeHagar/plexpy.git'
10
+ GITHUB_URL = GITHUB_URL[: -len('.git')] if GITHUB_URL.endswith('.git') else GITHUB_URL
11
+ # links on PyPI should have absolute URLs
12
+ long_description = re.sub(
13
+ r'(\[[^\]]+\]\()((?!https?:)[^\)]+)(\))',
14
+ lambda m: m.group(1) + GITHUB_URL + '/blob/master/' + m.group(2) + m.group(3),
15
+ long_description,
16
+ )
17
+ except FileNotFoundError:
18
+ long_description = ''
19
+
20
+ setuptools.setup(
21
+ name='plex-api-client',
22
+ version='0.6.1',
23
+ author='LukeHagar',
24
+ description='Python Client SDK Generated by Speakeasy',
25
+ url='https://github.com/LukeHagar/plexpy.git',
26
+ long_description=long_description,
27
+ long_description_content_type='text/markdown',
28
+ packages=setuptools.find_packages(where='src'),
29
+ install_requires=[
30
+ "certifi>=2023.7.22",
31
+ "charset-normalizer>=3.2.0",
32
+ "dataclasses-json>=0.6.4",
33
+ "idna>=3.4",
34
+ "jsonpath-python>=1.0.6",
35
+ "marshmallow>=3.19.0",
36
+ "mypy-extensions>=1.0.0",
37
+ "packaging>=23.1",
38
+ "python-dateutil>=2.8.2",
39
+ "requests>=2.31.0",
40
+ "six>=1.16.0",
41
+ "typing-inspect>=0.9.0",
42
+ "typing_extensions>=4.7.1",
43
+ "urllib3>=1.26.18",
44
+ ],
45
+ extras_require={
46
+ "dev": [
47
+ "pylint==2.16.2",
48
+ ],
49
+ },
50
+ package_dir={'': 'src'},
51
+ python_requires='>=3.8',
52
+ package_data={'plex-api-client': ['py.typed']},
53
+ )
@@ -3,7 +3,7 @@
3
3
  import requests
4
4
  from .types import SDKInitHook, BeforeRequestContext, BeforeRequestHook, AfterSuccessContext, AfterSuccessHook, AfterErrorContext, AfterErrorHook, Hooks
5
5
  from .registration import init_hooks
6
- from typing import List, Optional, Tuple, Union
6
+ from typing import List, Optional, Tuple
7
7
 
8
8
 
9
9
  class SDKHooks(Hooks):
@@ -31,19 +31,21 @@ class SDKHooks(Hooks):
31
31
  base_url, client = hook.sdk_init(base_url, client)
32
32
  return base_url, client
33
33
 
34
- def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> Union[requests.PreparedRequest, Exception]:
34
+ def before_request(self, hook_ctx: BeforeRequestContext, request: requests.PreparedRequest) -> requests.PreparedRequest:
35
35
  for hook in self.before_request_hooks:
36
- request = hook.before_request(hook_ctx, request)
37
- if isinstance(request, Exception):
38
- raise request
36
+ out = hook.before_request(hook_ctx, request)
37
+ if isinstance(out, Exception):
38
+ raise out
39
+ request = out
39
40
 
40
41
  return request
41
42
 
42
43
  def after_success(self, hook_ctx: AfterSuccessContext, response: requests.Response) -> requests.Response:
43
44
  for hook in self.after_success_hooks:
44
- response = hook.after_success(hook_ctx, response)
45
- if isinstance(response, Exception):
46
- raise response
45
+ out = hook.after_success(hook_ctx, response)
46
+ if isinstance(out, Exception):
47
+ raise out
48
+ response = out
47
49
  return response
48
50
 
49
51
  def after_error(self, hook_ctx: AfterErrorContext, response: Optional[requests.Response], error: Optional[Exception]) -> Tuple[Optional[requests.Response], Optional[Exception]]:
@@ -17,15 +17,19 @@ class HookContext:
17
17
 
18
18
 
19
19
  class BeforeRequestContext(HookContext):
20
- pass
20
+ def __init__(self, hook_ctx: HookContext):
21
+ super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source)
21
22
 
22
23
 
23
24
  class AfterSuccessContext(HookContext):
24
- pass
25
+ def __init__(self, hook_ctx: HookContext):
26
+ super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source)
27
+
25
28
 
26
29
 
27
30
  class AfterErrorContext(HookContext):
28
- pass
31
+ def __init__(self, hook_ctx: HookContext):
32
+ super().__init__(hook_ctx.operation_id, hook_ctx.oauth2_scopes, hook_ctx.security_source)
29
33
 
30
34
 
31
35
  class SDKInitHook(ABC):
@@ -3,7 +3,7 @@
3
3
  import requests as requests_http
4
4
  from .sdkconfiguration import SDKConfiguration
5
5
  from plex_api import utils
6
- from plex_api._hooks import HookContext
6
+ from plex_api._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext
7
7
  from plex_api.models import errors, operations
8
8
  from typing import Optional
9
9
 
@@ -42,30 +42,29 @@ class Activities:
42
42
  client = self.sdk_configuration.client
43
43
 
44
44
  try:
45
- req = self.sdk_configuration.get_hooks().before_request(
46
- hook_ctx,
47
- requests_http.Request('GET', url, params=query_params, headers=headers).prepare(),
48
- )
45
+ req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers))
46
+ req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req)
49
47
  http_res = client.send(req)
50
48
  except Exception as e:
51
- _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
52
- raise e
49
+ _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e)
50
+ if e is not None:
51
+ raise e
53
52
 
54
53
  if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
55
- http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
56
- if e:
54
+ result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None)
55
+ if e is not None:
57
56
  raise e
57
+ if result is not None:
58
+ http_res = result
58
59
  else:
59
- result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
60
- if isinstance(result, Exception):
61
- raise result
62
- http_res = result
60
+ http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res)
61
+
63
62
 
64
63
 
65
- res = operations.GetServerActivitiesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res)
64
+ res = operations.GetServerActivitiesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res)
66
65
 
67
66
  if http_res.status_code == 200:
68
- if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
67
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
69
68
  out = utils.unmarshal_json(http_res.text, Optional[operations.GetServerActivitiesResponseBody])
70
69
  res.object = out
71
70
  else:
@@ -74,7 +73,7 @@ class Activities:
74
73
  elif http_res.status_code == 400 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
75
74
  raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
76
75
  elif http_res.status_code == 401:
77
- if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
76
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
78
77
  out = utils.unmarshal_json(http_res.text, errors.GetServerActivitiesResponseBody)
79
78
  out.raw_response = http_res
80
79
  raise out
@@ -111,34 +110,33 @@ class Activities:
111
110
  client = self.sdk_configuration.client
112
111
 
113
112
  try:
114
- req = self.sdk_configuration.get_hooks().before_request(
115
- hook_ctx,
116
- requests_http.Request('DELETE', url, params=query_params, headers=headers).prepare(),
117
- )
113
+ req = client.prepare_request(requests_http.Request('DELETE', url, params=query_params, headers=headers))
114
+ req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req)
118
115
  http_res = client.send(req)
119
116
  except Exception as e:
120
- _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
121
- raise e
117
+ _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e)
118
+ if e is not None:
119
+ raise e
122
120
 
123
121
  if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
124
- http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
125
- if e:
122
+ result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None)
123
+ if e is not None:
126
124
  raise e
125
+ if result is not None:
126
+ http_res = result
127
127
  else:
128
- result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
129
- if isinstance(result, Exception):
130
- raise result
131
- http_res = result
128
+ http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res)
129
+
132
130
 
133
131
 
134
- res = operations.CancelServerActivitiesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res)
132
+ res = operations.CancelServerActivitiesResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res)
135
133
 
136
134
  if http_res.status_code == 200:
137
135
  pass
138
136
  elif http_res.status_code == 400 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
139
137
  raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
140
138
  elif http_res.status_code == 401:
141
- if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
139
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
142
140
  out = utils.unmarshal_json(http_res.text, errors.CancelServerActivitiesResponseBody)
143
141
  out.raw_response = http_res
144
142
  raise out
@@ -3,7 +3,7 @@
3
3
  import requests as requests_http
4
4
  from .sdkconfiguration import SDKConfiguration
5
5
  from plex_api import utils
6
- from plex_api._hooks import HookContext
6
+ from plex_api._hooks import AfterErrorContext, AfterSuccessContext, BeforeRequestContext, HookContext
7
7
  from plex_api.models import errors, operations
8
8
 
9
9
  class Authentication:
@@ -40,34 +40,33 @@ class Authentication:
40
40
  client = self.sdk_configuration.client
41
41
 
42
42
  try:
43
- req = self.sdk_configuration.get_hooks().before_request(
44
- hook_ctx,
45
- requests_http.Request('GET', url, params=query_params, headers=headers).prepare(),
46
- )
43
+ req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers))
44
+ req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req)
47
45
  http_res = client.send(req)
48
46
  except Exception as e:
49
- _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
50
- raise e
47
+ _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e)
48
+ if e is not None:
49
+ raise e
51
50
 
52
51
  if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
53
- http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
54
- if e:
52
+ result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None)
53
+ if e is not None:
55
54
  raise e
55
+ if result is not None:
56
+ http_res = result
56
57
  else:
57
- result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
58
- if isinstance(result, Exception):
59
- raise result
60
- http_res = result
58
+ http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res)
59
+
61
60
 
62
61
 
63
- res = operations.GetTransientTokenResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res)
62
+ res = operations.GetTransientTokenResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res)
64
63
 
65
64
  if http_res.status_code == 200:
66
65
  pass
67
66
  elif http_res.status_code == 400 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
68
67
  raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
69
68
  elif http_res.status_code == 401:
70
- if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
69
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
71
70
  out = utils.unmarshal_json(http_res.text, errors.GetTransientTokenResponseBody)
72
71
  out.raw_response = http_res
73
72
  raise out
@@ -106,34 +105,33 @@ class Authentication:
106
105
  client = self.sdk_configuration.client
107
106
 
108
107
  try:
109
- req = self.sdk_configuration.get_hooks().before_request(
110
- hook_ctx,
111
- requests_http.Request('GET', url, params=query_params, headers=headers).prepare(),
112
- )
108
+ req = client.prepare_request(requests_http.Request('GET', url, params=query_params, headers=headers))
109
+ req = self.sdk_configuration.get_hooks().before_request(BeforeRequestContext(hook_ctx), req)
113
110
  http_res = client.send(req)
114
111
  except Exception as e:
115
- _, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, None, e)
116
- raise e
112
+ _, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), None, e)
113
+ if e is not None:
114
+ raise e
117
115
 
118
116
  if utils.match_status_codes(['400','401','4XX','5XX'], http_res.status_code):
119
- http_res, e = self.sdk_configuration.get_hooks().after_error(hook_ctx, http_res, None)
120
- if e:
117
+ result, e = self.sdk_configuration.get_hooks().after_error(AfterErrorContext(hook_ctx), http_res, None)
118
+ if e is not None:
121
119
  raise e
120
+ if result is not None:
121
+ http_res = result
122
122
  else:
123
- result = self.sdk_configuration.get_hooks().after_success(hook_ctx, http_res)
124
- if isinstance(result, Exception):
125
- raise result
126
- http_res = result
123
+ http_res = self.sdk_configuration.get_hooks().after_success(AfterSuccessContext(hook_ctx), http_res)
124
+
127
125
 
128
126
 
129
- res = operations.GetSourceConnectionInformationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type'), raw_response=http_res)
127
+ res = operations.GetSourceConnectionInformationResponse(status_code=http_res.status_code, content_type=http_res.headers.get('Content-Type') or '', raw_response=http_res)
130
128
 
131
129
  if http_res.status_code == 200:
132
130
  pass
133
131
  elif http_res.status_code == 400 or http_res.status_code >= 400 and http_res.status_code < 500 or http_res.status_code >= 500 and http_res.status_code < 600:
134
132
  raise errors.SDKError('API error occurred', http_res.status_code, http_res.text, http_res)
135
133
  elif http_res.status_code == 401:
136
- if utils.match_content_type(http_res.headers.get('Content-Type'), 'application/json'):
134
+ if utils.match_content_type(http_res.headers.get('Content-Type') or '', 'application/json'):
137
135
  out = utils.unmarshal_json(http_res.text, errors.GetSourceConnectionInformationResponseBody)
138
136
  out.raw_response = http_res
139
137
  raise out