From 63538aacb9f073859e4bc9cfad978c9749640075 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sun, 30 Jun 2024 00:25:38 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.322.3 --- .speakeasy/workflow.lock | 8 +- RELEASES.md | 10 + codeSamples.yaml | 1632 +++++++++++++++++++------------------- 3 files changed, 830 insertions(+), 820 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 28ed9d9..282590c 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.322.3 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:8f655cdeefb6c5735f8b31610eb2f381c24e2092062dd6e985a51e9f2f3390a2 - sourceBlobDigest: sha256:f30db98d010a7aa345d25bc430f1b7604f99760cd1e25a342ac0c075ff820e40 + sourceRevisionDigest: sha256:ed1feda8209f9880e4aec34325a731195eaac499dd97dc6512642530bdad15f7 + sourceBlobDigest: sha256:ace846c3acf123f0741bf1c566a856437c46a3775199f966409cf32c1c7810fe tags: - latest - main @@ -11,8 +11,8 @@ targets: plexpy: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:8f655cdeefb6c5735f8b31610eb2f381c24e2092062dd6e985a51e9f2f3390a2 - sourceBlobDigest: sha256:f30db98d010a7aa345d25bc430f1b7604f99760cd1e25a342ac0c075ff820e40 + sourceRevisionDigest: sha256:ed1feda8209f9880e4aec34325a731195eaac499dd97dc6512642530bdad15f7 + sourceBlobDigest: sha256:ace846c3acf123f0741bf1c566a856437c46a3775199f966409cf32c1c7810fe outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index eac3220..b8d54ef 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -698,4 +698,14 @@ Based on: ### Generated - [python v0.10.0] . ### Releases +- [PyPI v0.10.0] https://pypi.org/project/plex-api-client/0.10.0 - . + +## 2024-06-30 00:25:18 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.322.3 (2.354.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.10.0] . +### Releases - [PyPI v0.10.0] https://pypi.org/project/plex-api-client/0.10.0 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 54e2af1..937dcf4 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,29 +3,11 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: - - target: $["paths"]["/pins/{pinID}"]["get"] + - target: $["paths"]["/log/networked"]["get"] update: x-codeSamples: - lang: python - label: getToken - source: |- - import plex_api - - s = plex_api.PlexAPI( - x_plex_client_identifier='Postman', - ) - - - res = s.plex.get_token(pin_id='', x_plex_client_identifier='Postman') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/updater/status"]["get"] - update: - x-codeSamples: - - lang: python - label: getUpdateStatus + label: enablePaperTrail source: |- import plex_api @@ -35,16 +17,16 @@ actions: ) - res = s.updater.get_update_status() + res = s.log.enable_paper_trail() - if res.object is not None: + if res is not None: # handle response pass - - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] + - target: $["paths"]["/playlists"]["get"] update: x-codeSamples: - lang: python - label: getWatchlist + label: getPlaylists source: |- import plex_api from plex_api.models import operations @@ -55,256 +37,7 @@ actions: ) - res = s.watchlist.get_watchlist(request=operations.GetWatchlistRequest( - filter_=operations.PathParamFilter.RELEASED, - x_plex_token='', - )) - - 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', - ) - - - res = s.video.get_timeline(request=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, - )) - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/all/top"]["get"] - update: - x-codeSamples: - - lang: python - label: getTopWatchedContent - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.library.get_top_watched_content(type=505531, include_guids=1) - - 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', - ) - - - res = s.log.log_multi_line(request='level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman') - - 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.library.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/log"]["get"] - update: - x-codeSamples: - - lang: python - label: logLine - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.log.log_line(level=operations.Level.THREE, message='Test log message', source='Postman') - - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] - update: - x-codeSamples: - - lang: python - label: getPlaylistContents - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] - update: - x-codeSamples: - - lang: python - label: clearPlaylistContents - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.playlists.clear_playlist_contents(playlist_id=1893.18) - - if res is not None: - # handle response - pass - - target: $["paths"]["/statistics/media"]["get"] - update: - x-codeSamples: - - lang: python - label: getStatistics - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.statistics.get_statistics(timespan=4) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/butler"]["post"] - update: - x-codeSamples: - - lang: python - label: startAllTasks - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.butler.start_all_tasks() - - 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.butler.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.hubs.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"]["/statistics/resources"]["get"] - update: - x-codeSamples: - - lang: python - label: getResourcesStatistics - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.statistics.get_resources_statistics(timespan=4) + res = s.playlists.get_playlists(playlist_type=operations.PlaylistType.AUDIO, smart=operations.QueryParamSmart.ZERO) if res.object is not None: # handle response @@ -329,6 +62,150 @@ actions: if res.object is not None: # handle response pass + - target: $["paths"]["/servers"]["get"] + update: + x-codeSamples: + - lang: python + label: getServerList + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.server.get_server_list() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/hubs/search"]["get"] + update: + x-codeSamples: + - lang: python + label: performSearch + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.search.perform_search(query='dylan', section_id=1516.53, limit=5) + + if res is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] + update: + x-codeSamples: + - lang: python + label: clearPlaylistContents + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.playlists.clear_playlist_contents(playlist_id=1893.18) + + if res 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.server.get_my_plex_account() + + 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 + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.library.get_library_items(section_id='', tag=operations.Tag.GENRE, include_guids=1) + + if res.object 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 + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE) + + if res is not None: + # handle response + pass + - target: $["paths"]["/photo/:/transcode"]["get"] + update: + x-codeSamples: + - lang: python + label: getResizedPhoto + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.server.get_resized_photo(request=operations.GetResizedPhotoRequest( + width=110, + height=165, + opacity=100, + blur=20, + min_size=operations.MinSize.ONE, + upscale=operations.Upscale.ZERO, + url='/library/metadata/49564/thumb/1654258204', + )) + + if res is not None: + # handle response + pass - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] update: x-codeSamples: @@ -363,101 +240,6 @@ actions: auto_adjust_quality=0, )) - if res is not None: - # handle response - pass - - target: $["paths"]["/home"]["get"] - update: - x-codeSamples: - - lang: python - label: getHomeData - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.plex.get_home_data() - - 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.server.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.server.get_devices() - - 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.server.get_my_plex_account() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/:/unscrobble"]["get"] - update: - x-codeSamples: - - lang: python - label: markUnplayed - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.media.mark_unplayed(key=59398) - if res is not None: # handle response pass @@ -479,11 +261,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}"]["put"] + - target: $["paths"]["/library/hashes"]["get"] update: x-codeSamples: - lang: python - label: updatePlaylist + label: getFileHash source: |- import plex_api @@ -493,16 +275,35 @@ actions: ) - res = s.playlists.update_playlist(playlist_id=3915, title='', summary='') + res = s.library.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) if res is not None: # handle response pass - - target: $["paths"]["/photo/:/transcode"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["get"] update: x-codeSamples: - lang: python - label: getResizedPhoto + label: getPlaylistContents + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59) + + 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 @@ -513,24 +314,27 @@ actions: ) - res = s.server.get_resized_photo(request=operations.GetResizedPhotoRequest( - width=110, - height=165, - opacity=100, - blur=20, - min_size=operations.MinSize.ONE, - upscale=operations.Upscale.ZERO, - url='/library/metadata/49564/thumb/1654258204', + res = s.video.get_timeline(request=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, )) if res is not None: # handle response pass - - target: $["paths"]["/servers"]["get"] + - target: $["paths"]["/hubs/search/voice"]["get"] update: x-codeSamples: - lang: python - label: getServerList + label: performVoiceSearch source: |- import plex_api @@ -540,11 +344,165 @@ actions: ) - res = s.server.get_server_list() + res = s.search.perform_voice_search(query='dead+poop', section_id=4094.8, limit=5) + + if res 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.search.get_search_results(query='110') 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 + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.library.get_metadata_children(rating_key=1539.14, include_elements='') + + 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', + ) + + + res = s.log.log_multi_line(request='level=4&message=Test%20message%201&source=postman + level=3&message=Test%20message%202&source=postman + level=1&message=Test%20message%203&source=postman') + + 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.playlists.delete_playlist(playlist_id=216.22) + + if res is not None: + # handle response + pass + - target: $["paths"]["/statistics/media"]["get"] + update: + x-codeSamples: + - lang: python + label: getStatistics + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.statistics.get_statistics(timespan=4) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/all/top"]["get"] + update: + x-codeSamples: + - lang: python + label: getTopWatchedContent + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.library.get_top_watched_content(type=505531, include_guids=1) + + 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.library.get_on_deck() + + 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.sessions.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') + + if res is not None: + # handle response + pass - target: $["paths"]["/activities/{activityUUID}"]["delete"] update: x-codeSamples: @@ -561,25 +519,6 @@ actions: res = s.activities.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.butler.stop_all_tasks() - if res is not None: # handle response pass @@ -603,11 +542,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/status/sessions"]["get"] + - target: $["paths"]["/statistics/resources"]["get"] update: x-codeSamples: - lang: python - label: getSessions + label: getResourcesStatistics source: |- import plex_api @@ -617,16 +556,16 @@ actions: ) - res = s.sessions.get_sessions() + res = s.statistics.get_resources_statistics(timespan=4) if res.object is not None: # handle response pass - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] + - target: $["paths"]["/statistics/bandwidth"]["get"] update: x-codeSamples: - lang: python - label: stopTranscodeSession + label: getBandwidthStatistics source: |- import plex_api @@ -636,16 +575,16 @@ actions: ) - res = s.sessions.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') + res = s.statistics.get_bandwidth_statistics(timespan=4) - if res is not None: + if res.object is not None: # handle response pass - - target: $["paths"]["/updater/apply"]["put"] + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: python - label: applyUpdates + label: getLibraryHubs source: |- import plex_api from plex_api.models import operations @@ -656,35 +595,16 @@ actions: ) - res = s.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE) - - if res 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.server.get_server_identity() + res = s.hubs.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"]["/butler/{taskName}"]["post"] + - target: $["paths"]["/security/token"]["get"] update: x-codeSamples: - lang: python - label: startTask + label: getTransientToken source: |- import plex_api from plex_api.models import operations @@ -695,11 +615,68 @@ actions: ) - res = s.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) + res = s.authentication.get_transient_token(type=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL) if res 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.updater.get_update_status() + + 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.server.get_server_preferences() + + if res.object 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.butler.get_butler_tasks() + + if res.object is not None: + # handle response + pass - target: $["paths"]["/playlists"]["post"] update: x-codeSamples: @@ -722,25 +699,6 @@ actions: uri='https://inborn-brochure.biz', )) - 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.library.get_on_deck() - if res.object is not None: # handle response pass @@ -763,6 +721,179 @@ actions: if res.object 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.sessions.get_transcode_sessions() + + if res.object 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.playlists.get_playlist(playlist_id=4109.48) + + 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.server.get_available_clients() + + 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.media.update_play_progress(key='', time=90000, state='played') + + if res is not None: + # handle response + pass + - target: $["paths"]["/butler"]["post"] + update: + x-codeSamples: + - lang: python + label: startAllTasks + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.butler.start_all_tasks() + + if res is not None: + # handle response + pass + - target: $["paths"]["/butler/{taskName}"]["post"] + 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.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) + + 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.library.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) + + if res.object 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.library.get_metadata(rating_key=8382.31) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/security/resources"]["get"] + update: + x-codeSamples: + - lang: python + label: getSourceConnectionInformation + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.authentication.get_source_connection_information(source='server://client-identifier') + + if res is not None: + # handle response + pass - target: $["paths"]["/"]["get"] update: x-codeSamples: @@ -782,11 +913,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/butler"]["get"] + - target: $["paths"]["/devices"]["get"] update: x-codeSamples: - lang: python - label: getButlerTasks + label: getDevices source: |- import plex_api @@ -796,16 +927,16 @@ actions: ) - res = s.butler.get_butler_tasks() + res = s.server.get_devices() if res.object is not None: # handle response pass - - target: $["paths"]["/hubs/search/voice"]["get"] + - target: $["paths"]["/identity"]["get"] update: x-codeSamples: - lang: python - label: performVoiceSearch + label: getServerIdentity source: |- import plex_api @@ -815,7 +946,103 @@ actions: ) - res = s.search.perform_voice_search(query='dead+poop', section_id=4094.8, limit=5) + res = s.server.get_server_identity() + + 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.media.mark_played(key=59398) + + if res is not None: + # handle response + pass + - target: $["paths"]["/home"]["get"] + update: + x-codeSamples: + - lang: python + label: getHomeData + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.plex.get_home_data() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/sections"]["get"] + update: + x-codeSamples: + - lang: python + label: getLibraries + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.library.get_libraries() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/:/unscrobble"]["get"] + update: + x-codeSamples: + - lang: python + label: markUnplayed + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.media.mark_unplayed(key=59398) + + if res is not None: + # handle response + pass + - target: $["paths"]["/playlists/upload"]["post"] + update: + x-codeSamples: + - lang: python + label: uploadPlaylist + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.playlists.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) if res is not None: # handle response @@ -837,178 +1064,6 @@ actions: res = s.updater.check_for_updates(download=operations.Download.ONE) - if res 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.library.refresh_library(section_id=934.16) - - 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.library.get_metadata_children(rating_key=1539.14, include_elements='') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/playlists/upload"]["post"] - update: - x-codeSamples: - - lang: python - label: uploadPlaylist - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.playlists.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) - - if res 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.server.get_server_preferences() - - 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.media.mark_played(key=59398) - - 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.sessions.get_transcode_sessions() - - 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.playlists.delete_playlist(playlist_id=216.22) - - if res 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.media.update_play_progress(key='', time=90000, state='played') - - if res is not None: - # handle response - pass - - target: $["paths"]["/hubs/search"]["get"] - update: - x-codeSamples: - - lang: python - label: performSearch - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.search.perform_search(query='dylan', section_id=1516.53, limit=5) - if res is not None: # handle response pass @@ -1031,11 +1086,31 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] + - target: $["paths"]["/log"]["get"] update: x-codeSamples: - lang: python - label: getMetadata + label: logLine + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.log.log_line(level=operations.Level.THREE, message='Test log message', source='Postman') + + if res is not None: + # handle response + pass + - target: $["paths"]["/status/sessions"]["get"] + update: + x-codeSamples: + - lang: python + label: getSessions source: |- import plex_api @@ -1045,11 +1120,110 @@ actions: ) - res = s.library.get_metadata(rating_key=8382.31) + res = s.sessions.get_sessions() if res.object is not None: # handle response pass + - target: $["paths"]["/library/sections/watchlist/{filter}"]["get"] + update: + x-codeSamples: + - lang: python + label: getWatchlist + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.watchlist.get_watchlist(request=operations.GetWatchlistRequest( + filter_=operations.PathParamFilter.RELEASED, + x_plex_token='', + )) + + if res.object 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.butler.stop_all_tasks() + + 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.butler.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) + + if res is not None: + # handle response + pass + - target: $["paths"]["/pins/{pinID}"]["get"] + update: + x-codeSamples: + - lang: python + label: getToken + source: |- + import plex_api + + s = plex_api.PlexAPI( + x_plex_client_identifier='Postman', + ) + + + res = s.plex.get_token(pin_id='', x_plex_client_identifier='Postman') + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/sections/{sectionId}"]["delete"] + update: + x-codeSamples: + - lang: python + label: deleteLibrary + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.library.delete_library(section_id=1000) + + if res is not None: + # handle response + pass - target: $["paths"]["/activities"]["get"] update: x-codeSamples: @@ -1069,11 +1243,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/library/hashes"]["get"] + - target: $["paths"]["/library/sections/{sectionId}/refresh"]["get"] update: x-codeSamples: - lang: python - label: getFileHash + label: refreshLibrary source: |- import plex_api @@ -1083,46 +1257,7 @@ actions: ) - res = s.library.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) - - if res 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 - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.library.get_library_items(section_id='', tag=operations.Tag.GENRE, include_guids=1) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/sections/{sectionId}"]["delete"] - update: - x-codeSamples: - - lang: python - label: deleteLibrary - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.library.delete_library(section_id=1000) + res = s.library.refresh_library(section_id=934.16) if res is not None: # handle response @@ -1147,11 +1282,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}"]["get"] + - target: $["paths"]["/playlists/{playlistID}"]["put"] update: x-codeSamples: - lang: python - label: getPlaylist + label: updatePlaylist source: |- import plex_api @@ -1161,142 +1296,7 @@ actions: ) - res = s.playlists.get_playlist(playlist_id=4109.48) - - 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 - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.playlists.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.authentication.get_transient_token(type=operations.GetTransientTokenQueryParamType.DELEGATION, scope=operations.Scope.ALL) - - if res is not None: - # handle response - pass - - target: $["paths"]["/security/resources"]["get"] - update: - x-codeSamples: - - lang: python - label: getSourceConnectionInformation - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.authentication.get_source_connection_information(source='server://client-identifier') - - if res is not None: - # handle response - pass - - target: $["paths"]["/statistics/bandwidth"]["get"] - update: - x-codeSamples: - - lang: python - label: getBandwidthStatistics - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.statistics.get_bandwidth_statistics(timespan=4) - - 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.search.get_search_results(query='110') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/sections"]["get"] - update: - x-codeSamples: - - lang: python - label: getLibraries - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.library.get_libraries() - - 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.log.enable_paper_trail() + res = s.playlists.update_playlist(playlist_id=3915, title='', summary='') if res is not None: # handle response