diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 46a72e9..736a15e 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.305.0 +speakeasyVersion: 1.306.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:99dc9797f3f689b6420ad3c563e53a9357bae703d82bec113a6db3cb1799ce2e - sourceBlobDigest: sha256:b22989245548995f4b61bcc4ad027b553786bca742a94dd2a21f06d05719964a + sourceRevisionDigest: sha256:c661461e812b435c03e582528fc079a40116a7794349548e439433810462ede2 + sourceBlobDigest: sha256:01ea875ed58731c7f0da0076a2f593efd48353df386b633ed2cc79b6de77be5f tags: - latest - main @@ -11,8 +11,8 @@ targets: plexpy: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:99dc9797f3f689b6420ad3c563e53a9357bae703d82bec113a6db3cb1799ce2e - sourceBlobDigest: sha256:b22989245548995f4b61bcc4ad027b553786bca742a94dd2a21f06d05719964a + sourceRevisionDigest: sha256:c661461e812b435c03e582528fc079a40116a7794349548e439433810462ede2 + sourceBlobDigest: sha256:01ea875ed58731c7f0da0076a2f593efd48353df386b633ed2cc79b6de77be5f outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 0dafe0b..2170f54 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -588,4 +588,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-13 00:22:27 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.306.0 (2.340.3) 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 a29e057..f75a3b1 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,83 +3,6 @@ info: title: CodeSamples overlay for python target version: 0.0.0 actions: - - 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"]["/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"]["/:/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"]["/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/metadata/{ratingKey}"]["get"] update: x-codeSamples: @@ -96,102 +19,6 @@ actions: res = s.library.get_metadata(rating_key=8382.31) - 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"]["/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"]["/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"]["/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"]["/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 @@ -214,11 +41,29 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}"]["delete"] + - target: $["paths"]["/pins/{pinID}"]["get"] update: x-codeSamples: - lang: python - label: deletePlaylist + 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 @@ -228,16 +73,16 @@ actions: ) - res = s.playlists.delete_playlist(playlist_id=216.22) + res = s.playlists.get_playlist_contents(playlist_id=5004.46, type=9403.59) - if res is not None: + if res.object is not None: # handle response pass - - target: $["paths"]["/updater/apply"]["put"] + - target: $["paths"]["/butler/{taskName}"]["post"] update: x-codeSamples: - lang: python - label: applyUpdates + label: startTask source: |- import plex_api from plex_api.models import operations @@ -248,7 +93,26 @@ actions: ) - res = s.updater.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ONE) + res = s.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) + + 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 @@ -278,140 +142,6 @@ actions: url='/library/metadata/49564/thumb/1654258204', )) - 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"]["/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"]["/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"]["/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"]["/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/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}"]["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 @@ -452,14 +182,13 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/log"]["get"] + - target: $["paths"]["/search"]["get"] update: x-codeSamples: - lang: python - label: logLine + label: getSearchResults source: |- import plex_api - from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -467,55 +196,11 @@ actions: ) - 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"]["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.search.get_search_results(query='110') 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: @@ -535,11 +220,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/library/metadata/{ratingKey}/children"]["get"] + - target: $["paths"]["/myplex/account"]["get"] update: x-codeSamples: - lang: python - label: getMetadataChildren + label: getMyPlexAccount source: |- import plex_api @@ -549,16 +234,54 @@ actions: ) - res = s.library.get_metadata_children(rating_key=1539.14) + res = s.server.get_my_plex_account() if res.object is not None: # handle response pass - - target: $["paths"]["/playlists"]["get"] + - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] update: x-codeSamples: - lang: python - label: getPlaylists + 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"]["/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"]["/updater/check"]["put"] + update: + x-codeSamples: + - lang: python + label: checkForUpdates source: |- import plex_api from plex_api.models import operations @@ -569,16 +292,47 @@ actions: ) - res = s.playlists.get_playlists(playlist_type=operations.PlaylistType.AUDIO, smart=operations.QueryParamSmart.ZERO) + res = s.updater.check_for_updates(download=operations.Download.ONE) - if res.object is not None: + if res is not None: # handle response pass - - target: $["paths"]["/:/prefs"]["get"] + - target: $["paths"]["/:/timeline"]["get"] update: x-codeSamples: - lang: python - label: getServerPreferences + 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/recentlyAdded"]["get"] + update: + x-codeSamples: + - lang: python + label: getRecentlyAdded source: |- import plex_api @@ -588,11 +342,30 @@ actions: ) - res = s.server.get_server_preferences() + res = s.library.get_recently_added() 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"]["/log"]["post"] update: x-codeSamples: @@ -614,49 +387,67 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/playlists/{playlistID}/items"]["delete"] + - target: $["paths"]["/pins"]["post"] update: x-codeSamples: - lang: python - label: clearPlaylistContents + label: getPin 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"]["/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() + res = s.plex.get_pin(strong=False, x_plex_client_identifier='Postman') if res.object is not None: # handle response pass - - target: $["paths"]["/butler/{taskName}"]["post"] + - target: $["paths"]["/playlists/{playlistID}"]["get"] update: x-codeSamples: - lang: python - label: startTask + 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"]["/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"]["/hubs"]["get"] + update: + x-codeSamples: + - lang: python + label: getGlobalHubs source: |- import plex_api from plex_api.models import operations @@ -667,16 +458,111 @@ actions: ) - res = s.butler.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) + 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"]["/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"]["/updater/check"]["put"] + - target: $["paths"]["/security/resources"]["get"] update: x-codeSamples: - lang: python - label: checkForUpdates + 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"]["/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"]["/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"]["/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"]["/playlists/upload"]["post"] + update: + x-codeSamples: + - lang: python + label: uploadPlaylist source: |- import plex_api from plex_api.models import operations @@ -687,16 +573,16 @@ actions: ) - res = s.updater.check_for_updates(download=operations.Download.ONE) + res = s.playlists.upload_playlist(path='/home/barkley/playlist.m3u', force=operations.Force.ZERO) if res is not None: # handle response pass - - target: $["paths"]["/:/progress"]["post"] + - target: $["paths"]["/statistics/media"]["get"] update: x-codeSamples: - lang: python - label: updatePlayProgress + label: getStatistics source: |- import plex_api @@ -706,19 +592,18 @@ actions: ) - res = s.media.update_play_progress(key='', time=90000, state='played') + res = s.statistics.get_statistics(timespan=4) - if res is not None: + if res.object is not None: # handle response pass - - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] + - target: $["paths"]["/identity"]["get"] update: x-codeSamples: - lang: python - label: getLibraryItems + label: getServerIdentity source: |- import plex_api - from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -726,7 +611,64 @@ actions: ) - res = s.library.get_library_items(section_id=1, tag=operations.Tag.GENRE) + res = s.server.get_server_identity() + + 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"]["/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"]["/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 @@ -750,6 +692,45 @@ actions: 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"]["/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) + + if res.object is not None: + # handle response + pass - target: $["paths"]["/playlists/{playlistID}"]["put"] update: x-codeSamples: @@ -769,25 +750,6 @@ actions: 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"]["/butler"]["get"] update: x-codeSamples: @@ -804,80 +766,6 @@ actions: res = s.butler.get_butler_tasks() - 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"]["/pins"]["post"] - update: - x-codeSamples: - - lang: python - label: getPin - source: |- - import plex_api - - s = plex_api.PlexAPI( - x_plex_client_identifier='Postman', - ) - - - res = s.plex.get_pin(strong=False, x_plex_client_identifier='Postman') - - 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"]["/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 @@ -919,68 +807,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/search"]["get"] + - target: $["paths"]["/playlists"]["post"] 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"]["/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() - - 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"]["/:/timeline"]["get"] - update: - x-codeSamples: - - lang: python - label: getTimeline + label: createPlaylist source: |- import plex_api from plex_api.models import operations @@ -991,86 +822,21 @@ actions: ) - 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, + res = s.playlists.create_playlist(request=operations.CreatePlaylistRequest( + title='', + type=operations.QueryParamType.PHOTO, + smart=operations.Smart.ONE, + uri='https://inborn-brochure.biz', )) - 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"]["/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"]["/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"]["/transcode/sessions/{sessionKey}"]["delete"] + - target: $["paths"]["/hubs/search"]["get"] update: x-codeSamples: - lang: python - label: stopTranscodeSession + label: performSearch source: |- import plex_api @@ -1080,7 +846,7 @@ actions: ) - res = s.sessions.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') + res = s.search.perform_search(query='dylan', section_id=1516.53, limit=5) if res is not None: # handle response @@ -1104,11 +870,71 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/butler"]["delete"] + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: python - label: stopAllTasks + 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"]["/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"]["/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"]["/playlists/{playlistID}/items"]["put"] + update: + x-codeSamples: + - lang: python + label: addPlaylistContents source: |- import plex_api @@ -1118,7 +944,180 @@ actions: ) - res = s.butler.stop_all_tasks() + 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"]["/:/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"]["/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"]["/:/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"]["/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"]["/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"]["/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"]["/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"]["/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 @@ -1143,11 +1142,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/hubs"]["get"] + - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] update: x-codeSamples: - lang: python - label: getGlobalHubs + label: searchLibrary source: |- import plex_api from plex_api.models import operations @@ -1158,16 +1157,16 @@ actions: ) - res = s.hubs.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + res = s.library.search_library(section_id=933505, type=operations.Type.FOUR) if res.object is not None: # handle response pass - - target: $["paths"]["/hubs/search"]["get"] + - target: $["paths"]["/:/scrobble"]["get"] update: x-codeSamples: - lang: python - label: performSearch + label: markPlayed source: |- import plex_api @@ -1177,18 +1176,19 @@ actions: ) - res = s.search.perform_search(query='dylan', section_id=1516.53, limit=5) + res = s.media.mark_played(key=59398) if res is not None: # handle response pass - - target: $["paths"]["/library/onDeck"]["get"] + - target: $["paths"]["/butler/{taskName}"]["delete"] update: x-codeSamples: - lang: python - label: getOnDeck + label: stopTask source: |- import plex_api + from plex_api.models import operations s = plex_api.PlexAPI( access_token="", @@ -1196,8 +1196,8 @@ actions: ) - res = s.library.get_on_deck() + res = s.butler.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) - if res.object is not None: + if res is not None: # handle response pass