diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b11d6fb..b9f7100 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.276.0 +speakeasyVersion: 1.277.0 sources: my-source: {} targets: diff --git a/RELEASES.md b/RELEASES.md index 779961f..8201082 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -268,4 +268,14 @@ Based on: ### Generated - [python v0.6.5] . ### Releases +- [PyPI v0.6.5] https://pypi.org/project/plex-api-client/0.6.5 - . + +## 2024-04-30 01:14:26 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.277.0 (2.317.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [python v0.6.5] . +### Releases - [PyPI v0.6.5] https://pypi.org/project/plex-api-client/0.6.5 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 387388b..abcd7b4 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,6 +3,140 @@ 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.get_butler_tasks() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/:/progress"]["post"] + update: + x-codeSamples: + - lang: python + label: updatePlayProgress + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.update_play_progress(key='', time=6900.91, state='') + + 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.get_libraries() + + 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.get_transcode_sessions() + + 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.get_metadata(rating_key=8382.31) + + 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.get_playlists(playlist_type=operations.PlaylistType.AUDIO, smart=operations.QueryParamSmart.ZERO) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/hubs/search"]["get"] + update: + x-codeSamples: + - lang: python + label: performSearch + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.perform_search(query='dylan', section_id=1516.53, limit=5) + + if res is not None: + # handle response + pass - target: $["paths"]["/library/sections/{sectionId}/search"]["get"] update: x-codeSamples: @@ -23,62 +157,32 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/search"]["get"] + - target: $["paths"]["/playlists"]["post"] update: x-codeSamples: - lang: python - label: getSearchResults + 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.get_search_results(query='110') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/butler"]["get"] - update: - x-codeSamples: - - lang: python - label: getButlerTasks - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', + req = operations.CreatePlaylistRequest( + title='', + type=operations.QueryParamType.PHOTO, + smart=operations.Smart.ONE, + uri='https://inborn-brochure.biz', ) - - res = s.get_butler_tasks() + res = s.create_playlist(req) 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.get_token(pin_id='', x_plex_client_identifier='Postman') - - if res is not None: - # handle response - pass - target: $["paths"]["/myplex/account"]["get"] update: x-codeSamples: @@ -98,6 +202,66 @@ actions: if res.object is not None: # handle response pass + - target: $["paths"]["/butler"]["delete"] + update: + x-codeSamples: + - lang: python + label: stopAllTasks + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.stop_all_tasks() + + if res is not None: + # handle response + pass + - target: $["paths"]["/log"]["post"] + update: + x-codeSamples: + - lang: python + label: logMultiLine + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + req = 'level=4&message=Test%20message%201&source=postman + level=3&message=Test%20message%202&source=postman + level=1&message=Test%20message%203&source=postman' + + res = s.log_multi_line(req) + + if res is not None: + # handle response + pass + - target: $["paths"]["/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.update_playlist(playlist_id=3915, title='', summary='') + + if res is not None: + # handle response + pass - target: $["paths"]["/playlists/{playlistID}/items"]["get"] update: x-codeSamples: @@ -114,6 +278,151 @@ actions: res = s.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.get_update_status() + + 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.get_server_list() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/library/sections/{sectionId}/{tag}"]["get"] + update: + x-codeSamples: + - lang: python + label: getLibraryItems + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_library_items(section_id=451092, tag=operations.Tag.UNWATCHED) + + 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', + ) + + req = 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.get_resized_photo(req) + + 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.start_all_tasks() + + if res is not None: + # handle response + pass + - target: $["paths"]["/butler/{taskName}"]["post"] + update: + x-codeSamples: + - lang: python + label: startTask + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) + + 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.get_search_results(query='110') + if res.object is not None: # handle response pass @@ -157,11 +466,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/library/recentlyAdded"]["get"] + - target: $["paths"]["/:/prefs"]["get"] update: x-codeSamples: - lang: python - label: getRecentlyAdded + label: getServerPreferences source: |- import plex_api @@ -171,68 +480,11 @@ actions: ) - res = s.get_recently_added() + res = s.get_server_preferences() 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.update_playlist(playlist_id=3915, title='', summary='') - - if res is not None: - # handle response - pass - - target: $["paths"]["/security/resources"]["get"] - update: - x-codeSamples: - - lang: python - label: getSourceConnectionInformation - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_source_connection_information(source='server://client-identifier') - - if res is not None: - # handle response - pass - - target: $["paths"]["/library/hashes"]["get"] - update: - x-codeSamples: - - lang: python - label: getFileHash - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) - - if res is not None: - # handle response - pass - target: $["paths"]["/activities"]["get"] update: x-codeSamples: @@ -252,30 +504,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/log/networked"]["get"] + - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] update: x-codeSamples: - lang: python - label: enablePaperTrail - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.enable_paper_trail() - - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists"]["get"] - update: - x-codeSamples: - - lang: python - label: getPlaylists + label: getLibraryHubs source: |- import plex_api from plex_api.models import operations @@ -286,244 +519,7 @@ actions: ) - res = s.get_playlists(playlist_type=operations.PlaylistType.AUDIO, smart=operations.QueryParamSmart.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/transcode/sessions"]["get"] - update: - x-codeSamples: - - lang: python - label: getTranscodeSessions - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_transcode_sessions() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/devices"]["get"] - update: - x-codeSamples: - - lang: python - label: getDevices - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_devices() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/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.perform_search(query='dylan', section_id=1516.53, limit=5) - - 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.refresh_library(section_id=934.16) - - 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.get_pin(strong=False, x_plex_client_identifier='Postman') - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] - update: - x-codeSamples: - - lang: python - label: stopTranscodeSession - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') - - if res is not None: - # handle response - pass - - target: $["paths"]["/:/prefs"]["get"] - update: - x-codeSamples: - - lang: python - label: getServerPreferences - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_server_preferences() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/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', - ) - - req = operations.StartUniversalTranscodeRequest( - has_mde=8924.99, - path='/etc/mail', - media_index=9962.95, - part_index=1232.82, - protocol='', - ) - - res = s.start_universal_transcode(req) - - 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.get_server_capabilities() - - 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 - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/sections/{sectionId}"]["get"] - update: - x-codeSamples: - - lang: python - label: getLibrary - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/library/metadata/{ratingKey}"]["get"] - update: - x-codeSamples: - - lang: python - label: getMetadata - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_metadata(rating_key=8382.31) + res = s.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=operations.QueryParamOnlyTransient.ZERO) if res.object is not None: # handle response @@ -547,82 +543,6 @@ actions: 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.start_all_tasks() - - 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.get_server_list() - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/:/unscrobble"]["get"] - update: - x-codeSamples: - - lang: python - label: markUnplayed - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.mark_unplayed(key=59398) - - if res is not None: - # handle response - pass - - target: $["paths"]["/butler"]["delete"] - update: - x-codeSamples: - - lang: python - label: stopAllTasks - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.stop_all_tasks() - - if res is not None: - # handle response - pass - target: $["paths"]["/library/onDeck"]["get"] update: x-codeSamples: @@ -642,11 +562,11 @@ actions: if res.object is not None: # handle response pass - - target: $["paths"]["/identity"]["get"] + - target: $["paths"]["/status/sessions"]["get"] update: x-codeSamples: - lang: python - label: getServerIdentity + label: getSessions source: |- import plex_api @@ -656,16 +576,16 @@ actions: ) - res = s.get_server_identity() + res = s.get_sessions() if res.object is not None: # handle response pass - - target: $["paths"]["/activities/{activityUUID}"]["delete"] + - target: $["paths"]["/transcode/sessions/{sessionKey}"]["delete"] update: x-codeSamples: - lang: python - label: cancelServerActivities + label: stopTranscodeSession source: |- import plex_api @@ -675,36 +595,16 @@ actions: ) - res = s.cancel_server_activities(activity_uuid='') + res = s.stop_transcode_session(session_key='zz7llzqlx8w9vnrsbnwhbmep') if res is not None: # handle response pass - - target: $["paths"]["/hubs/sections/{sectionId}"]["get"] + - target: $["paths"]["/"]["get"] update: x-codeSamples: - lang: python - label: getLibraryHubs - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_library_hubs(section_id=6728.76, count=9010.22, only_transient=operations.QueryParamOnlyTransient.ZERO) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/hubs/search/voice"]["get"] - update: - x-codeSamples: - - lang: python - label: performVoiceSearch + label: getServerCapabilities source: |- import plex_api @@ -714,337 +614,7 @@ actions: ) - res = s.perform_voice_search(query='dead+poop', section_id=4094.8, limit=5) - - 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_line(level=operations.Level.THREE, message='Test log message', source='Postman') - - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}"]["delete"] - update: - x-codeSamples: - - lang: python - label: deletePlaylist - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.delete_playlist(playlist_id=216.22) - - 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.check_for_updates(download=operations.Download.ONE) - - 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.get_available_clients() - - 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.start_task(task_name=operations.TaskName.CLEAN_OLD_BUNDLES) - - if res is not None: - # handle response - pass - - target: $["paths"]["/log"]["post"] - update: - x-codeSamples: - - lang: python - label: logMultiLine - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - req = 'level=4&message=Test%20message%201&source=postman - level=3&message=Test%20message%202&source=postman - level=1&message=Test%20message%203&source=postman' - - res = s.log_multi_line(req) - - if res is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}"]["get"] - update: - x-codeSamples: - - lang: python - label: getPlaylist - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.get_playlist(playlist_id=4109.48) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/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.get_statistics(timespan=411769) - - 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.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ZERO) - - if res is not None: - # handle response - pass - - target: $["paths"]["/:/progress"]["post"] - update: - x-codeSamples: - - lang: python - label: updatePlayProgress - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.update_play_progress(key='', time=6900.91, state='') - - if res is not None: - # handle response - pass - - target: $["paths"]["/butler/{taskName}"]["delete"] - update: - x-codeSamples: - - lang: python - label: stopTask - source: |- - import plex_api - from plex_api.models import operations - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) - - if res is not None: - # handle response - pass - - target: $["paths"]["/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.get_library_items(section_id=451092, tag=operations.Tag.UNWATCHED) - - 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', - ) - - req = operations.CreatePlaylistRequest( - title='', - type=operations.QueryParamType.PHOTO, - smart=operations.Smart.ONE, - uri='https://inborn-brochure.biz', - ) - - res = s.create_playlist(req) - - if res.object is not None: - # handle response - pass - - target: $["paths"]["/playlists/{playlistID}/items"]["put"] - update: - x-codeSamples: - - lang: python - label: addPlaylistContents - source: |- - import plex_api - - s = plex_api.PlexAPI( - access_token="", - x_plex_client_identifier='Postman', - ) - - - res = s.add_playlist_contents(playlist_id=8502.01, uri='server://12345/com.plexapp.plugins.library/library/metadata/1', play_queue_id=123) - - if res.object is not None: - # handle response - 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', - ) - - req = 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.get_resized_photo(req) - - 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.get_libraries() + res = s.get_server_capabilities() if res.object is not None: # handle response @@ -1078,6 +648,121 @@ actions: res = s.get_timeline(req) + if res is not None: + # handle response + pass + - target: $["paths"]["/library/hashes"]["get"] + update: + x-codeSamples: + - lang: python + label: getFileHash + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_file_hash(url='file://C:\Image.png&type=13', type=4462.17) + + 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.enable_paper_trail() + + 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.apply_updates(tonight=operations.Tonight.ONE, skip=operations.Skip.ZERO) + + 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.refresh_library(section_id=934.16) + + 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_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.get_token(pin_id='', x_plex_client_identifier='Postman') + if res is not None: # handle response pass @@ -1100,11 +785,11 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/status/sessions/history/all"]["get"] + - target: $["paths"]["/clients"]["get"] update: x-codeSamples: - lang: python - label: getSessionHistory + label: getAvailableClients source: |- import plex_api @@ -1114,7 +799,7 @@ actions: ) - res = s.get_session_history() + res = s.get_available_clients() if res.object is not None: # handle response @@ -1138,11 +823,38 @@ actions: if res is not None: # handle response pass - - target: $["paths"]["/status/sessions"]["get"] + - target: $["paths"]["/video/:/transcode/universal/start.mpd"]["get"] update: x-codeSamples: - lang: python - label: getSessions + label: startUniversalTranscode + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + req = operations.StartUniversalTranscodeRequest( + has_mde=8924.99, + path='/etc/mail', + media_index=9962.95, + part_index=1232.82, + protocol='', + ) + + res = s.start_universal_transcode(req) + + if res is not None: + # handle response + pass + - target: $["paths"]["/activities/{activityUUID}"]["delete"] + update: + x-codeSamples: + - lang: python + label: cancelServerActivities source: |- import plex_api @@ -1152,16 +864,35 @@ actions: ) - res = s.get_sessions() + res = s.cancel_server_activities(activity_uuid='') + + if res is not None: + # handle response + pass + - target: $["paths"]["/devices"]["get"] + update: + x-codeSamples: + - lang: python + label: getDevices + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_devices() if res.object is not None: # handle response pass - - target: $["paths"]["/updater/status"]["get"] + - target: $["paths"]["/hubs/search/voice"]["get"] update: x-codeSamples: - lang: python - label: getUpdateStatus + label: performVoiceSearch source: |- import plex_api @@ -1171,7 +902,27 @@ actions: ) - res = s.get_update_status() + res = s.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}"]["get"] + update: + x-codeSamples: + - lang: python + label: getLibrary + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_library(section_id=1000, include_details=operations.IncludeDetails.ZERO) if res.object is not None: # handle response @@ -1195,3 +946,252 @@ actions: 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.get_session_history() + + 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.check_for_updates(download=operations.Download.ONE) + + 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.mark_unplayed(key=59398) + + 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.get_pin(strong=False, x_plex_client_identifier='Postman') + + 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.get_playlist(playlist_id=4109.48) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/identity"]["get"] + update: + x-codeSamples: + - lang: python + label: getServerIdentity + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.get_server_identity() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/butler/{taskName}"]["delete"] + update: + x-codeSamples: + - lang: python + label: stopTask + source: |- + import plex_api + from plex_api.models import operations + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.stop_task(task_name=operations.PathParamTaskName.BACKUP_DATABASE) + + if res is not None: + # handle response + pass + - target: $["paths"]["/hubs"]["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.get_global_hubs(count=1262.49, only_transient=operations.OnlyTransient.ONE) + + 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.get_recently_added() + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}/items"]["put"] + update: + x-codeSamples: + - lang: python + label: addPlaylistContents + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.add_playlist_contents(playlist_id=8502.01, uri='server://12345/com.plexapp.plugins.library/library/metadata/1', play_queue_id=123) + + if res.object is not None: + # handle response + pass + - target: $["paths"]["/playlists/{playlistID}"]["delete"] + update: + x-codeSamples: + - lang: python + label: deletePlaylist + source: |- + import plex_api + + s = plex_api.PlexAPI( + access_token="", + x_plex_client_identifier='Postman', + ) + + + res = s.delete_playlist(playlist_id=216.22) + + if res is not None: + # handle response + pass + - target: $["paths"]["/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.get_source_connection_information(source='server://client-identifier') + + 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.get_statistics(timespan=411769) + + if res.object is not None: + # handle response + pass