From 3357c234451e9af823edd19faaed1054ad6f91dc Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Mon, 3 Jun 2024 01:20:32 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.299.4 --- .speakeasy/workflow.lock | 8 +- RELEASES.md | 10 + codeSamples.yaml | 1214 +++++++++++++++++++------------------- 3 files changed, 621 insertions(+), 611 deletions(-) diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2584108..ae455fe 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.299.4 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:f0c128f0afe07898fa2c9071957664a0db2e01063de469634c8657c4fa0dca69 - sourceBlobDigest: sha256:2d4170cd754961862033fa1783c76ccc5ffa9ccbebccbab6f4229704197fe599 + sourceRevisionDigest: sha256:8c89a86c078d2b1ada28bc0eede8b526d1a10b223ae5943fa8a59adbea5d5566 + sourceBlobDigest: sha256:82ccefbaa56dd261de147da8c17437192ef2822e5937cd3de518ab52d7941408 tags: - latest - main @@ -11,8 +11,8 @@ targets: plexpy: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:f0c128f0afe07898fa2c9071957664a0db2e01063de469634c8657c4fa0dca69 - sourceBlobDigest: sha256:2d4170cd754961862033fa1783c76ccc5ffa9ccbebccbab6f4229704197fe599 + sourceRevisionDigest: sha256:8c89a86c078d2b1ada28bc0eede8b526d1a10b223ae5943fa8a59adbea5d5566 + sourceBlobDigest: sha256:82ccefbaa56dd261de147da8c17437192ef2822e5937cd3de518ab52d7941408 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index b0a3a2d..36d0c4b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -488,4 +488,14 @@ Based on: ### Generated - [python v0.8.0] . ### Releases +- [PyPI v0.8.0] https://pypi.org/project/plex-api-client/0.8.0 - . + +## 2024-06-03 01:20:04 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.299.4 (2.338.7) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.8.0] . +### Releases - [PyPI v0.8.0] https://pypi.org/project/plex-api-client/0.8.0 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 120ba1b..9bae28e 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,14 +3,13 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: - - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] + - target: $["paths"]["/"]["get"] update: x-codeSamples: - lang: python - label: getLibraryHubs + label: getServerCapabilities source: |- import plex_api - from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -18,16 +17,16 @@ actions: ) - res = s.hubs.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=operations.QueryParamOnlyTransient.ZERO) + res = s.server.get_server_capabilities() if res.object is not None: # handle response pass - - target: $["paths"]["/library/onDeck"]["get"] + - target: $["paths"]["/devices"]["get"] update: x-codeSamples: - lang: python - label: getOnDeck + label: getDevices source: |- import plex_api @@ -37,16 +36,16 @@ actions: ) - res = s.library.get_on_deck() + res = s.server.get_devices() if res.object is not None: # handle response pass - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + - target: $["paths"]["/activities/{activityUUID}"]["delete"] update: x-codeSamples: - lang: python - label: getMetadataChildren + label: cancelServerActivities source: |- import plex_api @@ -56,11 +55,70 @@ actions: ) - res = s.library.get_metadata_children(rating_key=1539.14) + res = s.activities.cancel_server_activities(activity_uuid='25b71ed5-0f9d-461c-baa7-d404e9e10d3e') + + 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"]["/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"]["/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"]["get"] update: x-codeSamples: @@ -78,6 +136,44 @@ actions: 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"]["/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 @@ -97,51 +193,6 @@ actions: res = s.media.mark_unplayed(key=59398) - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists"]["post"] - update: - x-codeSamples: - - lang: python - label: createPlaylist - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.playlists.create_playlist(request=operations.CreatePlaylistRequest( - title='', - type=operations.QueryParamType.PHOTO, - smart=operations.Smart.ONE, - uri='https://inborn-brochure.biz', - )) - - 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 @@ -164,11 +215,31 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/search"]["get"] + - target: $["paths"]["/hubs"]["get"] update: x-codeSamples: - lang: python - label: getSearchResults + 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.hubs.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + + 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 @@ -178,9 +249,9 @@ actions: ) - res = s.search.get_search_results(query='110') + res = s.sessions.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') - if res.object is not None: + if res is not None: # handle response pass - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] @@ -203,13 +274,14 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/library/hashes"]["get"] + - target: $["paths"]["/updater/apply"]["put"] update: x-codeSamples: - lang: python - label: getFileHash + label: applyUpdates source: |- import plex_api + from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -217,16 +289,16 @@ actions: ) - res = s.library.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) + res = s.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE) if res is not None: # handle response pass - - target: $["paths"]["/:/progress"]["post"] + - target: $["paths"]["/servers"]["get"] update: x-codeSamples: - lang: python - label: updatePlayProgress + label: getServerList source: |- import plex_api @@ -236,16 +308,35 @@ actions: ) - res = s.media.update_play_progress(key='', time=90000, state='played') + res = s.server.get_server_list() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/hubs/search/voice"]["get"] + update: + x-codeSamples: + - lang: python + label: performVoiceSearch + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + 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"]["/playlists/{playlistID}/items"]["put"] + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] update: x-codeSamples: - lang: python - label: addPlaylistContents + label: getMetadataChildren source: |- import plex_api @@ -255,7 +346,83 @@ actions: ) - res = s.playlists.add_playlist_contents(playlist_id=8502.01, uri='server://12345/com.plexapp.plugins.library/library/metadata/1', play_queue_id=123) + res = s.library.get_metadata_children(rating_key=1539.14) + + if res.object 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.activities.get_server_activities() + + 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"]["/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}"]["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 @@ -280,11 +447,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}"]["delete"] + - target: $["paths"]["/identity"]["get"] update: x-codeSamples: - lang: python - label: deletePlaylist + label: getServerIdentity source: |- import plex_api @@ -294,16 +461,35 @@ actions: ) - res = s.playlists.delete_playlist(playlist_id=216.22) + res = s.server.get_server_identity() + + 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() if res is not None: # handle response pass - - target: $["paths"]["/status/sessions/history/all"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["get"] update: x-codeSamples: - lang: python - label: getSessionHistory + label: getPlaylistContents source: |- import plex_api @@ -313,11 +499,136 @@ actions: ) - res = s.sessions.get_session_history() + res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59) if res.object 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"]["/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"]["/updater/check"]["put"] + update: + x-codeSamples: + - lang: python + label: checkForUpdates + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.updater.check_for_updates(download=operations.Download.ONE) + + 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"]["/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 is not None: + # handle response + pass - target: $["paths"]["/transcode/sessions"]["get"] update: x-codeSamples: @@ -337,11 +648,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/devices"]["get"] + - target: $["paths"]["/updater/status"]["get"] update: x-codeSamples: - lang: python - label: getDevices + label: getUpdateStatus source: |- import plex_api @@ -351,16 +662,16 @@ actions: ) - res = s.server.get_devices() + res = s.updater.get_update_status() if res.object is not None: # handle response pass - - target: $["paths"]["/identity"]["get"] + - target: $["paths"]["/:/progress"]["post"] update: x-codeSamples: - lang: python - label: getServerIdentity + label: updatePlayProgress source: |- import plex_api @@ -370,9 +681,9 @@ actions: ) - res = s.server.get_server_identity() + res = s.media.update_play_progress(key='', time=90000, state='played') - if res.object is not None: + if res is not None: # handle response pass - target: $["paths"]["/:/timeline"]["get"] @@ -403,330 +714,6 @@ actions: row=1, )) - 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.library.search_library(section_id=933505, type=operations.Type.FOUR) - - if res.object 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"]["/hubs/search/voice"]["get"] - update: - x-codeSamples: - - lang: python - label: performVoiceSearch - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - 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"]["/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"]["/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"]["/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() - - 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 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"]["/"]["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.server.get_server_capabilities() - - 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"]["/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.activities.get_server_activities() - - 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"]["/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"]["/playlists/{playlistID}"]["put"] - update: - x-codeSamples: - - lang: python - label: updatePlaylist - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.playlists.update_playlist(playlist_id=3915, title='', summary='') - - 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"]["/:/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 @@ -767,11 +754,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/log"]["post"] + - target: $["paths"]["/library/hashes"]["get"] update: x-codeSamples: - lang: python - label: logMultiLine + label: getFileHash source: |- import plex_api @@ -781,18 +768,16 @@ actions: ) - 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') + 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"]["/transcode/sessions/{sessionKey}"]["delete"] + - target: $["paths"]["/playlists/{playlistID}"]["get"] update: x-codeSamples: - lang: python - label: stopTranscodeSession + label: getPlaylist source: |- import plex_api @@ -802,55 +787,16 @@ actions: ) - res = s.sessions.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') - - if res is not None: - # handle response - pass - - target: $["paths"]["/updater/check"]["put"] - update: - x-codeSamples: - - lang: python - label: checkForUpdates - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.updater.check_for_updates(download=operations.Download.ONE) - - if res 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() + res = s.playlists.get_playlist(playlist_id=4109.48) if res.object is not None: # handle response pass - - target: $["paths"]["/butler"]["post"] + - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: python - label: startAllTasks + label: markPlayed source: |- import plex_api @@ -860,19 +806,18 @@ actions: ) - res = s.butler.start_all_tasks() + res = s.media.mark_played(key=59398) if res is not None: # handle response pass - - target: $["paths"]["/hubs"]["get"] + - target: $["paths"]["/library/recentlyAdded"]["get"] update: x-codeSamples: - lang: python - label: getGlobalHubs + label: getRecentlyAdded source: |- import plex_api - from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -880,16 +825,16 @@ actions: ) - res = s.hubs.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + res = s.library.get_recently_added() if res.object is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] + - target: $["paths"]["/playlists/{playlistID}"]["delete"] update: x-codeSamples: - lang: python - label: getPlaylistContents + label: deletePlaylist source: |- import plex_api @@ -899,19 +844,37 @@ actions: ) - res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59) + res = s.playlists.delete_playlist(playlist_id=216.22) + + 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.sessions.get_sessions() if res.object is not None: # handle response pass - - target: $["paths"]["/butler/{taskName}"]["delete"] + - target: $["paths"]["/status/sessions/history/all"]["get"] update: x-codeSamples: - lang: python - label: stopTask + label: getSessionHistory source: |- import plex_api - from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -919,49 +882,9 @@ actions: ) - res = s.butler.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) + res = s.sessions.get_session_history() - if res 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"]["/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: + if res.object is not None: # handle response pass - target: $["paths"]["/clients"]["get"] @@ -983,11 +906,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/photo/:/transcode"]["get"] + - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: python - label: getResizedPhoto + label: startTask source: |- import plex_api from plex_api.models import operations @@ -998,24 +921,41 @@ 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.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) if res is not None: # handle response pass - - target: $["paths"]["/activities/{activityUUID}"]["delete"] + - target: $["paths"]["/playlists"]["post"] update: x-codeSamples: - lang: python - label: cancelServerActivities + label: createPlaylist + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.playlists.create_playlist(request=operations.CreatePlaylistRequest( + title='', + type=operations.QueryParamType.PHOTO, + smart=operations.Smart.ONE, + uri='https://inborn-brochure.biz', + )) + + 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 @@ -1025,7 +965,7 @@ actions: ) - res = s.activities.cancel_server_activities(activity_uuid='25b71ed5-0f9d-461c-baa7-d404e9e10d3e') + res = s.authentication.get_source_connection_information(source='server://client-identifier') if res is not None: # handle response @@ -1049,11 +989,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/hubs/search"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["put"] update: x-codeSamples: - lang: python - label: performSearch + label: addPlaylistContents source: |- import plex_api @@ -1063,9 +1003,66 @@ actions: ) - res = s.search.perform_search(query='dylan', section_id=1516.53, limit=5) + res = s.playlists.add_playlist_contents(playlist_id=8502.01, uri='server://12345/com.plexapp.plugins.library/library/metadata/1', play_queue_id=123) - if res is not None: + 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"]["/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/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"]["/pins"]["post"] @@ -1086,49 +1083,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/status/sessions"]["get"] + - target: $["paths"]["/playlists/upload"]["post"] update: x-codeSamples: - lang: python - label: getSessions - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.sessions.get_sessions() - - if res.object 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.library.get_recently_added() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getLibrary + label: uploadPlaylist source: |- import plex_api from plex_api.models import operations @@ -1139,54 +1098,56 @@ actions: ) - 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"]["/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) + res = s.playlists.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) if res is not None: # handle response pass - - target: $["paths"]["/security/resources"]["get"] + - target: $["paths"]["/butler/{taskName}"]["delete"] update: x-codeSamples: - lang: python - label: getSourceConnectionInformation + 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"]["/library/sections/{sectionId}"]["delete"] + update: + x-codeSamples: + - lang: python + label: deleteLibrary source: |- import plex_api @@ -1196,7 +1157,46 @@ actions: ) - res = s.authentication.get_source_connection_information(source='server://client-identifier') + res = s.library.delete_library(section_id=1000) + + 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.library.search_library(section_id=933505, type=operations.Type.FOUR) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}"]["put"] + update: + x-codeSamples: + - lang: python + label: updatePlaylist + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.playlists.update_playlist(playlist_id=3915, title='', summary='') if res is not None: # handle response