diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index a5c489b..0fb4ff2 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.280.2 +speakeasyVersion: 1.283.1 sources: my-source: {} targets: diff --git a/RELEASES.md b/RELEASES.md index 310aa90..2929151 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -348,4 +348,14 @@ Based on: ### Generated - [python v0.6.6] . ### Releases +- [PyPI v0.6.6] https://pypi.org/project/plex-api-client/0.6.6 - . + +## 2024-05-08 01:02:55 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.283.1 (2.324.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.6.6] . +### Releases - [PyPI v0.6.6] https://pypi.org/project/plex-api-client/0.6.6 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 525465d..4415096 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: - - target: $["paths"]["/:/prefs"]["get"] + - target: $["paths"]["/status/sessions/history/all"]["get"] update: x-codeSamples: - lang: python - label: getServerPreferences + label: getSessionHistory source: |- import plex_api @@ -17,7 +17,7 @@ actions: ) - res = s.get_server_preferences() + res = s.get_session_history() if res.object is not None: # handle response @@ -41,78 +41,20 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/butler"]["delete"] + - target: $["paths"]["/pins/{pinID}"]["get"] update: x-codeSamples: - lang: python - label: stopAllTasks + label: getToken source: |- import plex_api s = plex_api.PlexAPI( - access_token="", x_plex_client_identifier='Postman', ) - res = s.stop_all_tasks() - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] - update: - x-codeSamples: - - lang: python - label: getMetadataChildren - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_metadata_children(rating_key=1539.14) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] - update: - x-codeSamples: - - lang: python - label: stopTranscodeSession - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/hashes"]["get"] - update: - x-codeSamples: - - lang: python - label: getFileHash - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) + res = s.get_token(pin_id='', x_plex_client_identifier='Postman') if res is not None: # handle response @@ -143,11 +85,30 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/playlists/upload"]["post"] + - target: $["paths"]["/playlists/{playlistID}"]["put"] update: x-codeSamples: - lang: python - label: uploadPlaylist + label: updatePlaylist + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.update_playlist(playlist_id=3915, title='', summary='') + + if res is not None: + # handle response + pass + - target: $["paths"]["/updater/apply"]["put"] + update: + x-codeSamples: + - lang: python + label: applyUpdates source: |- import plex_api from plex_api.models import operations @@ -158,16 +119,16 @@ actions: ) - res = s.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) + res = s.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE) if res is not None: # handle response pass - - target: $["paths"]["/status/sessions/history/all"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] update: x-codeSamples: - lang: python - label: getSessionHistory + label: clearPlaylistContents source: |- import plex_api @@ -177,16 +138,16 @@ actions: ) - res = s.get_session_history() + res = s.clear_playlist_contents(playlist_id=1893.18) - if res.object is not None: + if res is not None: # handle response pass - - target: $["paths"]["/servers"]["get"] + - target: $["paths"]["/security/resources"]["get"] update: x-codeSamples: - lang: python - label: getServerList + label: getSourceConnectionInformation source: |- import plex_api @@ -196,16 +157,16 @@ actions: ) - res = s.get_server_list() + res = s.get_source_connection_information(source='server://client-identifier') - if res.object is not None: + if res is not None: # handle response pass - - target: $["paths"]["/activities"]["get"] + - target: $["paths"]["/clients"]["get"] update: x-codeSamples: - lang: python - label: getServerActivities + label: getAvailableClients source: |- import plex_api @@ -215,7 +176,7 @@ actions: ) - res = s.get_server_activities() + res = s.get_available_clients() if res.object is not None: # handle response @@ -240,11 +201,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/security/resources"]["get"] + - target: $["paths"]["/log/networked"]["get"] update: x-codeSamples: - lang: python - label: getSourceConnectionInformation + label: enablePaperTrail source: |- import plex_api @@ -254,11 +215,90 @@ actions: ) - res = s.get_source_connection_information(source='server://client-identifier') + res = s.enable_paper_trail() if res is not None: # handle response pass + - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] + update: + x-codeSamples: + - lang: python + label: searchLibrary + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.search_library(section_id=933505, type=operations.Type.FOUR) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/security/token"]["get"] + update: + x-codeSamples: + - lang: python + label: getTransientToken + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_transient_token(type=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL) + + if res is not None: + # handle response + pass + - target: $["paths"]["/butler"]["get"] + update: + x-codeSamples: + - lang: python + label: getButlerTasks + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_butler_tasks() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] + update: + x-codeSamples: + - lang: python + label: getLibraryHubs + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=operations.QueryParamOnlyTransient.ZERO) + + if res.object is not None: + # handle response + pass - target: $["paths"]["/library/sections"]["get"] update: x-codeSamples: @@ -278,30 +318,43 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}"]["put"] + - target: $["paths"]["/:/timeline"]["get"] update: x-codeSamples: - lang: python - label: updatePlaylist + label: getTimeline source: |- import plex_api + from plex_api.models import operations s = plex_api.PlexAPI( access_token="", x_plex_client_identifier='Postman', ) + req = operations.GetTimelineRequest( + rating_key=23409, + key='/library/metadata/23409', + state=operations.State.PLAYING, + has_mde=1, + time=2000, + duration=10000, + context='home:hub.continueWatching', + play_queue_item_id=1, + play_back_time=2000, + row=1, + ) - res = s.update_playlist(playlist_id=3915, title='', summary='') + res = s.get_timeline(req) if res is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] + - target: $["paths"]["/hubs/search"]["get"] update: x-codeSamples: - lang: python - label: clearPlaylistContents + label: performSearch source: |- import plex_api @@ -311,16 +364,16 @@ actions: ) - res = s.clear_playlist_contents(playlist_id=1893.18) + res = s.perform_search(query='dylan', section_id=1516.53, limit=5) if res is not None: # handle response pass - - target: $["paths"]["/updater/status"]["get"] + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] update: x-codeSamples: - lang: python - label: getUpdateStatus + label: refreshLibrary source: |- import plex_api @@ -330,9 +383,28 @@ actions: ) - res = s.get_update_status() + res = s.refresh_library(section_id=934.16) - if res.object is not None: + if res is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}"]["delete"] + update: + x-codeSamples: + - lang: python + label: deletePlaylist + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.delete_playlist(playlist_id=216.22) + + if res is not None: # handle response pass - target: $["paths"]["/updater/check"]["put"] @@ -355,6 +427,63 @@ actions: if res is not None: # handle response pass + - target: $["paths"]["/transcode/sessions"]["get"] + update: + x-codeSamples: + - lang: python + label: getTranscodeSessions + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_transcode_sessions() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/identity"]["get"] + update: + x-codeSamples: + - lang: python + label: getServerIdentity + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_server_identity() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/myplex/account"]["get"] + update: + x-codeSamples: + - lang: python + label: getMyPlexAccount + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_my_plex_account() + + if res.object is not None: + # handle response + pass - target: $["paths"]["/statistics/media"]["get"] update: x-codeSamples: @@ -374,11 +503,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/activities/{activityUUID}"]["delete"] + - target: $["paths"]["/library/sections/{sectionId}"]["delete"] update: x-codeSamples: - lang: python - label: cancelServerActivities + label: deleteLibrary source: |- import plex_api @@ -388,36 +517,16 @@ actions: ) - res = s.cancel_server_activities(activity_uuid='25b71ed5-0f9d-461c-baa7-d404e9e10d3e') + res = s.delete_library(section_id=1000) if res is not None: # handle response pass - - target: $["paths"]["/butler/{taskName}"]["post"] + - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: python - label: startTask - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/recentlyAdded"]["get"] - update: - x-codeSamples: - - lang: python - label: getRecentlyAdded + label: markPlayed source: |- import plex_api @@ -427,26 +536,7 @@ actions: ) - res = s.get_recently_added() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/:/progress"]["post"] - update: - x-codeSamples: - - lang: python - label: updatePlayProgress - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.update_play_progress(key='', time=90000, state='played') + res = s.mark_played(key=59398) if res is not None: # handle response @@ -489,11 +579,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] + - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: python - label: getLibraryItems + label: startTask source: |- import plex_api from plex_api.models import operations @@ -504,228 +594,16 @@ actions: ) - res = s.get_library_items(section_id=451092, tag=operations.Tag.UNWATCHED) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/onDeck"]["get"] - update: - x-codeSamples: - - lang: python - label: getOnDeck - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_on_deck() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/pins"]["post"] - update: - x-codeSamples: - - lang: python - label: getPin - source: |- - import plex_api - - s = plex_api.PlexAPI( - x_plex_client_identifier='Postman', - ) - - - res = s.get_pin(strong=False, x_plex_client_identifier='Postman') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/status/sessions"]["get"] - update: - x-codeSamples: - - lang: python - label: getSessions - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_sessions() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/"]["get"] - update: - x-codeSamples: - - lang: python - label: getServerCapabilities - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_server_capabilities() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/clients"]["get"] - update: - x-codeSamples: - - lang: python - label: getAvailableClients - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_available_clients() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/devices"]["get"] - update: - x-codeSamples: - - lang: python - label: getDevices - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_devices() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] - update: - x-codeSamples: - - lang: python - label: searchLibrary - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.search_library(section_id=933505, type=operations.Type.FOUR) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}"]["delete"] - update: - x-codeSamples: - - lang: python - label: deletePlaylist - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.delete_playlist(playlist_id=216.22) + res = s.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) if res is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] + - target: $["paths"]["/playlists/upload"]["post"] update: x-codeSamples: - lang: python - label: addPlaylistContents - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.add_playlist_contents(playlist_id=8502.01, uri='server://12345/com.plexapp.plugins.library/library/metadata/1', play_queue_id=123) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/search"]["get"] - update: - x-codeSamples: - - lang: python - label: getSearchResults - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_search_results(query='110') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/log"]["post"] - update: - x-codeSamples: - - lang: python - label: logMultiLine - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - req = 'level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman' - - res = s.log_multi_line(req) - - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists"]["get"] - update: - x-codeSamples: - - lang: python - label: getPlaylists + label: uploadPlaylist source: |- import plex_api from plex_api.models import operations @@ -736,27 +614,7 @@ actions: ) - res = s.get_playlists(playlist_type=operations.PlaylistType.AUDIO, smart=operations.QueryParamSmart.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/security/token"]["get"] - update: - x-codeSamples: - - lang: python - label: getTransientToken - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_transient_token(type=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL) + res = s.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) if res is not None: # handle response @@ -780,11 +638,30 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/hubs"]["get"] + - target: $["paths"]["/search"]["get"] update: x-codeSamples: - lang: python - label: getGlobalHubs + label: getSearchResults + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_search_results(query='110') + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/playlists"]["get"] + update: + x-codeSamples: + - lang: python + label: getPlaylists source: |- import plex_api from plex_api.models import operations @@ -795,16 +672,16 @@ actions: ) - res = s.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + res = s.get_playlists(playlist_type=operations.PlaylistType.AUDIO, smart=operations.QueryParamSmart.ZERO) if res.object is not None: # handle response pass - - target: $["paths"]["/hubs/search"]["get"] + - target: $["paths"]["/hubs/search/voice"]["get"] update: x-codeSamples: - lang: python - label: performSearch + label: performVoiceSearch source: |- import plex_api @@ -814,213 +691,7 @@ actions: ) - res = s.perform_search(query='dylan', section_id=1516.53, limit=5) - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] - update: - x-codeSamples: - - lang: python - label: getMetadata - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_metadata(rating_key=8382.31) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/log/networked"]["get"] - update: - x-codeSamples: - - lang: python - label: enablePaperTrail - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.enable_paper_trail() - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getLibrary - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/:/scrobble"]["get"] - update: - x-codeSamples: - - lang: python - label: markPlayed - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.mark_played(key=59398) - - if res is not None: - # handle response - pass - - target: $["paths"]["/butler/{taskName}"]["delete"] - update: - x-codeSamples: - - lang: python - label: stopTask - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) - - if res is not None: - # handle response - pass - - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getLibraryHubs - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=operations.QueryParamOnlyTransient.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] - update: - x-codeSamples: - - lang: python - label: refreshLibrary - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.refresh_library(section_id=934.16) - - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}"]["get"] - update: - x-codeSamples: - - lang: python - label: getPlaylist - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_playlist(playlist_id=4109.48) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/myplex/account"]["get"] - update: - x-codeSamples: - - lang: python - label: getMyPlexAccount - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_my_plex_account() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/:/timeline"]["get"] - update: - x-codeSamples: - - lang: python - label: getTimeline - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - req = operations.GetTimelineRequest( - rating_key=23409, - key='/library/metadata/23409', - state=operations.State.PLAYING, - has_mde=1, - time=2000, - duration=10000, - context='home:hub.continueWatching', - play_queue_item_id=1, - play_back_time=2000, - row=1, - ) - - res = s.get_timeline(req) + res = s.perform_voice_search(query='dead+poop', section_id=4094.8, limit=5) if res is not None: # handle response @@ -1044,11 +715,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/transcode/sessions"]["get"] + - target: $["paths"]["/servers"]["get"] update: x-codeSamples: - lang: python - label: getTranscodeSessions + label: getServerList source: |- import plex_api @@ -1058,16 +729,92 @@ actions: ) - res = s.get_transcode_sessions() + res = s.get_server_list() if res.object is not None: # handle response pass - - target: $["paths"]["/updater/apply"]["put"] + - target: $["paths"]["/activities/{activityUUID}"]["delete"] update: x-codeSamples: - lang: python - label: applyUpdates + label: cancelServerActivities + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.cancel_server_activities(activity_uuid='25b71ed5-0f9d-461c-baa7-d404e9e10d3e') + + if res is not None: + # handle response + pass + - target: $["paths"]["/butler"]["delete"] + update: + x-codeSamples: + - lang: python + label: stopAllTasks + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.stop_all_tasks() + + if res is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}"]["get"] + update: + x-codeSamples: + - lang: python + label: getPlaylist + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_playlist(playlist_id=4109.48) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/:/prefs"]["get"] + update: + x-codeSamples: + - lang: python + label: getServerPreferences + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_server_preferences() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] + update: + x-codeSamples: + - lang: python + label: getLibraryItems source: |- import plex_api from plex_api.models import operations @@ -1078,16 +825,16 @@ actions: ) - res = s.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE) + res = s.get_library_items(section_id=451092, tag=operations.Tag.UNWATCHED) - if res is not None: + if res.object is not None: # handle response pass - - target: $["paths"]["/identity"]["get"] + - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] update: x-codeSamples: - lang: python - label: getServerIdentity + label: getMetadata source: |- import plex_api @@ -1097,7 +844,44 @@ actions: ) - res = s.get_server_identity() + res = s.get_metadata(rating_key=8382.31) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/pins"]["post"] + update: + x-codeSamples: + - lang: python + label: getPin + source: |- + import plex_api + + s = plex_api.PlexAPI( + x_plex_client_identifier='Postman', + ) + + + res = s.get_pin(strong=False, x_plex_client_identifier='Postman') + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}/items"]["put"] + update: + x-codeSamples: + - lang: python + label: addPlaylistContents + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.add_playlist_contents(playlist_id=8502.01, uri='server://12345/com.plexapp.plugins.library/library/metadata/1', play_queue_id=123) if res.object is not None: # handle response @@ -1131,11 +915,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/butler"]["get"] + - target: $["paths"]["/library/hashes"]["get"] update: x-codeSamples: - lang: python - label: getButlerTasks + label: getFileHash source: |- import plex_api @@ -1145,16 +929,55 @@ actions: ) - res = s.get_butler_tasks() + res = s.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) + + if res is not None: + # handle response + pass + - target: $["paths"]["/library/recentlyAdded"]["get"] + update: + x-codeSamples: + - lang: python + label: getRecentlyAdded + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_recently_added() if res.object is not None: # handle response pass - - target: $["paths"]["/hubs/search/voice"]["get"] + - target: $["paths"]["/hubs"]["get"] update: x-codeSamples: - lang: python - label: performVoiceSearch + label: getGlobalHubs + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + update: + x-codeSamples: + - lang: python + label: getMetadataChildren source: |- import plex_api @@ -1164,16 +987,16 @@ actions: ) - res = s.perform_voice_search(query='dead+poop', section_id=4094.8, limit=5) + res = s.get_metadata_children(rating_key=1539.14) - if res is not None: + if res.object is not None: # handle response pass - - target: $["paths"]["/library/sections/{sectionId}"]["delete"] + - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] update: x-codeSamples: - lang: python - label: deleteLibrary + label: stopTranscodeSession source: |- import plex_api @@ -1183,26 +1006,203 @@ actions: ) - res = s.delete_library(section_id=1000) + res = s.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') if res is not None: # handle response pass - - target: $["paths"]["/pins/{pinID}"]["get"] + - target: $["paths"]["/butler/{taskName}"]["delete"] update: x-codeSamples: - lang: python - label: getToken + label: stopTask source: |- import plex_api + from plex_api.models import operations s = plex_api.PlexAPI( + access_token="", x_plex_client_identifier='Postman', ) - res = s.get_token(pin_id='', x_plex_client_identifier='Postman') + res = s.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) if res is not None: # handle response pass + - target: $["paths"]["/log"]["post"] + update: + x-codeSamples: + - lang: python + label: logMultiLine + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + req = 'level=4&message=Test%20message%201&source=postman + level=3&message=Test%20message%202&source=postman + level=1&message=Test%20message%203&source=postman' + + res = s.log_multi_line(req) + + if res is not None: + # handle response + pass + - target: $["paths"]["/status/sessions"]["get"] + update: + x-codeSamples: + - lang: python + label: getSessions + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_sessions() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/updater/status"]["get"] + update: + x-codeSamples: + - lang: python + label: getUpdateStatus + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_update_status() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/devices"]["get"] + update: + x-codeSamples: + - lang: python + label: getDevices + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_devices() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/:/progress"]["post"] + update: + x-codeSamples: + - lang: python + label: updatePlayProgress + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.update_play_progress(key='', time=90000, state='played') + + if res is not None: + # handle response + pass + - target: $["paths"]["/activities"]["get"] + update: + x-codeSamples: + - lang: python + label: getServerActivities + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_server_activities() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/"]["get"] + update: + x-codeSamples: + - lang: python + label: getServerCapabilities + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_server_capabilities() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/sections/{sectionId}"]["get"] + update: + x-codeSamples: + - lang: python + label: getLibrary + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/onDeck"]["get"] + update: + x-codeSamples: + - lang: python + label: getOnDeck + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_on_deck() + + if res.object is not None: + # handle response + pass