diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 424cc33..1304384 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.300.1 +speakeasyVersion: 1.303.3 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:e7d5997ece5055ff1611c7e4be52bfe45240ee8f8fcd3a98fb2f3309a14003ea - sourceBlobDigest: sha256:0e81ff53390c0f5d6a5af1be18aff5dcbe4006d84eb224ea40085eaed4d0f19b + sourceRevisionDigest: sha256:1068de402666f1f427d8d51d98113672bdeb142a537fd076012aa5b3f3d0fe43 + sourceBlobDigest: sha256:71e62a983011cff21fe1ac87366f2b63825ce8cdaf0d647dd246164c9f9d73af tags: - latest - main @@ -11,8 +11,8 @@ targets: plexpy: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:e7d5997ece5055ff1611c7e4be52bfe45240ee8f8fcd3a98fb2f3309a14003ea - sourceBlobDigest: sha256:0e81ff53390c0f5d6a5af1be18aff5dcbe4006d84eb224ea40085eaed4d0f19b + sourceRevisionDigest: sha256:1068de402666f1f427d8d51d98113672bdeb142a537fd076012aa5b3f3d0fe43 + sourceBlobDigest: sha256:71e62a983011cff21fe1ac87366f2b63825ce8cdaf0d647dd246164c9f9d73af outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 2ee7c15..0169d83 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -568,4 +568,14 @@ Based on: ### Generated - [python v0.8.1] . ### Releases +- [PyPI v0.8.1] https://pypi.org/project/plex-api-client/0.8.1 - . + +## 2024-06-11 01:20:46 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.303.3 (2.339.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.8.1] . +### Releases - [PyPI v0.8.1] https://pypi.org/project/plex-api-client/0.8.1 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index ec2147c..1f4ed10 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,63 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: + - 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"]["/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"]["/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"]["/myplex/account"]["get"] update: x-codeSamples: @@ -19,276 +76,6 @@ actions: res = s.server.get_my_plex_account() - 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"]["/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"]["/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.playlists.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"]["/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/{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"]["/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"]["/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"]["/:/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"]["/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"]["/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"]["/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"]["/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"]["/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 @@ -311,11 +98,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}/items"]["get"] + - target: $["paths"]["/log/networked"]["get"] update: x-codeSamples: - lang: python - label: getPlaylistContents + label: enablePaperTrail source: |- import plex_api @@ -325,35 +112,16 @@ actions: ) - 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) + res = s.log.enable_paper_trail() if res is not None: # handle response pass - - target: $["paths"]["/hubs/search"]["get"] + - target: $["paths"]["/library/recentlyAdded"]["get"] update: x-codeSamples: - lang: python - label: performSearch + label: getRecentlyAdded source: |- import plex_api @@ -363,52 +131,7 @@ actions: ) - res = s.search.perform_search(query='dylan', section_id=1516.53, limit=5) - - if res 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"]["/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', - )) + res = s.library.get_recently_added() if res.object is not None: # handle response @@ -452,11 +175,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/hubs"]["get"] + - target: $["paths"]["/library/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: python - label: getGlobalHubs + label: getLibrary source: |- import plex_api from plex_api.models import operations @@ -467,11 +190,144 @@ actions: ) - res = s.hubs.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + res = s.library.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) 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.sessions.get_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"]["/video/:/transcode/universal/start.mpd"]["get"] + update: + x-codeSamples: + - lang: python + label: startUniversalTranscode + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.video.start_universal_transcode(request=operations.StartUniversalTranscodeRequest( + has_mde=1, + path='/library/metadata/23409', + media_index=0, + part_index=0, + protocol='hls', + fast_seek=0, + direct_play=0, + direct_stream=0, + subtitle_size=100, + subtites='burn', + audio_boost=100, + location='lan', + media_buffer_size=102400, + session='zvcage8b7rkioqcm8f4uns4c', + add_debug_overlay=0, + auto_adjust_quality=0, + )) + + 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.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}/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"]["/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: @@ -511,11 +367,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/:/scrobble"]["get"] + - target: $["paths"]["/devices"]["get"] update: x-codeSamples: - lang: python - label: markPlayed + label: getDevices source: |- import plex_api @@ -525,241 +381,11 @@ actions: ) - res = s.media.mark_played(key=59398) - - 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) + res = s.server.get_devices() 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"]["/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"]["/"]["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"]["/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"]["/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"]["/status/sessions/history/all"]["get"] - update: - x-codeSamples: - - lang: python - label: getSessionHistory - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.sessions.get_session_history() - - if res.object 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.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=1, tag=operations.Tag.GENRE) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/activities/{activityUUID}"]["delete"] - update: - x-codeSamples: - - lang: python - label: cancelServerActivities - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.activities.cancel_server_activities(activity_uuid='25b71ed5-0f9d-461c-baa7-d404e9e10d3e') - - 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/onDeck"]["get"] update: x-codeSamples: @@ -779,82 +405,6 @@ actions: 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"]["/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"]["/video/:/transcode/universal/start.mpd"]["get"] - update: - x-codeSamples: - - lang: python - label: startUniversalTranscode - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.video.start_universal_transcode(request=operations.StartUniversalTranscodeRequest( - has_mde=1, - path='/library/metadata/23409', - media_index=0, - part_index=0, - protocol='hls', - fast_seek=0, - direct_play=0, - direct_stream=0, - subtitle_size=100, - subtites='burn', - audio_boost=100, - location='lan', - media_buffer_size=102400, - session='zvcage8b7rkioqcm8f4uns4c', - add_debug_overlay=0, - auto_adjust_quality=0, - )) - - if res is not None: - # handle response - pass - target: $["paths"]["/pins"]["post"] update: x-codeSamples: @@ -873,31 +423,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/updater/check"]["put"] + - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] 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"]["/:/prefs"]["get"] - update: - x-codeSamples: - - lang: python - label: getServerPreferences + label: getMetadataChildren source: |- import plex_api @@ -907,16 +437,16 @@ actions: ) - res = s.server.get_server_preferences() + res = s.library.get_metadata_children(rating_key=1539.14) if res.object is not None: # handle response pass - - target: $["paths"]["/devices"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["put"] update: x-codeSamples: - lang: python - label: getDevices + label: addPlaylistContents source: |- import plex_api @@ -926,46 +456,7 @@ actions: ) - res = s.server.get_devices() - - 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.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/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() + 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.object is not None: # handle response @@ -987,6 +478,56 @@ actions: res = s.playlists.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) + if res 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"]["/:/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 @@ -1009,6 +550,26 @@ actions: if res is not None: # handle response pass + - target: $["paths"]["/hubs"]["get"] + update: + x-codeSamples: + - lang: python + 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"]["/butler"]["delete"] update: x-codeSamples: @@ -1028,11 +589,49 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + - target: $["paths"]["/butler/{taskName}"]["delete"] update: x-codeSamples: - lang: python - label: getMetadataChildren + 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 is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}/items"]["get"] + update: + x-codeSamples: + - lang: python + label: getPlaylistContents source: |- import plex_api @@ -1042,16 +641,16 @@ actions: ) - res = s.library.get_metadata_children(rating_key=1539.14) + res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59) if res.object is not None: # handle response pass - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] + - target: $["paths"]["/"]["get"] update: x-codeSamples: - lang: python - label: stopTranscodeSession + label: getServerCapabilities source: |- import plex_api @@ -1061,9 +660,9 @@ actions: ) - res = s.sessions.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') + res = s.server.get_server_capabilities() - if res is not None: + if res.object is not None: # handle response pass - target: $["paths"]["/identity"]["get"] @@ -1085,11 +684,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/library/sections"]["get"] + - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: python - label: getLibraries + label: markPlayed source: |- import plex_api @@ -1099,7 +698,93 @@ actions: ) - res = s.library.get_libraries() + res = s.media.mark_played(key=59398) + + 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"]["/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"]["/:/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"]["/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 @@ -1122,6 +807,261 @@ actions: 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"]["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"]["/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"]["/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"]["/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"]["/activities/{activityUUID}"]["delete"] + update: + x-codeSamples: + - lang: python + label: cancelServerActivities + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.activities.cancel_server_activities(activity_uuid='25b71ed5-0f9d-461c-baa7-d404e9e10d3e') + + 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: + # handle response + pass + - target: $["paths"]["/status/sessions/history/all"]["get"] + update: + x-codeSamples: + - lang: python + label: getSessionHistory + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.sessions.get_session_history() + + 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"]["/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"]["/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"]["/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 @@ -1144,11 +1084,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/status/sessions"]["get"] + - target: $["paths"]["/clients"]["get"] update: x-codeSamples: - lang: python - label: getSessions + label: getAvailableClients source: |- import plex_api @@ -1158,16 +1098,16 @@ actions: ) - res = s.sessions.get_sessions() + res = s.server.get_available_clients() if res.object is not None: # handle response pass - - target: $["paths"]["/:/unscrobble"]["get"] + - target: $["paths"]["/library/sections/{sectionId}"]["delete"] update: x-codeSamples: - lang: python - label: markUnplayed + label: deleteLibrary source: |- import plex_api @@ -1177,16 +1117,56 @@ actions: ) - res = s.media.mark_unplayed(key=59398) + res = s.library.delete_library(section_id=1000) if res is not None: # handle response pass - - target: $["paths"]["/butler"]["get"] + - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] update: x-codeSamples: - lang: python - label: getButlerTasks + 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=1, tag=operations.Tag.GENRE) + + 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"]["/statistics/media"]["get"] + update: + x-codeSamples: + - lang: python + label: getStatistics source: |- import plex_api @@ -1196,8 +1176,28 @@ actions: ) - res = s.butler.get_butler_tasks() + res = s.statistics.get_statistics(timespan=4) 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