From 4e989e0de3754759ac1271b375230e31d6047f45 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 20 Dec 2024 16:02:41 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.456.1 --- .npmignore | 3 + .speakeasy/gen.lock | 41 +- .speakeasy/gen.yaml | 3 +- .speakeasy/workflow.lock | 19 +- FUNCTIONS.md | 5 - README.md | 307 ++++----- RELEASES.md | 12 +- USAGE.md | 5 - codeSamples.yaml | 416 +----------- .../getlibraryitemsmediacontainer.md | 2 +- .../operations/getlibraryitemsmetadata.md | 4 +- .../getlibraryitemsqueryparamtype.md | 4 +- .../operations/getlibraryitemsrequest.md | 2 +- .../operations/getlibraryitemsresponse.md | 2 +- .../operations/getlibraryitemsresponsebody.md | 2 +- .../operations/getlibraryitemsshowordering.md | 28 +- .../getmetadatabyratingkeymetadata.md | 5 + docs/sdk/models/operations/getpinglobals.md | 19 - docs/sdk/models/operations/getpinrequest.md | 10 +- .../getplaylistcontentsqueryparamtype.md | 4 +- .../getrecentlyaddedmediacontainer.md | 2 +- .../operations/getrecentlyaddedmetadata.md | 4 +- .../operations/getrecentlyaddedresponse.md | 2 +- .../getrecentlyaddedresponsebody.md | 2 +- .../getsearchalllibrariesglobals.md | 15 - .../getsearchalllibrariesmediacontainer.md | 2 +- .../getsearchalllibrariesmetadata.md | 4 +- .../getsearchalllibrariesrequest.md | 3 +- .../getsearchalllibrariesresponse.md | 2 +- .../getsearchalllibrariesresponsebody.md | 2 +- .../getsearchalllibrariesshowordering.md | 28 +- .../getsearchlibraryqueryparamtype.md | 4 +- .../operations/getserverresourcesglobals.md | 15 - .../operations/getserverresourcesrequest.md | 3 +- .../operations/gettokenbypinidglobals.md | 19 - .../operations/gettokenbypinidrequest.md | 7 +- .../gettopwatchedcontentqueryparamtype.md | 4 +- .../operations/postuserssignindataglobals.md | 19 - .../operations/postuserssignindatarequest.md | 7 +- docs/sdk/models/operations/queryparamtype.md | 4 +- docs/sdk/models/operations/searchresult.md | 2 +- docs/sdk/models/operations/showordering.md | 28 +- docs/sdk/models/operations/tag.md | 5 +- docs/sdk/models/operations/type.md | 4 +- docs/sdks/activities/README.md | 20 - docs/sdks/authentication/README.md | 56 +- docs/sdks/butler/README.md | 50 -- docs/sdks/hubs/README.md | 30 - docs/sdks/library/README.md | 133 +--- docs/sdks/log/README.md | 30 - docs/sdks/media/README.md | 50 -- docs/sdks/playlists/README.md | 90 --- docs/sdks/plex/README.md | 120 +--- docs/sdks/plexapi/README.md | 3 + docs/sdks/search/README.md | 30 - docs/sdks/server/README.md | 96 +-- docs/sdks/sessions/README.md | 40 -- docs/sdks/statistics/README.md | 30 - docs/sdks/updater/README.md | 30 - docs/sdks/video/README.md | 20 - docs/sdks/watchlist/README.md | 10 - jsr.json | 2 +- package-lock.json | 4 +- package.json | 2 +- src/funcs/activitiesCancelServerActivities.ts | 16 +- src/funcs/activitiesGetServerActivities.ts | 16 +- ...nticationGetSourceConnectionInformation.ts | 16 +- src/funcs/authenticationGetTokenDetails.ts | 17 +- src/funcs/authenticationGetTransientToken.ts | 16 +- .../authenticationPostUsersSignInData.ts | 43 +- src/funcs/butlerGetButlerTasks.ts | 16 +- src/funcs/butlerStartAllTasks.ts | 16 +- src/funcs/butlerStartTask.ts | 16 +- src/funcs/butlerStopAllTasks.ts | 16 +- src/funcs/butlerStopTask.ts | 16 +- src/funcs/hubsGetGlobalHubs.ts | 16 +- src/funcs/hubsGetLibraryHubs.ts | 16 +- src/funcs/hubsGetRecentlyAdded.ts | 20 +- src/funcs/libraryDeleteLibrary.ts | 16 +- src/funcs/libraryGetAllLibraries.ts | 16 +- src/funcs/libraryGetFileHash.ts | 16 +- src/funcs/libraryGetLibraryDetails.ts | 18 +- src/funcs/libraryGetLibraryItems.ts | 21 +- src/funcs/libraryGetMetaDataByRatingKey.ts | 16 +- src/funcs/libraryGetMetadataChildren.ts | 16 +- src/funcs/libraryGetOnDeck.ts | 16 +- src/funcs/libraryGetRecentlyAddedLibrary.ts | 20 +- src/funcs/libraryGetRefreshLibraryMetadata.ts | 18 +- src/funcs/libraryGetSearchAllLibraries.ts | 25 +- src/funcs/libraryGetSearchLibrary.ts | 16 +- src/funcs/libraryGetTopWatchedContent.ts | 18 +- src/funcs/logEnablePaperTrail.ts | 16 +- src/funcs/logLogLine.ts | 16 +- src/funcs/logLogMultiLine.ts | 20 +- src/funcs/mediaGetBannerImage.ts | 20 +- src/funcs/mediaGetThumbImage.ts | 20 +- src/funcs/mediaMarkPlayed.ts | 16 +- src/funcs/mediaMarkUnplayed.ts | 16 +- src/funcs/mediaUpdatePlayProgress.ts | 16 +- src/funcs/playlistsAddPlaylistContents.ts | 16 +- src/funcs/playlistsClearPlaylistContents.ts | 16 +- src/funcs/playlistsCreatePlaylist.ts | 20 +- src/funcs/playlistsDeletePlaylist.ts | 16 +- src/funcs/playlistsGetPlaylist.ts | 16 +- src/funcs/playlistsGetPlaylistContents.ts | 16 +- src/funcs/playlistsGetPlaylists.ts | 16 +- src/funcs/playlistsUpdatePlaylist.ts | 16 +- src/funcs/playlistsUploadPlaylist.ts | 16 +- src/funcs/plexGetCompanionsData.ts | 17 +- src/funcs/plexGetGeoData.ts | 14 +- src/funcs/plexGetHomeData.ts | 16 +- src/funcs/plexGetPin.ts | 43 +- src/funcs/plexGetServerResources.ts | 26 +- src/funcs/plexGetTokenByPinId.ts | 43 +- src/funcs/plexGetUserFriends.ts | 17 +- src/funcs/searchGetSearchResults.ts | 16 +- src/funcs/searchPerformSearch.ts | 16 +- src/funcs/searchPerformVoiceSearch.ts | 16 +- src/funcs/serverGetAvailableClients.ts | 16 +- src/funcs/serverGetDevices.ts | 16 +- src/funcs/serverGetMediaProviders.ts | 16 +- src/funcs/serverGetMyPlexAccount.ts | 16 +- src/funcs/serverGetResizedPhoto.ts | 20 +- src/funcs/serverGetServerCapabilities.ts | 16 +- src/funcs/serverGetServerIdentity.ts | 13 +- src/funcs/serverGetServerList.ts | 16 +- src/funcs/serverGetServerPreferences.ts | 16 +- src/funcs/sessionsGetSessionHistory.ts | 16 +- src/funcs/sessionsGetSessions.ts | 16 +- src/funcs/sessionsGetTranscodeSessions.ts | 16 +- src/funcs/sessionsStopTranscodeSession.ts | 16 +- src/funcs/statisticsGetBandwidthStatistics.ts | 16 +- src/funcs/statisticsGetResourcesStatistics.ts | 16 +- src/funcs/statisticsGetStatistics.ts | 16 +- src/funcs/updaterApplyUpdates.ts | 16 +- src/funcs/updaterCheckForUpdates.ts | 16 +- src/funcs/updaterGetUpdateStatus.ts | 16 +- src/funcs/videoGetTimeline.ts | 20 +- src/funcs/videoStartUniversalTranscode.ts | 20 +- src/funcs/watchlistGetWatchList.ts | 21 +- src/hooks/hooks.ts | 20 + src/hooks/types.ts | 11 + src/lib/config.ts | 31 +- src/lib/matchers.ts | 2 +- src/lib/primitives.ts | 82 +++ src/lib/retries.ts | 94 ++- src/lib/sdks.ts | 41 +- src/lib/security.ts | 42 +- src/sdk/authentication.ts | 4 +- src/sdk/library.ts | 1 + src/sdk/models/errors/addplaylistcontents.ts | 42 ++ src/sdk/models/errors/applyupdates.ts | 39 ++ .../models/errors/cancelserveractivities.ts | 45 ++ src/sdk/models/errors/checkforupdates.ts | 41 ++ .../models/errors/clearplaylistcontents.ts | 44 ++ src/sdk/models/errors/createplaylist.ts | 41 ++ src/sdk/models/errors/deletelibrary.ts | 39 ++ src/sdk/models/errors/deleteplaylist.ts | 41 ++ src/sdk/models/errors/enablepapertrail.ts | 39 ++ src/sdk/models/errors/getalllibraries.ts | 41 ++ src/sdk/models/errors/getavailableclients.ts | 41 ++ .../models/errors/getbandwidthstatistics.ts | 45 ++ src/sdk/models/errors/getbannerimage.ts | 39 ++ src/sdk/models/errors/getbutlertasks.ts | 39 ++ src/sdk/models/errors/getcompanionsdata.ts | 41 ++ src/sdk/models/errors/getdevices.ts | 39 ++ src/sdk/models/errors/getfilehash.ts | 39 ++ src/sdk/models/errors/getgeodata.ts | 39 ++ src/sdk/models/errors/getglobalhubs.ts | 39 ++ src/sdk/models/errors/gethomedata.ts | 39 ++ src/sdk/models/errors/getlibrarydetails.ts | 41 ++ src/sdk/models/errors/getlibraryhubs.ts | 39 ++ src/sdk/models/errors/getlibraryitems.ts | 41 ++ src/sdk/models/errors/getmediaproviders.ts | 41 ++ .../models/errors/getmetadatabyratingkey.ts | 44 ++ src/sdk/models/errors/getmetadatachildren.ts | 41 ++ src/sdk/models/errors/getmyplexaccount.ts | 41 ++ src/sdk/models/errors/getondeck.ts | 37 ++ src/sdk/models/errors/getpin.ts | 17 + src/sdk/models/errors/getplaylist.ts | 39 ++ src/sdk/models/errors/getplaylistcontents.ts | 42 ++ src/sdk/models/errors/getplaylists.ts | 41 ++ .../models/errors/getrecentlyaddedlibrary.ts | 44 ++ .../errors/getrefreshlibrarymetadata.ts | 45 ++ src/sdk/models/errors/getresizedphoto.ts | 41 ++ .../models/errors/getresourcesstatistics.ts | 45 ++ .../models/errors/getsearchalllibraries.ts | 44 ++ src/sdk/models/errors/getsearchlibrary.ts | 41 ++ src/sdk/models/errors/getsearchresults.ts | 41 ++ src/sdk/models/errors/getserveractivities.ts | 42 ++ .../models/errors/getservercapabilities.ts | 37 ++ src/sdk/models/errors/getserverlist.ts | 39 ++ src/sdk/models/errors/getserverpreferences.ts | 41 ++ src/sdk/models/errors/getserverresources.ts | 41 ++ src/sdk/models/errors/getsessionhistory.ts | 41 ++ src/sdk/models/errors/getsessions.ts | 39 ++ .../errors/getsourceconnectioninformation.ts | 51 ++ src/sdk/models/errors/getstatistics.ts | 41 ++ src/sdk/models/errors/getthumbimage.ts | 39 ++ src/sdk/models/errors/gettimeline.ts | 39 ++ src/sdk/models/errors/gettokenbypinid.ts | 39 ++ src/sdk/models/errors/gettokendetails.ts | 42 ++ src/sdk/models/errors/gettopwatchedcontent.ts | 41 ++ src/sdk/models/errors/gettranscodesessions.ts | 42 ++ src/sdk/models/errors/gettransienttoken.ts | 42 ++ src/sdk/models/errors/getupdatestatus.ts | 41 ++ src/sdk/models/errors/getuserfriends.ts | 39 ++ src/sdk/models/errors/getwatchlist.ts | 41 ++ src/sdk/models/errors/logline.ts | 35 + src/sdk/models/errors/logmultiline.ts | 39 ++ src/sdk/models/errors/markplayed.ts | 39 ++ src/sdk/models/errors/markunplayed.ts | 39 ++ src/sdk/models/errors/performsearch.ts | 39 ++ src/sdk/models/errors/performvoicesearch.ts | 41 ++ src/sdk/models/errors/postuserssignindata.ts | 48 ++ src/sdk/models/errors/startalltasks.ts | 39 ++ src/sdk/models/errors/starttask.ts | 37 ++ .../models/errors/startuniversaltranscode.ts | 44 ++ src/sdk/models/errors/stopalltasks.ts | 39 ++ src/sdk/models/errors/stoptask.ts | 35 + src/sdk/models/errors/stoptranscodesession.ts | 42 ++ src/sdk/models/errors/updateplaylist.ts | 41 ++ src/sdk/models/errors/updateplayprogress.ts | 41 ++ src/sdk/models/errors/uploadplaylist.ts | 41 ++ .../models/operations/addplaylistcontents.ts | 101 +++ src/sdk/models/operations/applyupdates.ts | 39 ++ .../operations/cancelserveractivities.ts | 43 ++ src/sdk/models/operations/checkforupdates.ts | 39 ++ .../operations/clearplaylistcontents.ts | 43 ++ src/sdk/models/operations/createplaylist.ts | 95 +++ src/sdk/models/operations/deletelibrary.ts | 39 ++ src/sdk/models/operations/deleteplaylist.ts | 39 ++ src/sdk/models/operations/enablepapertrail.ts | 21 + src/sdk/models/operations/getalllibraries.ts | 97 +++ .../models/operations/getavailableclients.ts | 77 +++ .../operations/getbandwidthstatistics.ts | 143 ++++ src/sdk/models/operations/getbannerimage.ts | 39 ++ src/sdk/models/operations/getbutlertasks.ts | 67 ++ .../models/operations/getcompanionsdata.ts | 35 + src/sdk/models/operations/getdevices.ts | 71 ++ src/sdk/models/operations/getfilehash.ts | 39 ++ src/sdk/models/operations/getgeodata.ts | 39 ++ src/sdk/models/operations/getglobalhubs.ts | 109 +++ src/sdk/models/operations/gethomedata.ts | 39 ++ .../models/operations/getlibrarydetails.ts | 205 ++++++ src/sdk/models/operations/getlibraryhubs.ts | 239 +++++++ src/sdk/models/operations/getlibraryitems.ts | 619 +++++++++++++++++- .../models/operations/getmediaproviders.ts | 153 +++++ .../operations/getmetadatabyratingkey.ts | 338 ++++++++++ .../models/operations/getmetadatachildren.ts | 121 ++++ src/sdk/models/operations/getmyplexaccount.ts | 55 ++ src/sdk/models/operations/getondeck.ts | 133 ++++ src/sdk/models/operations/getpin.ts | 158 ++--- src/sdk/models/operations/getplaylist.ts | 93 +++ .../models/operations/getplaylistcontents.ts | 231 +++++++ src/sdk/models/operations/getplaylists.ts | 93 +++ src/sdk/models/operations/getrecentlyadded.ts | 441 ++++++++++++- .../operations/getrecentlyaddedlibrary.ts | 343 ++++++++++ .../operations/getrefreshlibrarymetadata.ts | 43 ++ src/sdk/models/operations/getresizedphoto.ts | 39 ++ .../operations/getresourcesstatistics.ts | 103 +++ .../operations/getsearchalllibraries.ts | 467 +++++++++++-- src/sdk/models/operations/getsearchlibrary.ts | 99 +++ src/sdk/models/operations/getsearchresults.ts | 237 +++++++ .../models/operations/getserveractivities.ts | 91 +++ .../operations/getservercapabilities.ts | 71 ++ .../models/operations/getserveridentity.ts | 61 ++ src/sdk/models/operations/getserverlist.ts | 77 +++ .../models/operations/getserverpreferences.ts | 78 +++ .../models/operations/getserverresources.ts | 126 ++-- .../models/operations/getsessionhistory.ts | 115 ++++ src/sdk/models/operations/getsessions.ts | 171 +++++ .../getsourceconnectioninformation.ts | 46 ++ src/sdk/models/operations/getstatistics.ts | 125 ++++ src/sdk/models/operations/getthumbimage.ts | 39 ++ src/sdk/models/operations/gettimeline.ts | 39 ++ src/sdk/models/operations/gettokenbypinid.ts | 172 +++-- src/sdk/models/operations/gettokendetails.ts | 103 +++ .../models/operations/gettopwatchedcontent.ts | 194 ++++++ .../models/operations/gettranscodesessions.ts | 82 +++ .../models/operations/gettransienttoken.ts | 39 ++ src/sdk/models/operations/getupdatestatus.ts | 75 +++ src/sdk/models/operations/getuserfriends.ts | 63 ++ src/sdk/models/operations/getwatchlist.ts | 85 +++ src/sdk/models/operations/logline.ts | 33 + src/sdk/models/operations/logmultiline.ts | 21 + src/sdk/models/operations/markplayed.ts | 39 ++ src/sdk/models/operations/markunplayed.ts | 39 ++ src/sdk/models/operations/performsearch.ts | 39 ++ .../models/operations/performvoicesearch.ts | 39 ++ .../models/operations/postuserssignindata.ts | 328 +++++++--- src/sdk/models/operations/startalltasks.ts | 21 + src/sdk/models/operations/starttask.ts | 39 ++ .../operations/startuniversaltranscode.ts | 43 ++ src/sdk/models/operations/stopalltasks.ts | 21 + src/sdk/models/operations/stoptask.ts | 37 ++ .../models/operations/stoptranscodesession.ts | 43 ++ src/sdk/models/operations/updateplaylist.ts | 39 ++ .../models/operations/updateplayprogress.ts | 39 ++ src/sdk/models/operations/uploadplaylist.ts | 39 ++ src/sdk/models/shared/security.ts | 17 + src/sdk/plex.ts | 16 +- src/sdk/types/operations.ts | 16 +- src/sdk/watchlist.ts | 2 +- tsconfig.json | 1 + 305 files changed, 12286 insertions(+), 2514 deletions(-) delete mode 100644 docs/sdk/models/operations/getpinglobals.md delete mode 100644 docs/sdk/models/operations/getsearchalllibrariesglobals.md delete mode 100644 docs/sdk/models/operations/getserverresourcesglobals.md delete mode 100644 docs/sdk/models/operations/gettokenbypinidglobals.md delete mode 100644 docs/sdk/models/operations/postuserssignindataglobals.md diff --git a/.npmignore b/.npmignore index 06cd8abf..9ad259ee 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,7 @@ **/* +!/FUNCTIONS.md +!/RUNTIMES.md +!/REACT_QUERY.md !/**/*.ts !/**/*.js !/**/*.map diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index e05b501d..3a2842fc 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 16f22cbf-f23f-4419-8924-3a4b06381947 management: - docChecksum: 2554ade61ed4d42b8e095168765d7dc0 + docChecksum: dc7ff4de161f3992a3f9897b6d08edb8 docVersion: 0.0.3 - speakeasyVersion: 1.405.6 - generationVersion: 2.428.1 - releaseVersion: 0.31.1 - configChecksum: 0842824e4917c8e205902e589a39c6fd + speakeasyVersion: 1.456.1 + generationVersion: 2.481.0 + releaseVersion: 0.32.0 + configChecksum: 59bccc7cfe42ec8e4aa779aafcfb6378 repoURL: https://github.com/LukeHagar/plexjs.git repoSubDirectory: . installationURL: https://github.com/LukeHagar/plexjs @@ -15,26 +15,25 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.11 - core: 3.18.1 + core: 3.18.11 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 downloadStreams: 0.1.1 enumUnions: 0.1.0 enums: 2.82.1 - envVarSecurityUsage: 0.1.1 - errors: 2.82.3 - flattening: 2.81.1 + envVarSecurityUsage: 0.1.2 + errors: 2.84.0 + flattening: 2.82.1 globalSecurity: 2.82.11 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.82.4 - globals: 2.82.1 methodServerURLs: 2.82.1 nameOverrides: 2.81.2 nullables: 0.1.0 responseFormat: 0.2.3 retries: 2.83.0 - sdkHooks: 0.1.0 + sdkHooks: 0.2.0 generatedFiles: - .eslintrc.cjs - .gitattributes @@ -527,7 +526,6 @@ generatedFiles: - docs/sdk/models/operations/getondeckresponsebody.md - docs/sdk/models/operations/getondeckstream.md - docs/sdk/models/operations/getpinauthpincontainer.md - - docs/sdk/models/operations/getpinglobals.md - docs/sdk/models/operations/getpinrequest.md - docs/sdk/models/operations/getpinresponse.md - docs/sdk/models/operations/getplaylistcontentscountry.md @@ -596,7 +594,6 @@ generatedFiles: - docs/sdk/models/operations/getsearchalllibrariesdirector.md - docs/sdk/models/operations/getsearchalllibrariesflattenseasons.md - docs/sdk/models/operations/getsearchalllibrariesgenre.md - - docs/sdk/models/operations/getsearchalllibrariesglobals.md - docs/sdk/models/operations/getsearchalllibrarieshasthumbnail.md - docs/sdk/models/operations/getsearchalllibrariesimage.md - docs/sdk/models/operations/getsearchalllibrarieslibrarytype.md @@ -650,7 +647,6 @@ generatedFiles: - docs/sdk/models/operations/getserverpreferencesmediacontainer.md - docs/sdk/models/operations/getserverpreferencesresponse.md - docs/sdk/models/operations/getserverpreferencesresponsebody.md - - docs/sdk/models/operations/getserverresourcesglobals.md - docs/sdk/models/operations/getserverresourcesrequest.md - docs/sdk/models/operations/getserverresourcesresponse.md - docs/sdk/models/operations/getsessionhistorymediacontainer.md @@ -679,7 +675,6 @@ generatedFiles: - docs/sdk/models/operations/gettimelineresponse.md - docs/sdk/models/operations/gettokenbypinidauthpincontainer.md - docs/sdk/models/operations/gettokenbypinidgeodata.md - - docs/sdk/models/operations/gettokenbypinidglobals.md - docs/sdk/models/operations/gettokenbypinidrequest.md - docs/sdk/models/operations/gettokenbypinidresponse.md - docs/sdk/models/operations/gettokendetailsauthenticationresponsestatus.md @@ -765,7 +760,6 @@ generatedFiles: - docs/sdk/models/operations/postuserssignindataautoselectsubtitle.md - docs/sdk/models/operations/postuserssignindatadefaultsubtitleaccessibility.md - docs/sdk/models/operations/postuserssignindatadefaultsubtitleforced.md - - docs/sdk/models/operations/postuserssignindataglobals.md - docs/sdk/models/operations/postuserssignindatamailingliststatus.md - docs/sdk/models/operations/postuserssignindatamediareviewsvisibility.md - docs/sdk/models/operations/postuserssignindatarequest.md @@ -1149,7 +1143,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {} "400": application/json: {"errors": []} getServerPreferences: @@ -1353,7 +1348,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {} "400": application/json: {"errors": []} cancelServerActivities: @@ -1665,7 +1661,7 @@ examples: X-Plex-Container-Size: 50 responses: "200": - application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} + application/json: {"MediaContainer": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}], "size": 70, "totalSize": 170, "offset": 0, "content": "secondary", "allowSync": true, "nocache": true, "art": "/:/resources/movie-fanart.jpg", "identifier": "com.plexapp.plugins.library", "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionUUID": "322a231a-b7f7-49f5-920f-14c61199cd30", "mediaTagPrefix": "/system/bundle/media/flags/", "mediaTagVersion": 1701731894, "thumb": "/:/resources/movie.png", "title1": "Movies", "title2": "Recently Released", "viewGroup": "movie", "viewMode": 65592, "mixedParents": true, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "tvdbDvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}], "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}, {"key": "=", "title": "is"}]}]}}} "400": application/json: {"errors": [{"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}, {"code": 1000, "message": "X-Plex-Client-Identifier is missing", "status": 400}]} "401": @@ -1784,7 +1780,8 @@ examples: responses: "401": application/json: {"errors": []} - "200": {} + "200": + application/json: {} "400": application/json: {"errors": []} logLine: @@ -2186,7 +2183,7 @@ examples: X-Plex-Container-Size: 50 responses: "200": - application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} + application/json: {"MediaContainer": {"size": 50, "identifier": "com.plexapp.plugins.library", "Meta": {"Type": [{"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}, {"key": "/library/sections/2/all?type=2", "type": "show", "title": "TV Shows", "active": false, "Filter": [{"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}, {"filter": "genre", "filterType": "string", "key": "/library/sections/2/genre?type=2", "title": "Genre", "type": "filter"}], "Sort": [{"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}, {"default": "asc", "active": false, "activeDirection": "asc", "defaultDirection": "asc", "descKey": "titleSort:desc", "firstCharacterKey": "/library/sections/2/firstCharacter", "key": "titleSort", "title": "Title"}], "Field": [{"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}, {"key": "show.title", "title": "Show Title", "type": "string", "subType": "rating"}]}], "FieldType": [{"type": "tag", "Operator": [{"key": "=", "title": "is"}]}, {"type": "tag", "Operator": []}, {"type": "tag", "Operator": []}]}, "Metadata": [{"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "tvdbDvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": []}]}], "Genre": [{"tag": "Adventure"}], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [], "Collection": [], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}]}} get-recently-added-library: speakeasy-default-get-recently-added-library: parameters: @@ -2217,7 +2214,7 @@ examples: X-Plex-Client-Identifier: "3381b62b-9ab7-4e37-827b-203e9809eb58" responses: "200": - application/json: {"MediaContainer": {"size": "9266.90", "SearchResult": [{"score": "2698.71", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "9681.40", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [], "Genre": [], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "1665.12", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "dvd", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}]}} + application/json: {"MediaContainer": {"size": "9266.90", "SearchResult": [{"score": "2698.71", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "tvdbAbsolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}, {"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}, {"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "9681.40", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "tvdbAbsolute", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [], "Genre": [], "Country": [], "Director": [{"tag": "James Cameron"}, {"tag": "James Cameron"}, {"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}, {"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}, {"score": "1665.12", "Metadata": {"ratingKey": "58683", "key": "/library/metadata/58683", "guid": "plex://movie/5d7768ba96b655001fdc0408", "studio": "20th Century Studios", "skipChildren": false, "librarySectionID": 1, "librarySectionTitle": "Movies", "librarySectionKey": "/library/sections/1", "type": "movie", "title": "Avatar: The Way of Water", "slug": "4-for-texas", "contentRating": "PG-13", "summary": "Jake Sully lives with his newfound family formed on the extrasolar moon Pandora. Once a familiar threat returns to finish what was previously started, Jake must work with Neytiri and the army of the Na'vi race to protect their home.", "rating": 7.6, "audienceRating": 9.2, "year": 2022, "seasonCount": 2022, "tagline": "Return to Pandora.", "flattenSeasons": "1", "showOrdering": "tmdbAiring", "thumb": "/library/metadata/58683/thumb/1703239236", "art": "/library/metadata/58683/art/1703239236", "banner": "/library/metadata/58683/banner/1703239236", "duration": 11558112, "originallyAvailableAt": "2022-12-14T00:00:00Z", "addedAt": 1556281940, "updatedAt": 1556281940, "audienceRatingImage": "rottentomatoes://image.rating.upright", "chapterSource": "media", "primaryExtraKey": "/library/metadata/58684", "ratingImage": "rottentomatoes://image.rating.ripe", "grandparentRatingKey": "66", "grandparentGuid": "plex://show/5d9c081b170e24001f2a7be4", "grandparentKey": "/library/metadata/66", "grandparentTitle": "Caprica", "grandparentThumb": "/library/metadata/66/thumb/1705716261", "parentSlug": "alice-in-borderland-2020", "grandparentSlug": "alice-in-borderland-2020", "grandparentArt": "/library/metadata/66/art/1705716261", "grandparentTheme": "/library/metadata/66/theme/1705716261", "Media": [{"id": 119534, "duration": 11558112, "bitrate": 25025, "width": 3840, "height": 2072, "aspectRatio": 1.85, "audioProfile": "dts", "audioChannels": 6, "audioCodec": "eac3", "videoCodec": "hevc", "videoResolution": "4k", "container": "mkv", "videoFrameRate": "24p", "videoProfile": "main 10", "hasVoiceActivity": false, "optimizedForStreaming": 1, "has64bitOffsets": false, "Part": [{"id": 119542, "key": "/library/parts/119542/1680457526/file.mkv", "duration": 11558112, "file": "/movies/Avatar The Way of Water (2022)/Avatar.The.Way.of.Water.2022.2160p.WEB-DL.DDP5.1.Atmos.DV.HDR10.HEVC-CMRG.mkv", "size": 36158371307, "container": "mkv", "audioProfile": "dts", "has64bitOffsets": false, "optimizedForStreaming": false, "videoProfile": "main 10", "indexes": "sd", "hasThumbnail": "1", "Stream": [{"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}, {"id": 272796, "streamType": 1, "default": true, "selected": true, "codec": "h264", "index": 0, "bitrate": 6273, "colorPrimaries": "bt709", "colorRange": "tv", "colorSpace": "bt709", "colorTrc": "bt709", "bitDepth": 8, "chromaLocation": "left", "streamIdentifier": "2", "chromaSubsampling": "4:2:0", "codedHeight": 1088, "codedWidth": 1920, "frameRate": 29.97, "hasScalingMatrix": false, "hearingImpaired": false, "closedCaptions": false, "embeddedInVideo": "1", "height": 1080, "level": 40, "profile": "main", "refFrames": 4, "scanType": "progressive", "width": 1920, "displayTitle": "1080p (H.264)", "extendedDisplayTitle": "1080p (H.264)", "channels": 2, "language": "English", "languageTag": "en", "languageCode": "eng", "audioChannelLayout": "stereo", "samplingRate": 48000, "title": "English", "canAutoSync": false}]}]}], "Genre": [{"tag": "Adventure"}, {"tag": "Adventure"}], "Country": [{"tag": "United States of America"}, {"tag": "United States of America"}], "Director": [{"tag": "James Cameron"}], "Writer": [{"tag": "James Cameron"}], "Collection": [{"tag": "Working NL Subs"}, {"tag": "Working NL Subs"}], "Role": [{"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}, {"id": 294129, "filter": "actor=294129", "thumb": "https://metadata-static.plex.tv/2/people/27b85844536c39f3f9ac943aaad46608.jpg", "tag": "Mike Smith", "tagKey": "668e7e7b22bcad9064350c91", "role": "Self"}], "Location": [{"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}, {"path": "/TV Shows/House"}], "Guid": [{"id": "imdb://tt13015952"}, {"id": "imdb://tt13015952"}], "UltraBlurColors": {"topLeft": "11333b", "topRight": "0a232d", "bottomRight": "73958", "bottomLeft": "1f5066"}, "Rating": [{"image": "themoviedb://image.rating", "value": 3, "type": "audience"}], "Image": [{"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}, {"alt": "Episode 1", "type": "background", "url": "/library/metadata/45521/thumb/1644710589"}], "titleSort": "Whale", "viewCount": 1, "lastViewedAt": 1682752242, "originalTitle": "映画 ブラッククローバー 魔法帝の剣", "viewOffset": 5222500, "skipCount": 1, "index": 1, "theme": "/library/metadata/1/theme/1705636920", "leafCount": 14, "viewedLeafCount": 0, "childCount": 1, "hasPremiumExtras": "1", "hasPremiumPrimaryExtra": "1", "parentRatingKey": "66", "parentGuid": "plex://show/5d9c081b170e24001f2a7be4", "parentStudio": "UCP", "parentKey": "/library/metadata/66", "parentTitle": "Caprica", "parentIndex": 1, "parentYear": 2010, "parentThumb": "/library/metadata/66/thumb/1705716261", "parentTheme": "/library/metadata/66/theme/1705716261"}}]}} "400": application/json: {"errors": []} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 1da62381..d4168a42 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -11,8 +11,9 @@ generation: requestResponseComponentNamesFeb2024: true auth: oAuth2ClientCredentialsEnabled: true + oAuth2PasswordEnabled: false typescript: - version: 0.31.1 + version: 0.32.0 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index ae23b985..fef38f99 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.405.6 +speakeasyVersion: 1.456.1 sources: my-source: sourceNamespace: my-source @@ -9,26 +9,29 @@ sources: - main plexapi: sourceNamespace: plexapi - sourceRevisionDigest: sha256:96b3b0311346892a8d70f88e27dd59e3cba616e9f79b1662c89e341ebd49a666 - sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206 + sourceRevisionDigest: sha256:ccba0c42f1644923e2209e28da7a78195a843e48da1aeaaedbf8759f1a8a0fe0 + sourceBlobDigest: sha256:b362c110ef633288220a55ab50627374b996c64f2d9b8e020944e84ea2840332 tags: - latest - - main + - speakeasy-sdk-regen-1734710483 + - 0.0.3 targets: plexjs: source: plexapi sourceNamespace: plexapi - sourceRevisionDigest: sha256:96b3b0311346892a8d70f88e27dd59e3cba616e9f79b1662c89e341ebd49a666 - sourceBlobDigest: sha256:290473ebc909cada80ff428c685b897f4621cf121397e1417355e06d334e7206 + sourceRevisionDigest: sha256:ccba0c42f1644923e2209e28da7a78195a843e48da1aeaaedbf8759f1a8a0fe0 + sourceBlobDigest: sha256:b362c110ef633288220a55ab50627374b996c64f2d9b8e020944e84ea2840332 codeSamplesNamespace: code-samples-typescript-plexjs - codeSamplesRevisionDigest: sha256:bb437db16afb78fc5469b890d2e5aecf927949325fa9cbfb091761e460319bfd + codeSamplesRevisionDigest: sha256:f1245ceff6a26548b804c05954169ae215f024ea7b77438a4d6b86fdcd5a080c workflow: workflowVersion: 1.0.0 speakeasyVersion: latest sources: plexapi: inputs: - - location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi:main + - location: https://raw.githubusercontent.com/LukeHagar/plex-api-spec/refs/heads/main/output/plex-media-server-spec-dereferenced.yaml + registry: + location: registry.speakeasyapi.dev/plexapi/plexapi/plexapi targets: plexjs: target: typescript diff --git a/FUNCTIONS.md b/FUNCTIONS.md index 2181cc2b..6a1df179 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -27,11 +27,6 @@ import { SDKValidationError } from "@lukehagar/plexjs/sdk/models/errors/sdkvalid // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/README.md b/README.md index d8e92b8f..e582318a 100644 --- a/README.md +++ b/README.md @@ -40,18 +40,26 @@ The following SDKs are generated from the OpenAPI Specification. They are automa ## Table of Contents + +* [@lukehagar/plexjs](#lukehagarplexjs) +* [Plex Media Server OpenAPI Specification](#plex-media-server-openapi-specification) + * [Documentation](#documentation) + * [SDKs](#sdks) + * [SDK Installation](#sdk-installation) + * [SDK Example Usage](#sdk-example-usage) + * [Available Resources and Operations](#available-resources-and-operations) + * [Error Handling](#error-handling) + * [Server Selection](#server-selection) + * [Custom HTTP Client](#custom-http-client) + * [Authentication](#authentication) + * [Requirements](#requirements) + * [Standalone functions](#standalone-functions) + * [Retries](#retries) + * [Debugging](#debugging) +* [Development](#development) + * [Maturity](#maturity) + * [Contributions](#contributions) -* [SDK Installation](#sdk-installation) -* [Requirements](#requirements) -* [SDK Example Usage](#sdk-example-usage) -* [Available Resources and Operations](#available-resources-and-operations) -* [Standalone functions](#standalone-functions) -* [Retries](#retries) -* [Error Handling](#error-handling) -* [Server Selection](#server-selection) -* [Custom HTTP Client](#custom-http-client) -* [Authentication](#authentication) -* [Debugging](#debugging) @@ -97,11 +105,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -253,25 +256,15 @@ run(); ## Error Handling -All SDK methods return a response object or throw an error. By default, an API error will throw a `errors.SDKError`. +Some methods specify known errors which can be thrown. All the known errors are enumerated in the `sdk/models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `getServerCapabilities` method may throw the following errors: -If a HTTP request fails, an operation my also throw an error from the `sdk/models/errors/httpclienterrors.ts` module: +| Error Type | Status Code | Content Type | +| ---------------------------------------- | ----------- | ---------------- | +| errors.GetServerCapabilitiesBadRequest | 400 | application/json | +| errors.GetServerCapabilitiesUnauthorized | 401 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | -| HTTP Client Error | Description | -| ---------------------------------------------------- | ---------------------------------------------------- | -| RequestAbortedError | HTTP request was aborted by the client | -| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | -| ConnectionError | HTTP client was unable to make a request to a server | -| InvalidRequestError | Any input used to create a request is invalid | -| UnexpectedClientError | Unrecognised or unexpected error | - -In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `getServerCapabilities` method may throw the following errors: - -| Error Type | Status Code | Content Type | -| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | -| errors.GetServerCapabilitiesBadRequest | 400 | application/json | -| errors.GetServerCapabilitiesUnauthorized | 401 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | +If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`. ```typescript import { PlexAPI } from "@lukehagar/plexjs"; @@ -283,11 +276,6 @@ import { const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -299,8 +287,9 @@ async function run() { console.log(result); } catch (err) { switch (true) { + // The server response does not match the expected SDK schema case (err instanceof SDKValidationError): { - // Validation errors can be pretty-printed + // Pretty-print will provide a human-readable multi-line error message console.error(err.pretty()); // Raw value may also be inspected console.error(err.rawValue); @@ -317,6 +306,7 @@ async function run() { return; } default: { + // Other errors such as network errors, see HTTPClientErrors for more details throw err; } } @@ -327,66 +317,38 @@ run(); ``` -Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted string since validation errors can list many issues and the plain error string may be difficult read when debugging. +Validation errors can also occur when either method arguments or data returned from the server do not match the expected format. The `SDKValidationError` that is thrown as a result will capture the raw value that failed validation in an attribute called `rawValue`. Additionally, a `pretty()` method is available on this error that can be used to log a nicely formatted multi-line string since validation errors can list many issues and the plain error string may be difficult read when debugging. + +In some rare cases, the SDK can fail to get a response from the server or even make the request due to unexpected circumstances such as network conditions. These types of errors are captured in the `sdk/models/errors/httpclienterrors.ts` module: + +| HTTP Client Error | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | +| RequestAbortedError | HTTP request was aborted by the client | +| RequestTimeoutError | HTTP request timed out due to an AbortSignal signal | +| ConnectionError | HTTP client was unable to make a request to a server | +| InvalidRequestError | Any input used to create a request is invalid | +| UnexpectedClientError | Unrecognised or unexpected error | ## Server Selection -### Select Server by Index +### Server Variables -You can override the default server globally by passing a server index to the `serverIdx` optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers: - -| # | Server | Variables | -| - | ------ | --------- | -| 0 | `{protocol}://{ip}:{port}` | `protocol` (default is `https`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) | - -```typescript -import { PlexAPI } from "@lukehagar/plexjs"; - -const plexAPI = new PlexAPI({ - serverIdx: 0, - accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); - -async function run() { - const result = await plexAPI.server.getServerCapabilities(); - - // Handle the result - console.log(result); -} - -run(); - -``` - -#### Variables - -Some of the server options above contain variables. If you want to set the values of those variables, the following optional parameters are available when initializing the SDK client instance: +The default server `{protocol}://{ip}:{port}` contains variables and is set to `https://10.10.10.47:32400` by default. To override default values, the following parameters are available when initializing the SDK client instance: * `protocol: models.ServerProtocol` * `ip: string` * `port: string` ### Override Server URL Per-Client -The default server can also be overridden globally by passing a URL to the `serverURL` optional parameter when initializing the SDK client instance. For example: - +The default server can also be overridden globally by passing a URL to the `serverURL: string` optional parameter when initializing the SDK client instance. For example: ```typescript import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ - serverURL: "{protocol}://{ip}:{port}", + serverURL: "https://10.10.10.47:32400", accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -399,20 +361,15 @@ async function run() { run(); ``` + ### Override Server URL Per-Operation The server URL can also be overridden on a per-operation basis, provided a server list was specified for the operation. For example: - ```typescript import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -485,9 +442,9 @@ const sdk = new PlexAPI({ httpClient }); This SDK supports the following security scheme globally: -| Name | Type | Scheme | -| ------------- | ------------- | ------------- | -| `accessToken` | apiKey | API key | +| Name | Type | Scheme | +| ------------- | ------ | ------- | +| `accessToken` | apiKey | API key | To authenticate with the API the `accessToken` parameter must be set when initializing the SDK client instance. For example: ```typescript @@ -495,11 +452,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -535,83 +487,82 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). Available standalone functions -- [activitiesCancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) -- [activitiesGetServerActivities](docs/sdks/activities/README.md#getserveractivities) -- [authenticationGetSourceConnectionInformation](docs/sdks/authentication/README.md#getsourceconnectioninformation) -- [authenticationGetTokenDetails](docs/sdks/authentication/README.md#gettokendetails) -- [authenticationGetTransientToken](docs/sdks/authentication/README.md#gettransienttoken) -- [authenticationPostUsersSignInData](docs/sdks/authentication/README.md#postuserssignindata) -- [butlerGetButlerTasks](docs/sdks/butler/README.md#getbutlertasks) -- [butlerStartAllTasks](docs/sdks/butler/README.md#startalltasks) -- [butlerStartTask](docs/sdks/butler/README.md#starttask) -- [butlerStopAllTasks](docs/sdks/butler/README.md#stopalltasks) -- [butlerStopTask](docs/sdks/butler/README.md#stoptask) -- [hubsGetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) -- [hubsGetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) -- [hubsGetRecentlyAdded](docs/sdks/hubs/README.md#getrecentlyadded) -- [libraryDeleteLibrary](docs/sdks/library/README.md#deletelibrary) -- [libraryGetAllLibraries](docs/sdks/library/README.md#getalllibraries) -- [libraryGetFileHash](docs/sdks/library/README.md#getfilehash) -- [libraryGetLibraryDetails](docs/sdks/library/README.md#getlibrarydetails) -- [libraryGetLibraryItems](docs/sdks/library/README.md#getlibraryitems) -- [libraryGetMetaDataByRatingKey](docs/sdks/library/README.md#getmetadatabyratingkey) -- [libraryGetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) -- [libraryGetOnDeck](docs/sdks/library/README.md#getondeck) -- [libraryGetRecentlyAddedLibrary](docs/sdks/library/README.md#getrecentlyaddedlibrary) -- [libraryGetRefreshLibraryMetadata](docs/sdks/library/README.md#getrefreshlibrarymetadata) -- [libraryGetSearchAllLibraries](docs/sdks/library/README.md#getsearchalllibraries) -- [libraryGetSearchLibrary](docs/sdks/library/README.md#getsearchlibrary) -- [libraryGetTopWatchedContent](docs/sdks/library/README.md#gettopwatchedcontent) -- [logEnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) -- [logLogLine](docs/sdks/log/README.md#logline) -- [logLogMultiLine](docs/sdks/log/README.md#logmultiline) -- [mediaGetBannerImage](docs/sdks/media/README.md#getbannerimage) -- [mediaGetThumbImage](docs/sdks/media/README.md#getthumbimage) -- [mediaMarkPlayed](docs/sdks/media/README.md#markplayed) -- [mediaMarkUnplayed](docs/sdks/media/README.md#markunplayed) -- [mediaUpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) -- [playlistsAddPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) -- [playlistsClearPlaylistContents](docs/sdks/playlists/README.md#clearplaylistcontents) -- [playlistsCreatePlaylist](docs/sdks/playlists/README.md#createplaylist) -- [playlistsDeletePlaylist](docs/sdks/playlists/README.md#deleteplaylist) -- [playlistsGetPlaylistContents](docs/sdks/playlists/README.md#getplaylistcontents) -- [playlistsGetPlaylist](docs/sdks/playlists/README.md#getplaylist) -- [playlistsGetPlaylists](docs/sdks/playlists/README.md#getplaylists) -- [playlistsUpdatePlaylist](docs/sdks/playlists/README.md#updateplaylist) -- [playlistsUploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) -- [plexGetCompanionsData](docs/sdks/plex/README.md#getcompanionsdata) -- [plexGetGeoData](docs/sdks/plex/README.md#getgeodata) -- [plexGetHomeData](docs/sdks/plex/README.md#gethomedata) -- [plexGetPin](docs/sdks/plex/README.md#getpin) -- [plexGetServerResources](docs/sdks/plex/README.md#getserverresources) -- [plexGetTokenByPinId](docs/sdks/plex/README.md#gettokenbypinid) -- [plexGetUserFriends](docs/sdks/plex/README.md#getuserfriends) -- [searchGetSearchResults](docs/sdks/search/README.md#getsearchresults) -- [searchPerformSearch](docs/sdks/search/README.md#performsearch) -- [searchPerformVoiceSearch](docs/sdks/search/README.md#performvoicesearch) -- [serverGetAvailableClients](docs/sdks/server/README.md#getavailableclients) -- [serverGetDevices](docs/sdks/server/README.md#getdevices) -- [serverGetMediaProviders](docs/sdks/server/README.md#getmediaproviders) -- [serverGetMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) -- [serverGetResizedPhoto](docs/sdks/server/README.md#getresizedphoto) -- [serverGetServerCapabilities](docs/sdks/server/README.md#getservercapabilities) -- [serverGetServerIdentity](docs/sdks/server/README.md#getserveridentity) -- [serverGetServerList](docs/sdks/server/README.md#getserverlist) -- [serverGetServerPreferences](docs/sdks/server/README.md#getserverpreferences) -- [sessionsGetSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) -- [sessionsGetSessions](docs/sdks/sessions/README.md#getsessions) -- [sessionsGetTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) -- [sessionsStopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) -- [statisticsGetBandwidthStatistics](docs/sdks/statistics/README.md#getbandwidthstatistics) -- [statisticsGetResourcesStatistics](docs/sdks/statistics/README.md#getresourcesstatistics) -- [statisticsGetStatistics](docs/sdks/statistics/README.md#getstatistics) -- [updaterApplyUpdates](docs/sdks/updater/README.md#applyupdates) -- [updaterCheckForUpdates](docs/sdks/updater/README.md#checkforupdates) -- [updaterGetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) -- [videoGetTimeline](docs/sdks/video/README.md#gettimeline) -- [videoStartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) -- [watchlistGetWatchList](docs/sdks/watchlist/README.md#getwatchlist) - +- [`activitiesCancelServerActivities`](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities +- [`activitiesGetServerActivities`](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities +- [`authenticationGetSourceConnectionInformation`](docs/sdks/authentication/README.md#getsourceconnectioninformation) - Get Source Connection Information +- [`authenticationGetTokenDetails`](docs/sdks/authentication/README.md#gettokendetails) - Get Token Details +- [`authenticationGetTransientToken`](docs/sdks/authentication/README.md#gettransienttoken) - Get a Transient Token +- [`authenticationPostUsersSignInData`](docs/sdks/authentication/README.md#postuserssignindata) - Get User Sign In Data +- [`butlerGetButlerTasks`](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks +- [`butlerStartAllTasks`](docs/sdks/butler/README.md#startalltasks) - Start all Butler tasks +- [`butlerStartTask`](docs/sdks/butler/README.md#starttask) - Start a single Butler task +- [`butlerStopAllTasks`](docs/sdks/butler/README.md#stopalltasks) - Stop all Butler tasks +- [`butlerStopTask`](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task +- [`hubsGetGlobalHubs`](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs +- [`hubsGetLibraryHubs`](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs +- [`hubsGetRecentlyAdded`](docs/sdks/hubs/README.md#getrecentlyadded) - Get Recently Added +- [`libraryDeleteLibrary`](docs/sdks/library/README.md#deletelibrary) - Delete Library Section +- [`libraryGetAllLibraries`](docs/sdks/library/README.md#getalllibraries) - Get All Libraries +- [`libraryGetFileHash`](docs/sdks/library/README.md#getfilehash) - Get Hash Value +- [`libraryGetLibraryDetails`](docs/sdks/library/README.md#getlibrarydetails) - Get Library Details +- [`libraryGetLibraryItems`](docs/sdks/library/README.md#getlibraryitems) - Get Library Items +- [`libraryGetMetaDataByRatingKey`](docs/sdks/library/README.md#getmetadatabyratingkey) - Get Metadata by RatingKey +- [`libraryGetMetadataChildren`](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children +- [`libraryGetOnDeck`](docs/sdks/library/README.md#getondeck) - Get On Deck +- [`libraryGetRecentlyAddedLibrary`](docs/sdks/library/README.md#getrecentlyaddedlibrary) - Get Recently Added +- [`libraryGetRefreshLibraryMetadata`](docs/sdks/library/README.md#getrefreshlibrarymetadata) - Refresh Metadata Of The Library +- [`libraryGetSearchAllLibraries`](docs/sdks/library/README.md#getsearchalllibraries) - Search All Libraries +- [`libraryGetSearchLibrary`](docs/sdks/library/README.md#getsearchlibrary) - Search Library +- [`libraryGetTopWatchedContent`](docs/sdks/library/README.md#gettopwatchedcontent) - Get Top Watched Content +- [`logEnablePaperTrail`](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail +- [`logLogLine`](docs/sdks/log/README.md#logline) - Logging a single line message. +- [`logLogMultiLine`](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message +- [`mediaGetBannerImage`](docs/sdks/media/README.md#getbannerimage) - Get Banner Image +- [`mediaGetThumbImage`](docs/sdks/media/README.md#getthumbimage) - Get Thumb Image +- [`mediaMarkPlayed`](docs/sdks/media/README.md#markplayed) - Mark Media Played +- [`mediaMarkUnplayed`](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed +- [`mediaUpdatePlayProgress`](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress +- [`playlistsAddPlaylistContents`](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist +- [`playlistsClearPlaylistContents`](docs/sdks/playlists/README.md#clearplaylistcontents) - Delete Playlist Contents +- [`playlistsCreatePlaylist`](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist +- [`playlistsDeletePlaylist`](docs/sdks/playlists/README.md#deleteplaylist) - Deletes a Playlist +- [`playlistsGetPlaylist`](docs/sdks/playlists/README.md#getplaylist) - Retrieve Playlist +- [`playlistsGetPlaylistContents`](docs/sdks/playlists/README.md#getplaylistcontents) - Retrieve Playlist Contents +- [`playlistsGetPlaylists`](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists +- [`playlistsUpdatePlaylist`](docs/sdks/playlists/README.md#updateplaylist) - Update a Playlist +- [`playlistsUploadPlaylist`](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist +- [`plexGetCompanionsData`](docs/sdks/plex/README.md#getcompanionsdata) - Get Companions Data +- [`plexGetGeoData`](docs/sdks/plex/README.md#getgeodata) - Get Geo Data +- [`plexGetHomeData`](docs/sdks/plex/README.md#gethomedata) - Get Plex Home Data +- [`plexGetPin`](docs/sdks/plex/README.md#getpin) - Get a Pin +- [`plexGetServerResources`](docs/sdks/plex/README.md#getserverresources) - Get Server Resources +- [`plexGetTokenByPinId`](docs/sdks/plex/README.md#gettokenbypinid) - Get Access Token by PinId +- [`plexGetUserFriends`](docs/sdks/plex/README.md#getuserfriends) - Get list of friends of the user logged in +- [`searchGetSearchResults`](docs/sdks/search/README.md#getsearchresults) - Get Search Results +- [`searchPerformSearch`](docs/sdks/search/README.md#performsearch) - Perform a search +- [`searchPerformVoiceSearch`](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search +- [`serverGetAvailableClients`](docs/sdks/server/README.md#getavailableclients) - Get Available Clients +- [`serverGetDevices`](docs/sdks/server/README.md#getdevices) - Get Devices +- [`serverGetMediaProviders`](docs/sdks/server/README.md#getmediaproviders) - Get Media Providers +- [`serverGetMyPlexAccount`](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account +- [`serverGetResizedPhoto`](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo +- [`serverGetServerCapabilities`](docs/sdks/server/README.md#getservercapabilities) - Get Server Capabilities +- [`serverGetServerIdentity`](docs/sdks/server/README.md#getserveridentity) - Get Server Identity +- [`serverGetServerList`](docs/sdks/server/README.md#getserverlist) - Get Server List +- [`serverGetServerPreferences`](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences +- [`sessionsGetSessionHistory`](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History +- [`sessionsGetSessions`](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions +- [`sessionsGetTranscodeSessions`](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions +- [`sessionsStopTranscodeSession`](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session +- [`statisticsGetBandwidthStatistics`](docs/sdks/statistics/README.md#getbandwidthstatistics) - Get Bandwidth Statistics +- [`statisticsGetResourcesStatistics`](docs/sdks/statistics/README.md#getresourcesstatistics) - Get Resources Statistics +- [`statisticsGetStatistics`](docs/sdks/statistics/README.md#getstatistics) - Get Media Statistics +- [`updaterApplyUpdates`](docs/sdks/updater/README.md#applyupdates) - Apply Updates +- [`updaterCheckForUpdates`](docs/sdks/updater/README.md#checkforupdates) - Checking for updates +- [`updaterGetUpdateStatus`](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates +- [`videoGetTimeline`](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item +- [`videoStartUniversalTranscode`](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode +- [`watchlistGetWatchList`](docs/sdks/watchlist/README.md#getwatchlist) - Get User Watchlist @@ -627,11 +578,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -672,11 +618,6 @@ const plexAPI = new PlexAPI({ retryConnectionErrors: false, }, accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/RELEASES.md b/RELEASES.md index 787d0833..b57c304f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1148,4 +1148,14 @@ Based on: ### Generated - [typescript v0.31.1] . ### Releases -- [NPM v0.31.1] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.31.1 - . \ No newline at end of file +- [NPM v0.31.1] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.31.1 - . + +## 2024-12-20 16:01:16 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.456.1 (2.481.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.32.0] . +### Releases +- [NPM v0.32.0] https://www.npmjs.com/package/@lukehagar/plexjs/v/0.32.0 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md index 555f615b..211f6d5c 100644 --- a/USAGE.md +++ b/USAGE.md @@ -4,11 +4,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/codeSamples.yaml b/codeSamples.yaml index b5cd0515..a6b78f67 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -13,11 +13,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -38,11 +33,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -63,11 +53,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -88,11 +73,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -114,11 +94,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -150,11 +125,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -175,11 +145,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -200,11 +165,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -225,11 +185,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -250,11 +205,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -275,11 +225,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -301,11 +246,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -327,11 +267,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -352,11 +287,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -377,11 +307,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -402,11 +327,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -427,11 +347,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -450,13 +365,7 @@ actions: source: |- import { PlexAPI } from "@lukehagar/plexjs"; - const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", - }); + const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.plex.getGeoData(); @@ -476,11 +385,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -501,11 +405,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -527,11 +426,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -559,11 +453,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -584,11 +473,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -609,11 +493,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -632,13 +511,7 @@ actions: source: |- import { PlexAPI } from "@lukehagar/plexjs"; - const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", - }); + const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.server.getServerIdentity(); @@ -659,11 +532,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -684,11 +552,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -709,11 +572,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -734,11 +592,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -766,11 +619,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -791,11 +639,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -823,11 +666,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -849,11 +687,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -896,16 +729,12 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { const result = await plexAPI.library.getSearchAllLibraries({ query: "", + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", searchTypes: [ SearchTypes.People, ], @@ -928,11 +757,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -954,11 +778,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -984,11 +803,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1009,11 +823,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1035,11 +844,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1061,11 +865,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1092,11 +891,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1126,11 +920,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1151,11 +940,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1178,11 +962,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1203,11 +982,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1228,11 +1002,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1254,11 +1023,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1285,16 +1049,16 @@ actions: source: |- import { PlexAPI } from "@lukehagar/plexjs"; - const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", - }); + const plexAPI = new PlexAPI(); async function run() { - const result = await plexAPI.plex.getPin({}); + const result = await plexAPI.plex.getPin({ + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", + }); // Handle the result console.log(result); @@ -1309,17 +1073,16 @@ actions: source: |- import { PlexAPI } from "@lukehagar/plexjs"; - const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", - }); + const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.plex.getTokenByPinId({ pinID: 408895, + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", }); // Handle the result @@ -1337,11 +1100,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1363,11 +1121,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1394,11 +1147,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1419,11 +1167,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1444,11 +1187,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1469,11 +1207,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1494,11 +1227,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1520,11 +1248,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1545,11 +1268,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1571,15 +1289,10 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { - const result = await plexAPI.plex.getServerResources(IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable, "3381b62b-9ab7-4e37-827b-203e9809eb58"); + const result = await plexAPI.plex.getServerResources("3381b62b-9ab7-4e37-827b-203e9809eb58", IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable); // Handle the result console.log(result); @@ -1596,11 +1309,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1621,11 +1329,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1647,11 +1350,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1672,11 +1370,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1697,11 +1390,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1722,11 +1410,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1747,11 +1430,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1772,11 +1450,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1797,11 +1470,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1822,11 +1490,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1847,11 +1510,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1873,11 +1531,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1899,11 +1552,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1924,11 +1572,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1949,11 +1592,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1972,16 +1610,15 @@ actions: source: |- import { PlexAPI } from "@lukehagar/plexjs"; - const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", - }); + const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.authentication.postUsersSignInData({ + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", requestBody: { login: "username@email.com", password: "password123", @@ -2004,11 +1641,6 @@ actions: const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdk/models/operations/getlibraryitemsmediacontainer.md b/docs/sdk/models/operations/getlibraryitemsmediacontainer.md index 38911843..ca82c74b 100644 --- a/docs/sdk/models/operations/getlibraryitemsmediacontainer.md +++ b/docs/sdk/models/operations/getlibraryitemsmediacontainer.md @@ -111,7 +111,7 @@ let value: GetLibraryItemsMediaContainer = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetLibraryItemsFlattenSeasons.True, - showOrdering: GetLibraryItemsShowOrdering.Dvd, + showOrdering: GetLibraryItemsShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getlibraryitemsmetadata.md b/docs/sdk/models/operations/getlibraryitemsmetadata.md index a9302019..08c63702 100644 --- a/docs/sdk/models/operations/getlibraryitemsmetadata.md +++ b/docs/sdk/models/operations/getlibraryitemsmetadata.md @@ -35,7 +35,7 @@ let value: GetLibraryItemsMetadata = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetLibraryItemsFlattenSeasons.True, - showOrdering: GetLibraryItemsShowOrdering.Dvd, + showOrdering: GetLibraryItemsShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", @@ -250,7 +250,7 @@ let value: GetLibraryItemsMetadata = { | `seasonCount` | *number* | :heavy_minus_sign: | N/A | 2022 | | `tagline` | *string* | :heavy_minus_sign: | N/A | Return to Pandora. | | `flattenSeasons` | [operations.GetLibraryItemsFlattenSeasons](../../../sdk/models/operations/getlibraryitemsflattenseasons.md) | :heavy_minus_sign: | N/A | 1 | -| `showOrdering` | [operations.GetLibraryItemsShowOrdering](../../../sdk/models/operations/getlibraryitemsshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired),
dvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)).
| dvd | +| `showOrdering` | [operations.GetLibraryItemsShowOrdering](../../../sdk/models/operations/getlibraryitemsshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
tvdbAiring = TheTVDB (Aired),
tvdbDvd = TheTVDB (DVD),
tvdbAbsolute = TheTVDB (Absolute)).
| tvdbDvd | | `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | | `banner` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | diff --git a/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md b/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md index 83209d30..2978e712 100644 --- a/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md +++ b/docs/sdk/models/operations/getlibraryitemsqueryparamtype.md @@ -24,4 +24,6 @@ let value: GetLibraryItemsQueryParamType = GetLibraryItemsQueryParamType.TvShow; | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getlibraryitemsrequest.md b/docs/sdk/models/operations/getlibraryitemsrequest.md index 2302a810..b8ebe745 100644 --- a/docs/sdk/models/operations/getlibraryitemsrequest.md +++ b/docs/sdk/models/operations/getlibraryitemsrequest.md @@ -12,7 +12,7 @@ import { } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetLibraryItemsRequest = { - tag: Tag.FirstCharacter, + tag: Tag.Folder, includeGuids: IncludeGuids.Enable, type: GetLibraryItemsQueryParamType.TvShow, sectionKey: 9518, diff --git a/docs/sdk/models/operations/getlibraryitemsresponse.md b/docs/sdk/models/operations/getlibraryitemsresponse.md index ca7a5eb6..d7ad0d0f 100644 --- a/docs/sdk/models/operations/getlibraryitemsresponse.md +++ b/docs/sdk/models/operations/getlibraryitemsresponse.md @@ -115,7 +115,7 @@ let value: GetLibraryItemsResponse = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetLibraryItemsFlattenSeasons.True, - showOrdering: GetLibraryItemsShowOrdering.Dvd, + showOrdering: GetLibraryItemsShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getlibraryitemsresponsebody.md b/docs/sdk/models/operations/getlibraryitemsresponsebody.md index ceee0e93..b6c240fd 100644 --- a/docs/sdk/models/operations/getlibraryitemsresponsebody.md +++ b/docs/sdk/models/operations/getlibraryitemsresponsebody.md @@ -111,7 +111,7 @@ let value: GetLibraryItemsResponseBody = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetLibraryItemsFlattenSeasons.True, - showOrdering: GetLibraryItemsShowOrdering.Dvd, + showOrdering: GetLibraryItemsShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getlibraryitemsshowordering.md b/docs/sdk/models/operations/getlibraryitemsshowordering.md index cb031063..d11fe456 100644 --- a/docs/sdk/models/operations/getlibraryitemsshowordering.md +++ b/docs/sdk/models/operations/getlibraryitemsshowordering.md @@ -1,11 +1,11 @@ # GetLibraryItemsShowOrdering -Setting that indicates the episode ordering for the show -None = Library default, -tmdbAiring = The Movie Database (Aired), -aired = TheTVDB (Aired), -dvd = TheTVDB (DVD), -absolute = TheTVDB (Absolute)). +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +tvdbAiring = TheTVDB (Aired), +tvdbDvd = TheTVDB (DVD), +tvdbAbsolute = TheTVDB (Absolute)). ## Example Usage @@ -13,15 +13,15 @@ absolute = TheTVDB (Absolute)). ```typescript import { GetLibraryItemsShowOrdering } from "@lukehagar/plexjs/sdk/models/operations"; -let value: GetLibraryItemsShowOrdering = GetLibraryItemsShowOrdering.Dvd; +let value: GetLibraryItemsShowOrdering = GetLibraryItemsShowOrdering.TvdbDvd; ``` ## Values -| Name | Value | -| ------------ | ------------ | -| `None` | None | -| `TmdbAiring` | tmdbAiring | -| `Aired` | aired | -| `Dvd` | dvd | -| `Absolute` | absolute | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `TvdbAiring` | tvdbAiring | +| `TvdbDvd` | tvdbDvd | +| `TvdbAbsolute` | tvdbAbsolute | \ No newline at end of file diff --git a/docs/sdk/models/operations/getmetadatabyratingkeymetadata.md b/docs/sdk/models/operations/getmetadatabyratingkeymetadata.md index 163cf537..8d6146c4 100644 --- a/docs/sdk/models/operations/getmetadatabyratingkeymetadata.md +++ b/docs/sdk/models/operations/getmetadatabyratingkeymetadata.md @@ -185,6 +185,11 @@ let value: GetMetaDataByRatingKeyMetadata = { | `librarySectionTitle` | *string* | :heavy_minus_sign: | N/A | Movies | | `librarySectionID` | *number* | :heavy_minus_sign: | N/A | 1 | | `librarySectionKey` | *string* | :heavy_minus_sign: | N/A | /library/sections/1 | +| `grandparentTitle` | *string* | :heavy_minus_sign: | The name of the album artist for the track when audio, and the name of the TV show for the episode when video. | | +| `parentTitle` | *string* | :heavy_minus_sign: | The name of the album for the track when audio, and the name of the season for the episode when TV show. | | +| `originalTitle` | *string* | :heavy_minus_sign: | The orginal untranslated name of the media item when non-english. | | +| `index` | *number* | :heavy_minus_sign: | The index starting from 0 of this media item in the MetaData array. | | +| `parentIndex` | *number* | :heavy_minus_sign: | The parent index starting from 0 of this media item in the parent MetaData array. | | | `contentRating` | *string* | :heavy_minus_sign: | N/A | PG-13 | | `summary` | *string* | :heavy_minus_sign: | N/A | Serenity continues the story of the TV series it was based upon ("Firefly"). River Tam had a secret - one in which she's not even aware - so dangerous, no one's safe, as an Alliance operative's sent to capture her, and all others are considered irrelevant to his job. | | `rating` | *number* | :heavy_minus_sign: | N/A | 8.2 | diff --git a/docs/sdk/models/operations/getpinglobals.md b/docs/sdk/models/operations/getpinglobals.md deleted file mode 100644 index f7fa6675..00000000 --- a/docs/sdk/models/operations/getpinglobals.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetPinGlobals - -## Example Usage - -```typescript -import { GetPinGlobals } from "@lukehagar/plexjs/sdk/models/operations"; - -let value: GetPinGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/sdk/models/operations/getpinrequest.md b/docs/sdk/models/operations/getpinrequest.md index fc08a18f..53c2f92f 100644 --- a/docs/sdk/models/operations/getpinrequest.md +++ b/docs/sdk/models/operations/getpinrequest.md @@ -5,7 +5,13 @@ ```typescript import { GetPinRequest } from "@lukehagar/plexjs/sdk/models/operations"; -let value: GetPinRequest = {}; +let value: GetPinRequest = { + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", +}; ``` ## Fields @@ -13,7 +19,7 @@ let value: GetPinRequest = {}; | Field | Type | Required | Description | Example | | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | | `strong` | *boolean* | :heavy_minus_sign: | Determines the kind of code returned by the API call
Strong codes are used for Pin authentication flows
Non-Strong codes are used for `Plex.tv/link`
| | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | | `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | | `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | diff --git a/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md b/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md index 53cba8a9..a42c1f53 100644 --- a/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md +++ b/docs/sdk/models/operations/getplaylistcontentsqueryparamtype.md @@ -25,4 +25,6 @@ let value: GetPlaylistContentsQueryParamType = | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md b/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md index d94f8045..c16b59d1 100644 --- a/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md +++ b/docs/sdk/models/operations/getrecentlyaddedmediacontainer.md @@ -91,7 +91,7 @@ let value: GetRecentlyAddedMediaContainer = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: FlattenSeasons.True, - showOrdering: ShowOrdering.Dvd, + showOrdering: ShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getrecentlyaddedmetadata.md b/docs/sdk/models/operations/getrecentlyaddedmetadata.md index c55fd943..b92b85af 100644 --- a/docs/sdk/models/operations/getrecentlyaddedmetadata.md +++ b/docs/sdk/models/operations/getrecentlyaddedmetadata.md @@ -35,7 +35,7 @@ let value: GetRecentlyAddedMetadata = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: FlattenSeasons.True, - showOrdering: ShowOrdering.Dvd, + showOrdering: ShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", @@ -250,7 +250,7 @@ let value: GetRecentlyAddedMetadata = { | `seasonCount` | *number* | :heavy_minus_sign: | N/A | 2022 | | `tagline` | *string* | :heavy_minus_sign: | N/A | Return to Pandora. | | `flattenSeasons` | [operations.FlattenSeasons](../../../sdk/models/operations/flattenseasons.md) | :heavy_minus_sign: | N/A | 1 | -| `showOrdering` | [operations.ShowOrdering](../../../sdk/models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired),
dvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)).
| dvd | +| `showOrdering` | [operations.ShowOrdering](../../../sdk/models/operations/showordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
tvdbAiring = TheTVDB (Aired),
tvdbDvd = TheTVDB (DVD),
tvdbAbsolute = TheTVDB (Absolute)).
| tvdbDvd | | `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | | `banner` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | diff --git a/docs/sdk/models/operations/getrecentlyaddedresponse.md b/docs/sdk/models/operations/getrecentlyaddedresponse.md index ddea44bf..eb4dfff3 100644 --- a/docs/sdk/models/operations/getrecentlyaddedresponse.md +++ b/docs/sdk/models/operations/getrecentlyaddedresponse.md @@ -98,7 +98,7 @@ let value: GetRecentlyAddedResponse = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: FlattenSeasons.True, - showOrdering: ShowOrdering.Dvd, + showOrdering: ShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getrecentlyaddedresponsebody.md b/docs/sdk/models/operations/getrecentlyaddedresponsebody.md index 5141caaa..881ca97b 100644 --- a/docs/sdk/models/operations/getrecentlyaddedresponsebody.md +++ b/docs/sdk/models/operations/getrecentlyaddedresponsebody.md @@ -94,7 +94,7 @@ let value: GetRecentlyAddedResponseBody = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: FlattenSeasons.True, - showOrdering: ShowOrdering.Dvd, + showOrdering: ShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getsearchalllibrariesglobals.md b/docs/sdk/models/operations/getsearchalllibrariesglobals.md deleted file mode 100644 index 43a21828..00000000 --- a/docs/sdk/models/operations/getsearchalllibrariesglobals.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetSearchAllLibrariesGlobals - -## Example Usage - -```typescript -import { GetSearchAllLibrariesGlobals } from "@lukehagar/plexjs/sdk/models/operations"; - -let value: GetSearchAllLibrariesGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getsearchalllibrariesmediacontainer.md b/docs/sdk/models/operations/getsearchalllibrariesmediacontainer.md index 2e7b6feb..7bc07a5f 100644 --- a/docs/sdk/models/operations/getsearchalllibrariesmediacontainer.md +++ b/docs/sdk/models/operations/getsearchalllibrariesmediacontainer.md @@ -40,7 +40,7 @@ let value: GetSearchAllLibrariesMediaContainer = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetSearchAllLibrariesFlattenSeasons.True, - showOrdering: GetSearchAllLibrariesShowOrdering.Dvd, + showOrdering: GetSearchAllLibrariesShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getsearchalllibrariesmetadata.md b/docs/sdk/models/operations/getsearchalllibrariesmetadata.md index cbf8b56e..95cd070f 100644 --- a/docs/sdk/models/operations/getsearchalllibrariesmetadata.md +++ b/docs/sdk/models/operations/getsearchalllibrariesmetadata.md @@ -35,7 +35,7 @@ let value: GetSearchAllLibrariesMetadata = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetSearchAllLibrariesFlattenSeasons.True, - showOrdering: GetSearchAllLibrariesShowOrdering.Dvd, + showOrdering: GetSearchAllLibrariesShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", @@ -250,7 +250,7 @@ let value: GetSearchAllLibrariesMetadata = { | `seasonCount` | *number* | :heavy_minus_sign: | N/A | 2022 | | `tagline` | *string* | :heavy_minus_sign: | N/A | Return to Pandora. | | `flattenSeasons` | [operations.GetSearchAllLibrariesFlattenSeasons](../../../sdk/models/operations/getsearchalllibrariesflattenseasons.md) | :heavy_minus_sign: | N/A | 1 | -| `showOrdering` | [operations.GetSearchAllLibrariesShowOrdering](../../../sdk/models/operations/getsearchalllibrariesshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
aired = TheTVDB (Aired),
dvd = TheTVDB (DVD),
absolute = TheTVDB (Absolute)).
| dvd | +| `showOrdering` | [operations.GetSearchAllLibrariesShowOrdering](../../../sdk/models/operations/getsearchalllibrariesshowordering.md) | :heavy_minus_sign: | Setting that indicates the episode ordering for the show
None = Library default,
tmdbAiring = The Movie Database (Aired),
tvdbAiring = TheTVDB (Aired),
tvdbDvd = TheTVDB (DVD),
tvdbAbsolute = TheTVDB (Absolute)).
| tvdbDvd | | `thumb` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/thumb/1703239236 | | `art` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/art/1703239236 | | `banner` | *string* | :heavy_minus_sign: | N/A | /library/metadata/58683/banner/1703239236 | diff --git a/docs/sdk/models/operations/getsearchalllibrariesrequest.md b/docs/sdk/models/operations/getsearchalllibrariesrequest.md index 59333ae2..9a04ff26 100644 --- a/docs/sdk/models/operations/getsearchalllibrariesrequest.md +++ b/docs/sdk/models/operations/getsearchalllibrariesrequest.md @@ -12,6 +12,7 @@ import { let value: GetSearchAllLibrariesRequest = { query: "", + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", searchTypes: [ SearchTypes.OtherVideos, ], @@ -25,7 +26,7 @@ let value: GetSearchAllLibrariesRequest = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | | `query` | *string* | :heavy_check_mark: | The search query term. | | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `limit` | *number* | :heavy_minus_sign: | Limit the number of results returned. | | | `searchTypes` | [operations.SearchTypes](../../../sdk/models/operations/searchtypes.md)[] | :heavy_minus_sign: | A comma-separated list of search types to include. Valid values are: movies, music, otherVideos, people, tv.
| movies,music,otherVideos,people,tv | | `includeCollections` | [operations.QueryParamIncludeCollections](../../../sdk/models/operations/queryparamincludecollections.md) | :heavy_minus_sign: | Whether to include collections in the search results. | 1 | diff --git a/docs/sdk/models/operations/getsearchalllibrariesresponse.md b/docs/sdk/models/operations/getsearchalllibrariesresponse.md index 882a4033..d4200bcb 100644 --- a/docs/sdk/models/operations/getsearchalllibrariesresponse.md +++ b/docs/sdk/models/operations/getsearchalllibrariesresponse.md @@ -47,7 +47,7 @@ let value: GetSearchAllLibrariesResponse = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetSearchAllLibrariesFlattenSeasons.True, - showOrdering: GetSearchAllLibrariesShowOrdering.Dvd, + showOrdering: GetSearchAllLibrariesShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getsearchalllibrariesresponsebody.md b/docs/sdk/models/operations/getsearchalllibrariesresponsebody.md index 15c582a4..ead59b79 100644 --- a/docs/sdk/models/operations/getsearchalllibrariesresponsebody.md +++ b/docs/sdk/models/operations/getsearchalllibrariesresponsebody.md @@ -43,7 +43,7 @@ let value: GetSearchAllLibrariesResponseBody = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetSearchAllLibrariesFlattenSeasons.True, - showOrdering: GetSearchAllLibrariesShowOrdering.Dvd, + showOrdering: GetSearchAllLibrariesShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/getsearchalllibrariesshowordering.md b/docs/sdk/models/operations/getsearchalllibrariesshowordering.md index 1f0ff828..2206308a 100644 --- a/docs/sdk/models/operations/getsearchalllibrariesshowordering.md +++ b/docs/sdk/models/operations/getsearchalllibrariesshowordering.md @@ -1,11 +1,11 @@ # GetSearchAllLibrariesShowOrdering -Setting that indicates the episode ordering for the show -None = Library default, -tmdbAiring = The Movie Database (Aired), -aired = TheTVDB (Aired), -dvd = TheTVDB (DVD), -absolute = TheTVDB (Absolute)). +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +tvdbAiring = TheTVDB (Aired), +tvdbDvd = TheTVDB (DVD), +tvdbAbsolute = TheTVDB (Absolute)). ## Example Usage @@ -14,15 +14,15 @@ absolute = TheTVDB (Absolute)). import { GetSearchAllLibrariesShowOrdering } from "@lukehagar/plexjs/sdk/models/operations"; let value: GetSearchAllLibrariesShowOrdering = - GetSearchAllLibrariesShowOrdering.Dvd; + GetSearchAllLibrariesShowOrdering.TvdbDvd; ``` ## Values -| Name | Value | -| ------------ | ------------ | -| `None` | None | -| `TmdbAiring` | tmdbAiring | -| `Aired` | aired | -| `Dvd` | dvd | -| `Absolute` | absolute | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `TvdbAiring` | tvdbAiring | +| `TvdbDvd` | tvdbDvd | +| `TvdbAbsolute` | tvdbAbsolute | \ No newline at end of file diff --git a/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md b/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md index 89a56963..2c113c1b 100644 --- a/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md +++ b/docs/sdk/models/operations/getsearchlibraryqueryparamtype.md @@ -25,4 +25,6 @@ let value: GetSearchLibraryQueryParamType = | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getserverresourcesglobals.md b/docs/sdk/models/operations/getserverresourcesglobals.md deleted file mode 100644 index f9d35ac9..00000000 --- a/docs/sdk/models/operations/getserverresourcesglobals.md +++ /dev/null @@ -1,15 +0,0 @@ -# GetServerResourcesGlobals - -## Example Usage - -```typescript -import { GetServerResourcesGlobals } from "@lukehagar/plexjs/sdk/models/operations"; - -let value: GetServerResourcesGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | \ No newline at end of file diff --git a/docs/sdk/models/operations/getserverresourcesrequest.md b/docs/sdk/models/operations/getserverresourcesrequest.md index edb401b9..c4555b8d 100644 --- a/docs/sdk/models/operations/getserverresourcesrequest.md +++ b/docs/sdk/models/operations/getserverresourcesrequest.md @@ -9,6 +9,7 @@ let value: GetServerResourcesRequest = { includeHttps: IncludeHttps.Enable, includeRelay: IncludeRelay.Enable, includeIPv6: IncludeIPv6.Enable, + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", }; ``` @@ -19,4 +20,4 @@ let value: GetServerResourcesRequest = { | `includeHttps` | [operations.IncludeHttps](../../../sdk/models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | 1 | | `includeRelay` | [operations.IncludeRelay](../../../sdk/models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| 1 | | `includeIPv6` | [operations.IncludeIPv6](../../../sdk/models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | 1 | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | \ No newline at end of file +| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettokenbypinidglobals.md b/docs/sdk/models/operations/gettokenbypinidglobals.md deleted file mode 100644 index df6501d6..00000000 --- a/docs/sdk/models/operations/gettokenbypinidglobals.md +++ /dev/null @@ -1,19 +0,0 @@ -# GetTokenByPinIdGlobals - -## Example Usage - -```typescript -import { GetTokenByPinIdGlobals } from "@lukehagar/plexjs/sdk/models/operations"; - -let value: GetTokenByPinIdGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/sdk/models/operations/gettokenbypinidrequest.md b/docs/sdk/models/operations/gettokenbypinidrequest.md index 32c38a82..27fd6a0d 100644 --- a/docs/sdk/models/operations/gettokenbypinidrequest.md +++ b/docs/sdk/models/operations/gettokenbypinidrequest.md @@ -7,6 +7,11 @@ import { GetTokenByPinIdRequest } from "@lukehagar/plexjs/sdk/models/operations" let value: GetTokenByPinIdRequest = { pinID: 396506, + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", }; ``` @@ -15,7 +20,7 @@ let value: GetTokenByPinIdRequest = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | | `pinID` | *number* | :heavy_check_mark: | The PinID to retrieve an access token for | | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | | `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | | `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | diff --git a/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md b/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md index dff63383..eedca343 100644 --- a/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md +++ b/docs/sdk/models/operations/gettopwatchedcontentqueryparamtype.md @@ -25,4 +25,6 @@ let value: GetTopWatchedContentQueryParamType = | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindataglobals.md b/docs/sdk/models/operations/postuserssignindataglobals.md deleted file mode 100644 index bf950ee3..00000000 --- a/docs/sdk/models/operations/postuserssignindataglobals.md +++ /dev/null @@ -1,19 +0,0 @@ -# PostUsersSignInDataGlobals - -## Example Usage - -```typescript -import { PostUsersSignInDataGlobals } from "@lukehagar/plexjs/sdk/models/operations"; - -let value: PostUsersSignInDataGlobals = {}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | -| `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | -| `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | -| `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | -| `platform` | *string* | :heavy_minus_sign: | The platform of the client application. | Roku | \ No newline at end of file diff --git a/docs/sdk/models/operations/postuserssignindatarequest.md b/docs/sdk/models/operations/postuserssignindatarequest.md index dd72104b..c40523de 100644 --- a/docs/sdk/models/operations/postuserssignindatarequest.md +++ b/docs/sdk/models/operations/postuserssignindatarequest.md @@ -6,6 +6,11 @@ import { PostUsersSignInDataRequest } from "@lukehagar/plexjs/sdk/models/operations"; let value: PostUsersSignInDataRequest = { + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", requestBody: { login: "username@email.com", password: "password123", @@ -18,7 +23,7 @@ let value: PostUsersSignInDataRequest = { | Field | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | +| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | 3381b62b-9ab7-4e37-827b-203e9809eb58 | | `clientName` | *string* | :heavy_minus_sign: | The name of the client application. (Plex Web, Plex Media Server, etc.) | Plex for Roku | | `deviceNickname` | *string* | :heavy_minus_sign: | A relatively friendly name for the client device | Roku 3 | | `clientVersion` | *string* | :heavy_minus_sign: | The version of the client application. | 2.4.1 | diff --git a/docs/sdk/models/operations/queryparamtype.md b/docs/sdk/models/operations/queryparamtype.md index 7fd63f91..88f6b47b 100644 --- a/docs/sdk/models/operations/queryparamtype.md +++ b/docs/sdk/models/operations/queryparamtype.md @@ -24,4 +24,6 @@ let value: QueryParamType = QueryParamType.TvShow; | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdk/models/operations/searchresult.md b/docs/sdk/models/operations/searchresult.md index 0601e968..07d8eb5e 100644 --- a/docs/sdk/models/operations/searchresult.md +++ b/docs/sdk/models/operations/searchresult.md @@ -37,7 +37,7 @@ let value: SearchResult = { seasonCount: 2022, tagline: "Return to Pandora.", flattenSeasons: GetSearchAllLibrariesFlattenSeasons.True, - showOrdering: GetSearchAllLibrariesShowOrdering.Dvd, + showOrdering: GetSearchAllLibrariesShowOrdering.TvdbDvd, thumb: "/library/metadata/58683/thumb/1703239236", art: "/library/metadata/58683/art/1703239236", banner: "/library/metadata/58683/banner/1703239236", diff --git a/docs/sdk/models/operations/showordering.md b/docs/sdk/models/operations/showordering.md index 3c1d23e7..b5e402d5 100644 --- a/docs/sdk/models/operations/showordering.md +++ b/docs/sdk/models/operations/showordering.md @@ -1,11 +1,11 @@ # ShowOrdering -Setting that indicates the episode ordering for the show -None = Library default, -tmdbAiring = The Movie Database (Aired), -aired = TheTVDB (Aired), -dvd = TheTVDB (DVD), -absolute = TheTVDB (Absolute)). +Setting that indicates the episode ordering for the show +None = Library default, +tmdbAiring = The Movie Database (Aired), +tvdbAiring = TheTVDB (Aired), +tvdbDvd = TheTVDB (DVD), +tvdbAbsolute = TheTVDB (Absolute)). ## Example Usage @@ -13,15 +13,15 @@ absolute = TheTVDB (Absolute)). ```typescript import { ShowOrdering } from "@lukehagar/plexjs/sdk/models/operations"; -let value: ShowOrdering = ShowOrdering.Dvd; +let value: ShowOrdering = ShowOrdering.TvdbDvd; ``` ## Values -| Name | Value | -| ------------ | ------------ | -| `None` | None | -| `TmdbAiring` | tmdbAiring | -| `Aired` | aired | -| `Dvd` | dvd | -| `Absolute` | absolute | \ No newline at end of file +| Name | Value | +| -------------- | -------------- | +| `None` | None | +| `TmdbAiring` | tmdbAiring | +| `TvdbAiring` | tvdbAiring | +| `TvdbDvd` | tvdbDvd | +| `TvdbAbsolute` | tvdbAbsolute | \ No newline at end of file diff --git a/docs/sdk/models/operations/tag.md b/docs/sdk/models/operations/tag.md index 0459f911..405c67d7 100644 --- a/docs/sdk/models/operations/tag.md +++ b/docs/sdk/models/operations/tag.md @@ -7,7 +7,7 @@ A key representing a specific tag within the section. ```typescript import { Tag } from "@lukehagar/plexjs/sdk/models/operations"; -let value: Tag = Tag.Unwatched; +let value: Tag = Tag.Newest; ``` ## Values @@ -32,4 +32,5 @@ let value: Tag = Tag.Unwatched; | `Rating` | rating | | `Resolution` | resolution | | `FirstCharacter` | firstCharacter | -| `Folder` | folder | \ No newline at end of file +| `Folder` | folder | +| `Albums` | albums | \ No newline at end of file diff --git a/docs/sdk/models/operations/type.md b/docs/sdk/models/operations/type.md index 16f3e2fc..73fd1cb9 100644 --- a/docs/sdk/models/operations/type.md +++ b/docs/sdk/models/operations/type.md @@ -24,4 +24,6 @@ let value: Type = Type.TvShow; | `TvShow` | 2 | | `Season` | 3 | | `Episode` | 4 | -| `Audio` | 8 | \ No newline at end of file +| `Audio` | 8 | +| `Album` | 9 | +| `Track` | 10 | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md index c71ec759..24674389 100644 --- a/docs/sdks/activities/README.md +++ b/docs/sdks/activities/README.md @@ -28,11 +28,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -57,11 +52,6 @@ import { activitiesGetServerActivities } from "@lukehagar/plexjs/funcs/activitie // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -111,11 +101,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -140,11 +125,6 @@ import { activitiesCancelServerActivities } from "@lukehagar/plexjs/funcs/activi // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/authentication/README.md b/docs/sdks/authentication/README.md index cf91bcd1..bb3c8dbf 100644 --- a/docs/sdks/authentication/README.md +++ b/docs/sdks/authentication/README.md @@ -26,11 +26,6 @@ import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/sdk/mo const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -56,11 +51,6 @@ import { GetTransientTokenQueryParamType, Scope } from "@lukehagar/plexjs/sdk/mo // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -114,11 +104,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -143,11 +128,6 @@ import { authenticationGetSourceConnectionInformation } from "@lukehagar/plexjs/ // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -198,11 +178,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -227,11 +202,6 @@ import { authenticationGetTokenDetails } from "@lukehagar/plexjs/funcs/authentic // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -280,16 +250,15 @@ Sign in user with username and password and return user data with Plex authentic ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.authentication.postUsersSignInData({ + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", requestBody: { login: "username@email.com", password: "password123", @@ -314,16 +283,15 @@ import { authenticationPostUsersSignInData } from "@lukehagar/plexjs/funcs/authe // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. -const plexAPI = new PlexAPICore({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPICore(); async function run() { const res = await authenticationPostUsersSignInData(plexAPI, { + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", requestBody: { login: "username@email.com", password: "password123", diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md index 651d79ae..08698e49 100644 --- a/docs/sdks/butler/README.md +++ b/docs/sdks/butler/README.md @@ -25,11 +25,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -54,11 +49,6 @@ import { butlerGetButlerTasks } from "@lukehagar/plexjs/funcs/butlerGetButlerTas // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -113,11 +103,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -142,11 +127,6 @@ import { butlerStartAllTasks } from "@lukehagar/plexjs/funcs/butlerStartAllTasks // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -197,11 +177,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -226,11 +201,6 @@ import { butlerStopAllTasks } from "@lukehagar/plexjs/funcs/butlerStopAllTasks.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -286,11 +256,6 @@ import { TaskName } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -316,11 +281,6 @@ import { TaskName } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -373,11 +333,6 @@ import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -403,11 +358,6 @@ import { PathParamTaskName } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md index 738dfdcf..6d1e57e6 100644 --- a/docs/sdks/hubs/README.md +++ b/docs/sdks/hubs/README.md @@ -23,11 +23,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -52,11 +47,6 @@ import { hubsGetGlobalHubs } from "@lukehagar/plexjs/funcs/hubsGetGlobalHubs.js" // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -110,11 +100,6 @@ import { IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -147,11 +132,6 @@ import { IncludeMeta, Type } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -208,11 +188,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -237,11 +212,6 @@ import { hubsGetLibraryHubs } from "@lukehagar/plexjs/funcs/hubsGetLibraryHubs.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md index 9a2e0a96..89808212 100644 --- a/docs/sdks/library/README.md +++ b/docs/sdks/library/README.md @@ -33,11 +33,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -62,11 +57,6 @@ import { libraryGetFileHash } from "@lukehagar/plexjs/funcs/libraryGetFileHash.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -120,11 +110,6 @@ import { QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/mod const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -171,11 +156,6 @@ import { QueryParamIncludeMeta, QueryParamType } from "@lukehagar/plexjs/sdk/mod // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -253,11 +233,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -282,11 +257,6 @@ import { libraryGetAllLibraries } from "@lukehagar/plexjs/funcs/libraryGetAllLib // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -375,11 +345,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -404,11 +369,6 @@ import { libraryGetLibraryDetails } from "@lukehagar/plexjs/funcs/libraryGetLibr // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -460,11 +420,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -489,11 +444,6 @@ import { libraryDeleteLibrary } from "@lukehagar/plexjs/funcs/libraryDeleteLibra // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -555,6 +505,7 @@ Fetches details from a specific section of the library identified by a section k - `resolution`: Items categorized by resolution. - `firstCharacter`: Items categorized by the first letter. - `folder`: Items categorized by folder. +- `albums`: Items categorized by album. ### Example Usage @@ -570,11 +521,6 @@ import { const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -613,11 +559,6 @@ import { // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -678,11 +619,6 @@ import { Force } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -708,11 +644,6 @@ import { Force } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -783,11 +714,6 @@ import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/ope const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -813,11 +739,6 @@ import { GetSearchLibraryQueryParamType } from "@lukehagar/plexjs/sdk/models/ope // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -871,16 +792,12 @@ import { QueryParamIncludeCollections, QueryParamIncludeExternalMedia, SearchTyp const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { const result = await plexAPI.library.getSearchAllLibraries({ query: "", + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", searchTypes: [ SearchTypes.People, ], @@ -908,16 +825,12 @@ import { QueryParamIncludeCollections, QueryParamIncludeExternalMedia, SearchTyp // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { const res = await libraryGetSearchAllLibraries(plexAPI, { query: "", + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", searchTypes: [ SearchTypes.People, ], @@ -971,11 +884,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1000,11 +908,6 @@ import { libraryGetMetaDataByRatingKey } from "@lukehagar/plexjs/funcs/libraryGe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1056,11 +959,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1085,11 +983,6 @@ import { libraryGetMetadataChildren } from "@lukehagar/plexjs/funcs/libraryGetMe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1143,11 +1036,6 @@ import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1173,11 +1061,6 @@ import { GetTopWatchedContentQueryParamType } from "@lukehagar/plexjs/sdk/models // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1230,11 +1113,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -1259,11 +1137,6 @@ import { libraryGetOnDeck } from "@lukehagar/plexjs/funcs/libraryGetOnDeck.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md index c0dcf0e6..d99367bb 100644 --- a/docs/sdks/log/README.md +++ b/docs/sdks/log/README.md @@ -25,11 +25,6 @@ import { Level } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -55,11 +50,6 @@ import { Level } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -133,11 +123,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -164,11 +149,6 @@ import { logLogMultiLine } from "@lukehagar/plexjs/funcs/logLogMultiLine.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -222,11 +202,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -251,11 +226,6 @@ import { logEnablePaperTrail } from "@lukehagar/plexjs/funcs/logEnablePaperTrail // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md index bf0d246c..f59b5b1a 100644 --- a/docs/sdks/media/README.md +++ b/docs/sdks/media/README.md @@ -25,11 +25,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -54,11 +49,6 @@ import { mediaMarkPlayed } from "@lukehagar/plexjs/funcs/mediaMarkPlayed.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -109,11 +99,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -138,11 +123,6 @@ import { mediaMarkUnplayed } from "@lukehagar/plexjs/funcs/mediaMarkUnplayed.js" // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -194,11 +174,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -223,11 +198,6 @@ import { mediaUpdatePlayProgress } from "@lukehagar/plexjs/funcs/mediaUpdatePlay // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -280,11 +250,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -316,11 +281,6 @@ import { mediaGetBannerImage } from "@lukehagar/plexjs/funcs/mediaGetBannerImage // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -378,11 +338,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -414,11 +369,6 @@ import { mediaGetThumbImage } from "@lukehagar/plexjs/funcs/mediaGetThumbImage.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md index d805145b..acc90e54 100644 --- a/docs/sdks/playlists/README.md +++ b/docs/sdks/playlists/README.md @@ -36,11 +36,6 @@ import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs/sdk/model const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -71,11 +66,6 @@ import { CreatePlaylistQueryParamType, Smart } from "@lukehagar/plexjs/sdk/model // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -131,11 +121,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -160,11 +145,6 @@ import { playlistsGetPlaylists } from "@lukehagar/plexjs/funcs/playlistsGetPlayl // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -218,11 +198,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -247,11 +222,6 @@ import { playlistsGetPlaylist } from "@lukehagar/plexjs/funcs/playlistsGetPlayli // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -303,11 +273,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -332,11 +297,6 @@ import { playlistsDeletePlaylist } from "@lukehagar/plexjs/funcs/playlistsDelete // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -388,11 +348,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -417,11 +372,6 @@ import { playlistsUpdatePlaylist } from "@lukehagar/plexjs/funcs/playlistsUpdate // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -479,11 +429,6 @@ import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/ const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -509,11 +454,6 @@ import { GetPlaylistContentsQueryParamType } from "@lukehagar/plexjs/sdk/models/ // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -566,11 +506,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -595,11 +530,6 @@ import { playlistsClearPlaylistContents } from "@lukehagar/plexjs/funcs/playlist // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -652,11 +582,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -681,11 +606,6 @@ import { playlistsAddPlaylistContents } from "@lukehagar/plexjs/funcs/playlistsA // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -740,11 +660,6 @@ import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -770,11 +685,6 @@ import { QueryParamForce } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/plex/README.md b/docs/sdks/plex/README.md index 6334f302..f687f5d4 100644 --- a/docs/sdks/plex/README.md +++ b/docs/sdks/plex/README.md @@ -27,11 +27,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -56,11 +51,6 @@ import { plexGetCompanionsData } from "@lukehagar/plexjs/funcs/plexGetCompanions // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -111,11 +101,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -140,11 +125,6 @@ import { plexGetUserFriends } from "@lukehagar/plexjs/funcs/plexGetUserFriends.j // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -193,13 +173,7 @@ Returns the geolocation and locale data of the caller ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.plex.getGeoData(); @@ -221,13 +195,7 @@ import { plexGetGeoData } from "@lukehagar/plexjs/funcs/plexGetGeoData.js"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. -const plexAPI = new PlexAPICore({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPICore(); async function run() { const res = await plexGetGeoData(plexAPI); @@ -277,11 +245,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -306,11 +269,6 @@ import { plexGetHomeData } from "@lukehagar/plexjs/funcs/plexGetHomeData.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -361,15 +319,10 @@ import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/sdk/m const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { - const result = await plexAPI.plex.getServerResources(IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable, "3381b62b-9ab7-4e37-827b-203e9809eb58"); + const result = await plexAPI.plex.getServerResources("3381b62b-9ab7-4e37-827b-203e9809eb58", IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable); // Handle the result console.log(result); @@ -391,15 +344,10 @@ import { IncludeHttps, IncludeIPv6, IncludeRelay } from "@lukehagar/plexjs/sdk/m // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { - const res = await plexGetServerResources(plexAPI, IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable, "3381b62b-9ab7-4e37-827b-203e9809eb58"); + const res = await plexGetServerResources(plexAPI, "3381b62b-9ab7-4e37-827b-203e9809eb58", IncludeHttps.Enable, IncludeRelay.Enable, IncludeIPv6.Enable); if (!res.ok) { throw res.error; @@ -418,10 +366,10 @@ run(); | Parameter | Type | Required | Description | Example | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `clientID` | *string* | :heavy_check_mark: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | [object Object] | | `includeHttps` | [operations.IncludeHttps](../../sdk/models/operations/includehttps.md) | :heavy_minus_sign: | Include Https entries in the results | [object Object] | | `includeRelay` | [operations.IncludeRelay](../../sdk/models/operations/includerelay.md) | :heavy_minus_sign: | Include Relay addresses in the results
E.g: https://10-0-0-25.bbf8e10c7fa20447cacee74cd9914cde.plex.direct:32400
| [object Object] | | `includeIPv6` | [operations.IncludeIPv6](../../sdk/models/operations/includeipv6.md) | :heavy_minus_sign: | Include IPv6 entries in the results | [object Object] | -| `clientID` | *string* | :heavy_minus_sign: | An opaque identifier unique to the client (UUID, serial number, or other unique device ID) | [object Object] | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | | | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | | @@ -448,16 +396,16 @@ Retrieve a Pin ID from Plex.tv to use for authentication flows ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPI(); async function run() { - const result = await plexAPI.plex.getPin({}); + const result = await plexAPI.plex.getPin({ + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", + }); // Handle the result console.log(result); @@ -476,16 +424,16 @@ import { plexGetPin } from "@lukehagar/plexjs/funcs/plexGetPin.js"; // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. -const plexAPI = new PlexAPICore({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPICore(); async function run() { - const res = await plexGetPin(plexAPI, {}); + const res = await plexGetPin(plexAPI, { + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", + }); if (!res.ok) { throw res.error; @@ -530,17 +478,16 @@ Retrieve an Access Token from Plex.tv after the Pin has been authenticated ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.plex.getTokenByPinId({ pinID: 408895, + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", }); // Handle the result @@ -560,17 +507,16 @@ import { plexGetTokenByPinId } from "@lukehagar/plexjs/funcs/plexGetTokenByPinId // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. -const plexAPI = new PlexAPICore({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPICore(); async function run() { const res = await plexGetTokenByPinId(plexAPI, { pinID: 408895, + clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", + clientName: "Plex for Roku", + deviceNickname: "Roku 3", + clientVersion: "2.4.1", + platform: "Roku", }); if (!res.ok) { diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md index e91fa370..1e395e44 100644 --- a/docs/sdks/plexapi/README.md +++ b/docs/sdks/plexapi/README.md @@ -26,3 +26,6 @@ The following SDKs are generated from the OpenAPI Specification. They are automa | PHP | [GitHub](https://github.com/LukeHagar/plexphp) | [Releases](https://github.com/LukeHagar/plexphp/releases) | - | | Java | [GitHub](https://github.com/LukeHagar/plexjava) | [Releases](https://github.com/LukeHagar/plexjava/releases) | - | | C# | [GitHub](https://github.com/LukeHagar/plexcsharp) | [Releases](https://github.com/LukeHagar/plexcsharp/releases) | - + + +### Available Operations diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md index 000381c6..b3524e23 100644 --- a/docs/sdks/search/README.md +++ b/docs/sdks/search/README.md @@ -35,11 +35,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -64,11 +59,6 @@ import { searchPerformSearch } from "@lukehagar/plexjs/funcs/searchPerformSearch // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -125,11 +115,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -154,11 +139,6 @@ import { searchPerformVoiceSearch } from "@lukehagar/plexjs/funcs/searchPerformV // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -211,11 +191,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -240,11 +215,6 @@ import { searchGetSearchResults } from "@lukehagar/plexjs/funcs/searchGetSearchR // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md index 270fd917..9f52f818 100644 --- a/docs/sdks/server/README.md +++ b/docs/sdks/server/README.md @@ -29,11 +29,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -58,11 +53,6 @@ import { serverGetServerCapabilities } from "@lukehagar/plexjs/funcs/serverGetSe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -112,11 +102,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -141,11 +126,6 @@ import { serverGetServerPreferences } from "@lukehagar/plexjs/funcs/serverGetSer // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -195,11 +175,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -224,11 +199,6 @@ import { serverGetAvailableClients } from "@lukehagar/plexjs/funcs/serverGetAvai // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -278,11 +248,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -307,11 +272,6 @@ import { serverGetDevices } from "@lukehagar/plexjs/funcs/serverGetDevices.js"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -359,13 +319,7 @@ This request is useful to determine if the server is online or offline ```typescript import { PlexAPI } from "@lukehagar/plexjs"; -const plexAPI = new PlexAPI({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPI(); async function run() { const result = await plexAPI.server.getServerIdentity(); @@ -387,13 +341,7 @@ import { serverGetServerIdentity } from "@lukehagar/plexjs/funcs/serverGetServer // Use `PlexAPICore` for best tree-shaking performance. // You can create one instance of it to use across an application. -const plexAPI = new PlexAPICore({ - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", -}); +const plexAPI = new PlexAPICore(); async function run() { const res = await serverGetServerIdentity(plexAPI); @@ -441,11 +389,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -470,11 +413,6 @@ import { serverGetMyPlexAccount } from "@lukehagar/plexjs/funcs/serverGetMyPlexA // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -526,11 +464,6 @@ import { MinSize, Upscale } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -564,11 +497,6 @@ import { MinSize, Upscale } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -627,11 +555,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -656,11 +579,6 @@ import { serverGetMediaProviders } from "@lukehagar/plexjs/funcs/serverGetMediaP // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -711,11 +629,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -740,11 +653,6 @@ import { serverGetServerList } from "@lukehagar/plexjs/funcs/serverGetServerList // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md index 443d0b27..817abffa 100644 --- a/docs/sdks/sessions/README.md +++ b/docs/sdks/sessions/README.md @@ -24,11 +24,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -53,11 +48,6 @@ import { sessionsGetSessions } from "@lukehagar/plexjs/funcs/sessionsGetSessions // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -107,11 +97,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -136,11 +121,6 @@ import { sessionsGetSessionHistory } from "@lukehagar/plexjs/funcs/sessionsGetSe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -194,11 +174,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -223,11 +198,6 @@ import { sessionsGetTranscodeSessions } from "@lukehagar/plexjs/funcs/sessionsGe // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -277,11 +247,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -306,11 +271,6 @@ import { sessionsStopTranscodeSession } from "@lukehagar/plexjs/funcs/sessionsSt // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/statistics/README.md b/docs/sdks/statistics/README.md index 70a036f0..92c7c938 100644 --- a/docs/sdks/statistics/README.md +++ b/docs/sdks/statistics/README.md @@ -23,11 +23,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -52,11 +47,6 @@ import { statisticsGetStatistics } from "@lukehagar/plexjs/funcs/statisticsGetSt // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -107,11 +97,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -136,11 +121,6 @@ import { statisticsGetResourcesStatistics } from "@lukehagar/plexjs/funcs/statis // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -191,11 +171,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -220,11 +195,6 @@ import { statisticsGetBandwidthStatistics } from "@lukehagar/plexjs/funcs/statis // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md index 94ef33ae..25491172 100644 --- a/docs/sdks/updater/README.md +++ b/docs/sdks/updater/README.md @@ -24,11 +24,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -53,11 +48,6 @@ import { updaterGetUpdateStatus } from "@lukehagar/plexjs/funcs/updaterGetUpdate // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -108,11 +98,6 @@ import { Download } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -138,11 +123,6 @@ import { Download } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -195,11 +175,6 @@ import { Skip, Tonight } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -225,11 +200,6 @@ import { Skip, Tonight } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md index 401fbfd2..3862579e 100644 --- a/docs/sdks/video/README.md +++ b/docs/sdks/video/README.md @@ -23,11 +23,6 @@ import { State } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -64,11 +59,6 @@ import { State } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -130,11 +120,6 @@ import { PlexAPI } from "@lukehagar/plexjs"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -176,11 +161,6 @@ import { videoStartUniversalTranscode } from "@lukehagar/plexjs/funcs/videoStart // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/docs/sdks/watchlist/README.md b/docs/sdks/watchlist/README.md index 2c1632c7..d97a5bc1 100644 --- a/docs/sdks/watchlist/README.md +++ b/docs/sdks/watchlist/README.md @@ -22,11 +22,6 @@ import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; const plexAPI = new PlexAPI({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { @@ -57,11 +52,6 @@ import { Filter } from "@lukehagar/plexjs/sdk/models/operations"; // You can create one instance of it to use across an application. const plexAPI = new PlexAPICore({ accessToken: "", - clientID: "3381b62b-9ab7-4e37-827b-203e9809eb58", - clientName: "Plex for Roku", - clientVersion: "2.4.1", - platform: "Roku", - deviceNickname: "Roku 3", }); async function run() { diff --git a/jsr.json b/jsr.json index 6d87d73e..09d1cf83 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@lukehagar/plexjs", - "version": "0.31.1", + "version": "0.32.0", "exports": { ".": "./src/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 4e985c64..c5eb5422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lukehagar/plexjs", - "version": "0.31.1", + "version": "0.32.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lukehagar/plexjs", - "version": "0.31.1", + "version": "0.32.0", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index 2e513e28..bddde8b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lukehagar/plexjs", - "version": "0.31.1", + "version": "0.32.0", "author": "LukeHagar", "main": "./index.js", "sideEffects": false, diff --git a/src/funcs/activitiesCancelServerActivities.ts b/src/funcs/activitiesCancelServerActivities.ts index 567ebc43..582eac69 100644 --- a/src/funcs/activitiesCancelServerActivities.ts +++ b/src/funcs/activitiesCancelServerActivities.ts @@ -77,16 +77,25 @@ export async function activitiesCancelServerActivities( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "cancelServerActivities", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -100,9 +109,8 @@ export async function activitiesCancelServerActivities( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/activitiesGetServerActivities.ts b/src/funcs/activitiesGetServerActivities.ts index ac12893c..b26d9b94 100644 --- a/src/funcs/activitiesGetServerActivities.ts +++ b/src/funcs/activitiesGetServerActivities.ts @@ -51,16 +51,25 @@ export async function activitiesGetServerActivities( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getServerActivities", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function activitiesGetServerActivities( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/authenticationGetSourceConnectionInformation.ts b/src/funcs/authenticationGetSourceConnectionInformation.ts index 5ae86236..84f1a519 100644 --- a/src/funcs/authenticationGetSourceConnectionInformation.ts +++ b/src/funcs/authenticationGetSourceConnectionInformation.ts @@ -77,16 +77,25 @@ export async function authenticationGetSourceConnectionInformation( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getSourceConnectionInformation", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -101,9 +110,8 @@ export async function authenticationGetSourceConnectionInformation( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/authenticationGetTokenDetails.ts b/src/funcs/authenticationGetTokenDetails.ts index 03e562cc..9b0495e7 100644 --- a/src/funcs/authenticationGetTokenDetails.ts +++ b/src/funcs/authenticationGetTokenDetails.ts @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; */ export async function authenticationGetTokenDetails( client: PlexAPICore, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetTokenDetailsResponse, @@ -55,12 +55,20 @@ export async function authenticationGetTokenDetails( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getTokenDetails", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, @@ -78,9 +86,8 @@ export async function authenticationGetTokenDetails( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/authenticationGetTransientToken.ts b/src/funcs/authenticationGetTransientToken.ts index bd04e110..3f204a76 100644 --- a/src/funcs/authenticationGetTransientToken.ts +++ b/src/funcs/authenticationGetTransientToken.ts @@ -76,16 +76,25 @@ export async function authenticationGetTransientToken( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getTransientToken", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -100,9 +109,8 @@ export async function authenticationGetTransientToken( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/authenticationPostUsersSignInData.ts b/src/funcs/authenticationPostUsersSignInData.ts index dcc16490..6f2feaa9 100644 --- a/src/funcs/authenticationPostUsersSignInData.ts +++ b/src/funcs/authenticationPostUsersSignInData.ts @@ -31,7 +31,7 @@ import { Result } from "../sdk/types/fp.js"; export async function authenticationPostUsersSignInData( client: PlexAPICore, request: operations.PostUsersSignInDataRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.PostUsersSignInDataResponse, @@ -46,10 +46,8 @@ export async function authenticationPostUsersSignInData( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.PostUsersSignInDataRequest$outboundSchema.parse(value), "Input validation failed", @@ -94,37 +92,19 @@ export async function authenticationPostUsersSignInData( explode: false, charEncoding: "none", }), - "X-Plex-Client-Identifier": encodeSimple( - "X-Plex-Client-Identifier", - client._options.clientID, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Device": encodeSimple( - "X-Plex-Device", - client._options.deviceNickname, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Platform": encodeSimple( - "X-Plex-Platform", - client._options.platform, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Product": encodeSimple( - "X-Plex-Product", - client._options.clientName, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Version": encodeSimple( - "X-Plex-Version", - client._options.clientVersion, - { explode: false, charEncoding: "none" }, - ), }); const context = { operationID: "post-users-sign-in-data", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; const requestRes = client._createRequest(context, { @@ -143,9 +123,8 @@ export async function authenticationPostUsersSignInData( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/butlerGetButlerTasks.ts b/src/funcs/butlerGetButlerTasks.ts index d73604a5..c9717445 100644 --- a/src/funcs/butlerGetButlerTasks.ts +++ b/src/funcs/butlerGetButlerTasks.ts @@ -51,16 +51,25 @@ export async function butlerGetButlerTasks( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getButlerTasks", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function butlerGetButlerTasks( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/butlerStartAllTasks.ts b/src/funcs/butlerStartAllTasks.ts index aaff2818..90f4ef14 100644 --- a/src/funcs/butlerStartAllTasks.ts +++ b/src/funcs/butlerStartAllTasks.ts @@ -55,16 +55,25 @@ export async function butlerStartAllTasks( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "startAllTasks", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -77,9 +86,8 @@ export async function butlerStartAllTasks( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/butlerStartTask.ts b/src/funcs/butlerStartTask.ts index 2c4bea72..bdeaf93d 100644 --- a/src/funcs/butlerStartTask.ts +++ b/src/funcs/butlerStartTask.ts @@ -80,16 +80,25 @@ export async function butlerStartTask( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "startTask", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -103,9 +112,8 @@ export async function butlerStartTask( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/butlerStopAllTasks.ts b/src/funcs/butlerStopAllTasks.ts index d0395835..af4c057b 100644 --- a/src/funcs/butlerStopAllTasks.ts +++ b/src/funcs/butlerStopAllTasks.ts @@ -51,16 +51,25 @@ export async function butlerStopAllTasks( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "stopAllTasks", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function butlerStopAllTasks( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/butlerStopTask.ts b/src/funcs/butlerStopTask.ts index 2613c496..20d5f82d 100644 --- a/src/funcs/butlerStopTask.ts +++ b/src/funcs/butlerStopTask.ts @@ -76,16 +76,25 @@ export async function butlerStopTask( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "stopTask", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -99,9 +108,8 @@ export async function butlerStopTask( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "404", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/hubsGetGlobalHubs.ts b/src/funcs/hubsGetGlobalHubs.ts index e5ed6ad8..645450e8 100644 --- a/src/funcs/hubsGetGlobalHubs.ts +++ b/src/funcs/hubsGetGlobalHubs.ts @@ -76,16 +76,25 @@ export async function hubsGetGlobalHubs( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getGlobalHubs", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -100,9 +109,8 @@ export async function hubsGetGlobalHubs( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/hubsGetLibraryHubs.ts b/src/funcs/hubsGetLibraryHubs.ts index 678b717e..4208d647 100644 --- a/src/funcs/hubsGetLibraryHubs.ts +++ b/src/funcs/hubsGetLibraryHubs.ts @@ -85,16 +85,25 @@ export async function hubsGetLibraryHubs( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getLibraryHubs", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -109,9 +118,8 @@ export async function hubsGetLibraryHubs( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/hubsGetRecentlyAdded.ts b/src/funcs/hubsGetRecentlyAdded.ts index 1ef78e7b..f2b49f37 100644 --- a/src/funcs/hubsGetRecentlyAdded.ts +++ b/src/funcs/hubsGetRecentlyAdded.ts @@ -43,10 +43,8 @@ export async function hubsGetRecentlyAdded( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetRecentlyAddedRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -74,16 +72,25 @@ export async function hubsGetRecentlyAdded( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-recently-added", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -98,9 +105,8 @@ export async function hubsGetRecentlyAdded( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryDeleteLibrary.ts b/src/funcs/libraryDeleteLibrary.ts index 2306e1d7..81f1994b 100644 --- a/src/funcs/libraryDeleteLibrary.ts +++ b/src/funcs/libraryDeleteLibrary.ts @@ -76,16 +76,25 @@ export async function libraryDeleteLibrary( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "deleteLibrary", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -99,9 +108,8 @@ export async function libraryDeleteLibrary( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetAllLibraries.ts b/src/funcs/libraryGetAllLibraries.ts index c5b327fe..25e9e8d1 100644 --- a/src/funcs/libraryGetAllLibraries.ts +++ b/src/funcs/libraryGetAllLibraries.ts @@ -56,16 +56,25 @@ export async function libraryGetAllLibraries( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-all-libraries", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -78,9 +87,8 @@ export async function libraryGetAllLibraries( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetFileHash.ts b/src/funcs/libraryGetFileHash.ts index de8e59f7..50381e74 100644 --- a/src/funcs/libraryGetFileHash.ts +++ b/src/funcs/libraryGetFileHash.ts @@ -76,16 +76,25 @@ export async function libraryGetFileHash( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getFileHash", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -100,9 +109,8 @@ export async function libraryGetFileHash( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetLibraryDetails.ts b/src/funcs/libraryGetLibraryDetails.ts index a141d2f4..df097a61 100644 --- a/src/funcs/libraryGetLibraryDetails.ts +++ b/src/funcs/libraryGetLibraryDetails.ts @@ -86,8 +86,8 @@ export async function libraryGetLibraryDetails( > > { const input: operations.GetLibraryDetailsRequest = { - includeDetails: includeDetails, sectionKey: sectionKey, + includeDetails: includeDetails, }; const parsed = safeParse( @@ -120,16 +120,25 @@ export async function libraryGetLibraryDetails( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-library-details", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -144,9 +153,8 @@ export async function libraryGetLibraryDetails( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetLibraryItems.ts b/src/funcs/libraryGetLibraryItems.ts index 4952a0ed..c4078163 100644 --- a/src/funcs/libraryGetLibraryItems.ts +++ b/src/funcs/libraryGetLibraryItems.ts @@ -46,6 +46,7 @@ import { Result } from "../sdk/types/fp.js"; * - `resolution`: Items categorized by resolution. * - `firstCharacter`: Items categorized by the first letter. * - `folder`: Items categorized by folder. + * - `albums`: Items categorized by album. */ export async function libraryGetLibraryItems( client: PlexAPICore, @@ -65,10 +66,8 @@ export async function libraryGetLibraryItems( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetLibraryItemsRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -105,16 +104,25 @@ export async function libraryGetLibraryItems( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-library-items", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -129,9 +137,8 @@ export async function libraryGetLibraryItems( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetMetaDataByRatingKey.ts b/src/funcs/libraryGetMetaDataByRatingKey.ts index 7917963e..72b84240 100644 --- a/src/funcs/libraryGetMetaDataByRatingKey.ts +++ b/src/funcs/libraryGetMetaDataByRatingKey.ts @@ -77,16 +77,25 @@ export async function libraryGetMetaDataByRatingKey( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-meta-data-by-rating-key", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -100,9 +109,8 @@ export async function libraryGetMetaDataByRatingKey( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetMetadataChildren.ts b/src/funcs/libraryGetMetadataChildren.ts index 11d14bbb..215aaa37 100644 --- a/src/funcs/libraryGetMetadataChildren.ts +++ b/src/funcs/libraryGetMetadataChildren.ts @@ -83,16 +83,25 @@ export async function libraryGetMetadataChildren( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getMetadataChildren", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -107,9 +116,8 @@ export async function libraryGetMetadataChildren( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetOnDeck.ts b/src/funcs/libraryGetOnDeck.ts index 9b6b9665..3619f05c 100644 --- a/src/funcs/libraryGetOnDeck.ts +++ b/src/funcs/libraryGetOnDeck.ts @@ -51,16 +51,25 @@ export async function libraryGetOnDeck( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getOnDeck", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function libraryGetOnDeck( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetRecentlyAddedLibrary.ts b/src/funcs/libraryGetRecentlyAddedLibrary.ts index 75b036d0..4987da77 100644 --- a/src/funcs/libraryGetRecentlyAddedLibrary.ts +++ b/src/funcs/libraryGetRecentlyAddedLibrary.ts @@ -46,10 +46,8 @@ export async function libraryGetRecentlyAddedLibrary( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetRecentlyAddedLibraryRequest$outboundSchema.parse(value), "Input validation failed", @@ -78,16 +76,25 @@ export async function libraryGetRecentlyAddedLibrary( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-recently-added-library", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -102,9 +109,8 @@ export async function libraryGetRecentlyAddedLibrary( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetRefreshLibraryMetadata.ts b/src/funcs/libraryGetRefreshLibraryMetadata.ts index 56bd0f73..af91e6f2 100644 --- a/src/funcs/libraryGetRefreshLibraryMetadata.ts +++ b/src/funcs/libraryGetRefreshLibraryMetadata.ts @@ -48,8 +48,8 @@ export async function libraryGetRefreshLibraryMetadata( > > { const input: operations.GetRefreshLibraryMetadataRequest = { - force: force, sectionKey: sectionKey, + force: force, }; const parsed = safeParse( @@ -83,16 +83,25 @@ export async function libraryGetRefreshLibraryMetadata( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-refresh-library-metadata", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -107,9 +116,8 @@ export async function libraryGetRefreshLibraryMetadata( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetSearchAllLibraries.ts b/src/funcs/libraryGetSearchAllLibraries.ts index 82f5c943..ec587695 100644 --- a/src/funcs/libraryGetSearchAllLibraries.ts +++ b/src/funcs/libraryGetSearchAllLibraries.ts @@ -46,10 +46,8 @@ export async function libraryGetSearchAllLibraries( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetSearchAllLibrariesRequest$outboundSchema.parse(value), "Input validation failed", @@ -81,25 +79,29 @@ export async function libraryGetSearchAllLibraries( payload.ClientID, { explode: false, charEncoding: "none" }, ), - "X-Plex-Client-Identifier": encodeSimple( - "X-Plex-Client-Identifier", - client._options.clientID, - { explode: false, charEncoding: "none" }, - ), }); const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-search-all-libraries", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -114,9 +116,8 @@ export async function libraryGetSearchAllLibraries( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetSearchLibrary.ts b/src/funcs/libraryGetSearchLibrary.ts index e2168cf0..e826637a 100644 --- a/src/funcs/libraryGetSearchLibrary.ts +++ b/src/funcs/libraryGetSearchLibrary.ts @@ -99,16 +99,25 @@ export async function libraryGetSearchLibrary( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-search-library", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -123,9 +132,8 @@ export async function libraryGetSearchLibrary( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/libraryGetTopWatchedContent.ts b/src/funcs/libraryGetTopWatchedContent.ts index 9cd860b5..1dfacb01 100644 --- a/src/funcs/libraryGetTopWatchedContent.ts +++ b/src/funcs/libraryGetTopWatchedContent.ts @@ -48,8 +48,8 @@ export async function libraryGetTopWatchedContent( > > { const input: operations.GetTopWatchedContentRequest = { - includeGuids: includeGuids, type: type, + includeGuids: includeGuids, }; const parsed = safeParse( @@ -77,16 +77,25 @@ export async function libraryGetTopWatchedContent( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getTopWatchedContent", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -101,9 +110,8 @@ export async function libraryGetTopWatchedContent( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/logEnablePaperTrail.ts b/src/funcs/logEnablePaperTrail.ts index 65dad8ed..8bf7d4df 100644 --- a/src/funcs/logEnablePaperTrail.ts +++ b/src/funcs/logEnablePaperTrail.ts @@ -51,16 +51,25 @@ export async function logEnablePaperTrail( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "enablePaperTrail", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function logEnablePaperTrail( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "403", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/logLogLine.ts b/src/funcs/logLogLine.ts index 7c64af4b..05d1288d 100644 --- a/src/funcs/logLogLine.ts +++ b/src/funcs/logLogLine.ts @@ -79,16 +79,25 @@ export async function logLogLine( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "logLine", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -103,9 +112,8 @@ export async function logLogLine( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/logLogMultiLine.ts b/src/funcs/logLogMultiLine.ts index ef467c3a..ee19be28 100644 --- a/src/funcs/logLogMultiLine.ts +++ b/src/funcs/logLogMultiLine.ts @@ -66,10 +66,8 @@ export async function logLogMultiLine( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => z.string().parse(value), "Input validation failed", ); @@ -88,16 +86,25 @@ export async function logLogMultiLine( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "logMultiLine", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -111,9 +118,8 @@ export async function logLogMultiLine( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/mediaGetBannerImage.ts b/src/funcs/mediaGetBannerImage.ts index cbfb6e12..500059e4 100644 --- a/src/funcs/mediaGetBannerImage.ts +++ b/src/funcs/mediaGetBannerImage.ts @@ -46,10 +46,8 @@ export async function mediaGetBannerImage( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetBannerImageRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -85,16 +83,25 @@ export async function mediaGetBannerImage( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-banner-image", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -109,9 +116,8 @@ export async function mediaGetBannerImage( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/mediaGetThumbImage.ts b/src/funcs/mediaGetThumbImage.ts index 86a492fe..2e843dae 100644 --- a/src/funcs/mediaGetThumbImage.ts +++ b/src/funcs/mediaGetThumbImage.ts @@ -46,10 +46,8 @@ export async function mediaGetThumbImage( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetThumbImageRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -85,16 +83,25 @@ export async function mediaGetThumbImage( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-thumb-image", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -109,9 +116,8 @@ export async function mediaGetThumbImage( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/mediaMarkPlayed.ts b/src/funcs/mediaMarkPlayed.ts index fafb70fe..8009ca5c 100644 --- a/src/funcs/mediaMarkPlayed.ts +++ b/src/funcs/mediaMarkPlayed.ts @@ -73,16 +73,25 @@ export async function mediaMarkPlayed( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "markPlayed", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -97,9 +106,8 @@ export async function mediaMarkPlayed( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/mediaMarkUnplayed.ts b/src/funcs/mediaMarkUnplayed.ts index 4e707c9e..2b1e1a15 100644 --- a/src/funcs/mediaMarkUnplayed.ts +++ b/src/funcs/mediaMarkUnplayed.ts @@ -73,16 +73,25 @@ export async function mediaMarkUnplayed( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "markUnplayed", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -97,9 +106,8 @@ export async function mediaMarkUnplayed( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/mediaUpdatePlayProgress.ts b/src/funcs/mediaUpdatePlayProgress.ts index efcb4bd5..0eb401e8 100644 --- a/src/funcs/mediaUpdatePlayProgress.ts +++ b/src/funcs/mediaUpdatePlayProgress.ts @@ -79,16 +79,25 @@ export async function mediaUpdatePlayProgress( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "updatePlayProgress", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -103,9 +112,8 @@ export async function mediaUpdatePlayProgress( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsAddPlaylistContents.ts b/src/funcs/playlistsAddPlaylistContents.ts index c9eaf0fd..081ea1fa 100644 --- a/src/funcs/playlistsAddPlaylistContents.ts +++ b/src/funcs/playlistsAddPlaylistContents.ts @@ -87,16 +87,25 @@ export async function playlistsAddPlaylistContents( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "addPlaylistContents", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "PUT", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -111,9 +120,8 @@ export async function playlistsAddPlaylistContents( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsClearPlaylistContents.ts b/src/funcs/playlistsClearPlaylistContents.ts index e118d70c..cf303bbe 100644 --- a/src/funcs/playlistsClearPlaylistContents.ts +++ b/src/funcs/playlistsClearPlaylistContents.ts @@ -77,16 +77,25 @@ export async function playlistsClearPlaylistContents( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "clearPlaylistContents", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -100,9 +109,8 @@ export async function playlistsClearPlaylistContents( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsCreatePlaylist.ts b/src/funcs/playlistsCreatePlaylist.ts index 76a5f396..50315336 100644 --- a/src/funcs/playlistsCreatePlaylist.ts +++ b/src/funcs/playlistsCreatePlaylist.ts @@ -48,10 +48,8 @@ export async function playlistsCreatePlaylist( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.CreatePlaylistRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -77,16 +75,25 @@ export async function playlistsCreatePlaylist( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "createPlaylist", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -101,9 +108,8 @@ export async function playlistsCreatePlaylist( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsDeletePlaylist.ts b/src/funcs/playlistsDeletePlaylist.ts index b4f37c28..97ca207e 100644 --- a/src/funcs/playlistsDeletePlaylist.ts +++ b/src/funcs/playlistsDeletePlaylist.ts @@ -76,16 +76,25 @@ export async function playlistsDeletePlaylist( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "deletePlaylist", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -99,9 +108,8 @@ export async function playlistsDeletePlaylist( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsGetPlaylist.ts b/src/funcs/playlistsGetPlaylist.ts index ea4ab7f7..7267e81c 100644 --- a/src/funcs/playlistsGetPlaylist.ts +++ b/src/funcs/playlistsGetPlaylist.ts @@ -77,16 +77,25 @@ export async function playlistsGetPlaylist( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getPlaylist", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -100,9 +109,8 @@ export async function playlistsGetPlaylist( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsGetPlaylistContents.ts b/src/funcs/playlistsGetPlaylistContents.ts index 55f86d18..a39d3b97 100644 --- a/src/funcs/playlistsGetPlaylistContents.ts +++ b/src/funcs/playlistsGetPlaylistContents.ts @@ -86,16 +86,25 @@ export async function playlistsGetPlaylistContents( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getPlaylistContents", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -110,9 +119,8 @@ export async function playlistsGetPlaylistContents( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsGetPlaylists.ts b/src/funcs/playlistsGetPlaylists.ts index 50ccf265..6ac7266b 100644 --- a/src/funcs/playlistsGetPlaylists.ts +++ b/src/funcs/playlistsGetPlaylists.ts @@ -76,16 +76,25 @@ export async function playlistsGetPlaylists( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getPlaylists", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -100,9 +109,8 @@ export async function playlistsGetPlaylists( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsUpdatePlaylist.ts b/src/funcs/playlistsUpdatePlaylist.ts index 46cf76be..433af319 100644 --- a/src/funcs/playlistsUpdatePlaylist.ts +++ b/src/funcs/playlistsUpdatePlaylist.ts @@ -85,16 +85,25 @@ export async function playlistsUpdatePlaylist( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "updatePlaylist", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "PUT", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -109,9 +118,8 @@ export async function playlistsUpdatePlaylist( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/playlistsUploadPlaylist.ts b/src/funcs/playlistsUploadPlaylist.ts index 9b4a3672..8c37840e 100644 --- a/src/funcs/playlistsUploadPlaylist.ts +++ b/src/funcs/playlistsUploadPlaylist.ts @@ -79,16 +79,25 @@ export async function playlistsUploadPlaylist( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "uploadPlaylist", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "POST", + baseURL: options?.serverURL, path: path$, headers: headers, query: query, @@ -103,9 +112,8 @@ export async function playlistsUploadPlaylist( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetCompanionsData.ts b/src/funcs/plexGetCompanionsData.ts index 2c742abc..172355c5 100644 --- a/src/funcs/plexGetCompanionsData.ts +++ b/src/funcs/plexGetCompanionsData.ts @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; */ export async function plexGetCompanionsData( client: PlexAPICore, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetCompanionsDataResponse, @@ -57,12 +57,20 @@ export async function plexGetCompanionsData( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getCompanionsData", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, @@ -80,9 +88,8 @@ export async function plexGetCompanionsData( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetGeoData.ts b/src/funcs/plexGetGeoData.ts index 50cdb5b9..6fa052f1 100644 --- a/src/funcs/plexGetGeoData.ts +++ b/src/funcs/plexGetGeoData.ts @@ -28,7 +28,7 @@ import { Result } from "../sdk/types/fp.js"; */ export async function plexGetGeoData( client: PlexAPICore, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetGeoDataResponse, @@ -55,7 +55,14 @@ export async function plexGetGeoData( const context = { operationID: "getGeoData", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; const requestRes = client._createRequest(context, { @@ -73,9 +80,8 @@ export async function plexGetGeoData( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetHomeData.ts b/src/funcs/plexGetHomeData.ts index 3a48f058..0c73657a 100644 --- a/src/funcs/plexGetHomeData.ts +++ b/src/funcs/plexGetHomeData.ts @@ -51,16 +51,25 @@ export async function plexGetHomeData( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getHomeData", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function plexGetHomeData( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetPin.ts b/src/funcs/plexGetPin.ts index e2ed90d3..aac4b2d7 100644 --- a/src/funcs/plexGetPin.ts +++ b/src/funcs/plexGetPin.ts @@ -31,7 +31,7 @@ import { Result } from "../sdk/types/fp.js"; export async function plexGetPin( client: PlexAPICore, request: operations.GetPinRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetPinResponse, @@ -45,10 +45,8 @@ export async function plexGetPin( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetPinRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -90,37 +88,19 @@ export async function plexGetPin( explode: false, charEncoding: "none", }), - "X-Plex-Client-Identifier": encodeSimple( - "X-Plex-Client-Identifier", - client._options.clientID, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Device": encodeSimple( - "X-Plex-Device", - client._options.deviceNickname, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Platform": encodeSimple( - "X-Plex-Platform", - client._options.platform, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Product": encodeSimple( - "X-Plex-Product", - client._options.clientName, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Version": encodeSimple( - "X-Plex-Version", - client._options.clientVersion, - { explode: false, charEncoding: "none" }, - ), }); const context = { operationID: "getPin", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; const requestRes = client._createRequest(context, { @@ -140,9 +120,8 @@ export async function plexGetPin( const doResult = await client._do(req, { context, errorCodes: ["400", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetServerResources.ts b/src/funcs/plexGetServerResources.ts index 600cfe7a..f303978e 100644 --- a/src/funcs/plexGetServerResources.ts +++ b/src/funcs/plexGetServerResources.ts @@ -31,11 +31,11 @@ import { Result } from "../sdk/types/fp.js"; */ export async function plexGetServerResources( client: PlexAPICore, + clientID: string, includeHttps?: operations.IncludeHttps | undefined, includeRelay?: operations.IncludeRelay | undefined, includeIPv6?: operations.IncludeIPv6 | undefined, - clientID?: string | undefined, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetServerResourcesResponse, @@ -51,10 +51,10 @@ export async function plexGetServerResources( > > { const input: operations.GetServerResourcesRequest = { + clientID: clientID, includeHttps: includeHttps, includeRelay: includeRelay, includeIPv6: includeIPv6, - clientID: clientID, }; const parsed = safeParse( @@ -88,21 +88,24 @@ export async function plexGetServerResources( payload.ClientID, { explode: false, charEncoding: "none" }, ), - "X-Plex-Client-Identifier": encodeSimple( - "X-Plex-Client-Identifier", - client._options.clientID, - { explode: false, charEncoding: "none" }, - ), }); const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-server-resources", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, @@ -122,9 +125,8 @@ export async function plexGetServerResources( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetTokenByPinId.ts b/src/funcs/plexGetTokenByPinId.ts index 444b0cdd..0ef3531a 100644 --- a/src/funcs/plexGetTokenByPinId.ts +++ b/src/funcs/plexGetTokenByPinId.ts @@ -31,7 +31,7 @@ import { Result } from "../sdk/types/fp.js"; export async function plexGetTokenByPinId( client: PlexAPICore, request: operations.GetTokenByPinIdRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetTokenByPinIdResponse, @@ -46,10 +46,8 @@ export async function plexGetTokenByPinId( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetTokenByPinIdRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -94,37 +92,19 @@ export async function plexGetTokenByPinId( explode: false, charEncoding: "none", }), - "X-Plex-Client-Identifier": encodeSimple( - "X-Plex-Client-Identifier", - client._options.clientID, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Device": encodeSimple( - "X-Plex-Device", - client._options.deviceNickname, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Platform": encodeSimple( - "X-Plex-Platform", - client._options.platform, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Product": encodeSimple( - "X-Plex-Product", - client._options.clientName, - { explode: false, charEncoding: "none" }, - ), - "X-Plex-Version": encodeSimple( - "X-Plex-Version", - client._options.clientVersion, - { explode: false, charEncoding: "none" }, - ), }); const context = { operationID: "getTokenByPinId", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; const requestRes = client._createRequest(context, { @@ -143,9 +123,8 @@ export async function plexGetTokenByPinId( const doResult = await client._do(req, { context, errorCodes: ["400", "404", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/plexGetUserFriends.ts b/src/funcs/plexGetUserFriends.ts index 5bd0de90..736ac707 100644 --- a/src/funcs/plexGetUserFriends.ts +++ b/src/funcs/plexGetUserFriends.ts @@ -29,7 +29,7 @@ import { Result } from "../sdk/types/fp.js"; */ export async function plexGetUserFriends( client: PlexAPICore, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetUserFriendsResponse, @@ -55,12 +55,20 @@ export async function plexGetUserFriends( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getUserFriends", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, @@ -78,9 +86,8 @@ export async function plexGetUserFriends( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/searchGetSearchResults.ts b/src/funcs/searchGetSearchResults.ts index 31322401..f0cc144f 100644 --- a/src/funcs/searchGetSearchResults.ts +++ b/src/funcs/searchGetSearchResults.ts @@ -73,16 +73,25 @@ export async function searchGetSearchResults( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getSearchResults", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query$, @@ -97,9 +106,8 @@ export async function searchGetSearchResults( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/searchPerformSearch.ts b/src/funcs/searchPerformSearch.ts index 056ded1b..e950d014 100644 --- a/src/funcs/searchPerformSearch.ts +++ b/src/funcs/searchPerformSearch.ts @@ -90,16 +90,25 @@ export async function searchPerformSearch( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "performSearch", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query$, @@ -114,9 +123,8 @@ export async function searchPerformSearch( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/searchPerformVoiceSearch.ts b/src/funcs/searchPerformVoiceSearch.ts index 560cc066..8dccba0f 100644 --- a/src/funcs/searchPerformVoiceSearch.ts +++ b/src/funcs/searchPerformVoiceSearch.ts @@ -82,16 +82,25 @@ export async function searchPerformVoiceSearch( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "performVoiceSearch", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query$, @@ -106,9 +115,8 @@ export async function searchPerformVoiceSearch( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetAvailableClients.ts b/src/funcs/serverGetAvailableClients.ts index e443eaf2..1554f1b1 100644 --- a/src/funcs/serverGetAvailableClients.ts +++ b/src/funcs/serverGetAvailableClients.ts @@ -51,16 +51,25 @@ export async function serverGetAvailableClients( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getAvailableClients", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function serverGetAvailableClients( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetDevices.ts b/src/funcs/serverGetDevices.ts index b5822b0f..97204539 100644 --- a/src/funcs/serverGetDevices.ts +++ b/src/funcs/serverGetDevices.ts @@ -51,16 +51,25 @@ export async function serverGetDevices( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getDevices", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function serverGetDevices( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetMediaProviders.ts b/src/funcs/serverGetMediaProviders.ts index f81203f0..8cf89542 100644 --- a/src/funcs/serverGetMediaProviders.ts +++ b/src/funcs/serverGetMediaProviders.ts @@ -73,16 +73,25 @@ export async function serverGetMediaProviders( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-media-providers", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -96,9 +105,8 @@ export async function serverGetMediaProviders( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetMyPlexAccount.ts b/src/funcs/serverGetMyPlexAccount.ts index 4c437869..70cba887 100644 --- a/src/funcs/serverGetMyPlexAccount.ts +++ b/src/funcs/serverGetMyPlexAccount.ts @@ -51,16 +51,25 @@ export async function serverGetMyPlexAccount( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getMyPlexAccount", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function serverGetMyPlexAccount( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetResizedPhoto.ts b/src/funcs/serverGetResizedPhoto.ts index b81c8a65..f177d044 100644 --- a/src/funcs/serverGetResizedPhoto.ts +++ b/src/funcs/serverGetResizedPhoto.ts @@ -46,10 +46,8 @@ export async function serverGetResizedPhoto( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetResizedPhotoRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -77,16 +75,25 @@ export async function serverGetResizedPhoto( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getResizedPhoto", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -101,9 +108,8 @@ export async function serverGetResizedPhoto( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetServerCapabilities.ts b/src/funcs/serverGetServerCapabilities.ts index 753c572d..6b4be77e 100644 --- a/src/funcs/serverGetServerCapabilities.ts +++ b/src/funcs/serverGetServerCapabilities.ts @@ -51,16 +51,25 @@ export async function serverGetServerCapabilities( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getServerCapabilities", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function serverGetServerCapabilities( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetServerIdentity.ts b/src/funcs/serverGetServerIdentity.ts index 9da0e0e5..6cf6a119 100644 --- a/src/funcs/serverGetServerIdentity.ts +++ b/src/funcs/serverGetServerIdentity.ts @@ -50,11 +50,19 @@ export async function serverGetServerIdentity( const context = { operationID: "get-server-identity", oAuth2Scopes: [], + + resolvedSecurity: null, + securitySource: null, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; const requestRes = client._createRequest(context, { method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -67,9 +75,8 @@ export async function serverGetServerIdentity( const doResult = await client._do(req, { context, errorCodes: ["408", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetServerList.ts b/src/funcs/serverGetServerList.ts index 806cb23e..5b194638 100644 --- a/src/funcs/serverGetServerList.ts +++ b/src/funcs/serverGetServerList.ts @@ -51,16 +51,25 @@ export async function serverGetServerList( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getServerList", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function serverGetServerList( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/serverGetServerPreferences.ts b/src/funcs/serverGetServerPreferences.ts index 8e1dfc32..a0fd1009 100644 --- a/src/funcs/serverGetServerPreferences.ts +++ b/src/funcs/serverGetServerPreferences.ts @@ -51,16 +51,25 @@ export async function serverGetServerPreferences( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getServerPreferences", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function serverGetServerPreferences( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/sessionsGetSessionHistory.ts b/src/funcs/sessionsGetSessionHistory.ts index 849499df..1611e748 100644 --- a/src/funcs/sessionsGetSessionHistory.ts +++ b/src/funcs/sessionsGetSessionHistory.ts @@ -82,16 +82,25 @@ export async function sessionsGetSessionHistory( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getSessionHistory", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -106,9 +115,8 @@ export async function sessionsGetSessionHistory( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/sessionsGetSessions.ts b/src/funcs/sessionsGetSessions.ts index f61c4f81..a40e5f1e 100644 --- a/src/funcs/sessionsGetSessions.ts +++ b/src/funcs/sessionsGetSessions.ts @@ -51,16 +51,25 @@ export async function sessionsGetSessions( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getSessions", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function sessionsGetSessions( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/sessionsGetTranscodeSessions.ts b/src/funcs/sessionsGetTranscodeSessions.ts index 61622569..45ba23cb 100644 --- a/src/funcs/sessionsGetTranscodeSessions.ts +++ b/src/funcs/sessionsGetTranscodeSessions.ts @@ -51,16 +51,25 @@ export async function sessionsGetTranscodeSessions( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getTranscodeSessions", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function sessionsGetTranscodeSessions( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/sessionsStopTranscodeSession.ts b/src/funcs/sessionsStopTranscodeSession.ts index 8dfb9bd4..c0963f8a 100644 --- a/src/funcs/sessionsStopTranscodeSession.ts +++ b/src/funcs/sessionsStopTranscodeSession.ts @@ -77,16 +77,25 @@ export async function sessionsStopTranscodeSession( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "stopTranscodeSession", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "DELETE", + baseURL: options?.serverURL, path: path, headers: headers, body: body, @@ -100,9 +109,8 @@ export async function sessionsStopTranscodeSession( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/statisticsGetBandwidthStatistics.ts b/src/funcs/statisticsGetBandwidthStatistics.ts index fbddca01..ff473b4f 100644 --- a/src/funcs/statisticsGetBandwidthStatistics.ts +++ b/src/funcs/statisticsGetBandwidthStatistics.ts @@ -74,16 +74,25 @@ export async function statisticsGetBandwidthStatistics( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getBandwidthStatistics", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -98,9 +107,8 @@ export async function statisticsGetBandwidthStatistics( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/statisticsGetResourcesStatistics.ts b/src/funcs/statisticsGetResourcesStatistics.ts index befc1475..158900ca 100644 --- a/src/funcs/statisticsGetResourcesStatistics.ts +++ b/src/funcs/statisticsGetResourcesStatistics.ts @@ -74,16 +74,25 @@ export async function statisticsGetResourcesStatistics( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getResourcesStatistics", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -98,9 +107,8 @@ export async function statisticsGetResourcesStatistics( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/statisticsGetStatistics.ts b/src/funcs/statisticsGetStatistics.ts index 2a42cd82..56e0e19e 100644 --- a/src/funcs/statisticsGetStatistics.ts +++ b/src/funcs/statisticsGetStatistics.ts @@ -73,16 +73,25 @@ export async function statisticsGetStatistics( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getStatistics", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -97,9 +106,8 @@ export async function statisticsGetStatistics( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/updaterApplyUpdates.ts b/src/funcs/updaterApplyUpdates.ts index 4de1c189..8ab30ea5 100644 --- a/src/funcs/updaterApplyUpdates.ts +++ b/src/funcs/updaterApplyUpdates.ts @@ -76,16 +76,25 @@ export async function updaterApplyUpdates( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "applyUpdates", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "PUT", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -100,9 +109,8 @@ export async function updaterApplyUpdates( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "500", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/updaterCheckForUpdates.ts b/src/funcs/updaterCheckForUpdates.ts index ee3aa0ec..9a8bbb98 100644 --- a/src/funcs/updaterCheckForUpdates.ts +++ b/src/funcs/updaterCheckForUpdates.ts @@ -73,16 +73,25 @@ export async function updaterCheckForUpdates( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "checkForUpdates", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "PUT", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -97,9 +106,8 @@ export async function updaterCheckForUpdates( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/updaterGetUpdateStatus.ts b/src/funcs/updaterGetUpdateStatus.ts index 59aab923..379058b7 100644 --- a/src/funcs/updaterGetUpdateStatus.ts +++ b/src/funcs/updaterGetUpdateStatus.ts @@ -51,16 +51,25 @@ export async function updaterGetUpdateStatus( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getUpdateStatus", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, @@ -73,9 +82,8 @@ export async function updaterGetUpdateStatus( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/videoGetTimeline.ts b/src/funcs/videoGetTimeline.ts index 5ba0795d..06202d3e 100644 --- a/src/funcs/videoGetTimeline.ts +++ b/src/funcs/videoGetTimeline.ts @@ -46,10 +46,8 @@ export async function videoGetTimeline( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetTimelineRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -80,16 +78,25 @@ export async function videoGetTimeline( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "getTimeline", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -104,9 +111,8 @@ export async function videoGetTimeline( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/videoStartUniversalTranscode.ts b/src/funcs/videoStartUniversalTranscode.ts index 16750cd7..42061669 100644 --- a/src/funcs/videoStartUniversalTranscode.ts +++ b/src/funcs/videoStartUniversalTranscode.ts @@ -46,10 +46,8 @@ export async function videoStartUniversalTranscode( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.StartUniversalTranscodeRequest$outboundSchema.parse(value), "Input validation failed", @@ -87,16 +85,25 @@ export async function videoStartUniversalTranscode( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "startUniversalTranscode", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, method: "GET", + baseURL: options?.serverURL, path: path, headers: headers, query: query, @@ -111,9 +118,8 @@ export async function videoStartUniversalTranscode( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/funcs/watchlistGetWatchList.ts b/src/funcs/watchlistGetWatchList.ts index d482943a..6e454a97 100644 --- a/src/funcs/watchlistGetWatchList.ts +++ b/src/funcs/watchlistGetWatchList.ts @@ -32,7 +32,7 @@ import { Result } from "../sdk/types/fp.js"; export async function watchlistGetWatchList( client: PlexAPICore, request: operations.GetWatchListRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise< Result< operations.GetWatchListResponse, @@ -47,10 +47,8 @@ export async function watchlistGetWatchList( | ConnectionError > > { - const input = request; - const parsed = safeParse( - input, + request, (value) => operations.GetWatchListRequest$outboundSchema.parse(value), "Input validation failed", ); @@ -92,12 +90,20 @@ export async function watchlistGetWatchList( const secConfig = await extractSecurity(client._options.accessToken); const securityInput = secConfig == null ? {} : { accessToken: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + const context = { operationID: "get-watch-list", oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + securitySource: client._options.accessToken, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], }; - const requestSecurity = resolveGlobalSecurity(securityInput); const requestRes = client._createRequest(context, { security: requestSecurity, @@ -117,9 +123,8 @@ export async function watchlistGetWatchList( const doResult = await client._do(req, { context, errorCodes: ["400", "401", "4XX", "5XX"], - retryConfig: options?.retries - || client._options.retryConfig, - retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, }); if (!doResult.ok) { return doResult; diff --git a/src/hooks/hooks.ts b/src/hooks/hooks.ts index d1b3396f..d34c8849 100644 --- a/src/hooks/hooks.ts +++ b/src/hooks/hooks.ts @@ -12,6 +12,7 @@ import { BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, @@ -27,6 +28,25 @@ export class SDKHooks implements Hooks { afterErrorHooks: AfterErrorHook[] = []; constructor() { + const presetHooks: Array = []; + + for (const hook of presetHooks) { + if ("sdkInit" in hook) { + this.registerSDKInitHook(hook); + } + if ("beforeCreateRequest" in hook) { + this.registerBeforeCreateRequestHook(hook); + } + if ("beforeRequest" in hook) { + this.registerBeforeRequestHook(hook); + } + if ("afterSuccess" in hook) { + this.registerAfterSuccessHook(hook); + } + if ("afterError" in hook) { + this.registerAfterErrorHook(hook); + } + } initHooks(this); } diff --git a/src/hooks/types.ts b/src/hooks/types.ts index 656b9e37..8a27c659 100644 --- a/src/hooks/types.ts +++ b/src/hooks/types.ts @@ -3,11 +3,15 @@ */ import { HTTPClient, RequestInput } from "../lib/http.js"; +import { RetryConfig } from "../lib/retries.js"; +import { SecurityState } from "../lib/security.js"; export type HookContext = { operationID: string; oAuth2Scopes?: string[]; securitySource?: any | (() => Promise); + retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; }; export type Awaitable = T | Promise; @@ -96,3 +100,10 @@ export interface Hooks { /** Registers a hook to be used by the SDK for the after error event. */ registerAfterErrorHook(hook: AfterErrorHook): void; } + +export type Hook = + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/src/lib/config.ts b/src/lib/config.ts index 2ab36b60..7b4badeb 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -33,31 +33,6 @@ export type ServerProtocol = ClosedEnum; export type SDKOptions = { accessToken?: string | (() => Promise); - /** - * Allows setting the clientID parameter for all supported operations - */ - clientID?: string | undefined; - - /** - * Allows setting the clientName parameter for all supported operations - */ - clientName?: string | undefined; - - /** - * Allows setting the clientVersion parameter for all supported operations - */ - clientVersion?: string | undefined; - - /** - * Allows setting the platform parameter for all supported operations - */ - platform?: string | undefined; - - /** - * Allows setting the deviceNickname parameter for all supported operations - */ - deviceNickname?: string | undefined; - httpClient?: HTTPClient; /** * Allows overriding the default server used by the SDK @@ -115,7 +90,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.3", - sdkVersion: "0.31.1", - genVersion: "2.428.1", - userAgent: "speakeasy-sdk/typescript 0.31.1 2.428.1 0.0.3 @lukehagar/plexjs", + sdkVersion: "0.32.0", + genVersion: "2.481.0", + userAgent: "speakeasy-sdk/typescript 0.32.0 2.481.0 0.0.3 @lukehagar/plexjs", } as const; diff --git a/src/lib/matchers.ts b/src/lib/matchers.ts index 1ff641e4..c538ea27 100644 --- a/src/lib/matchers.ts +++ b/src/lib/matchers.ts @@ -205,7 +205,7 @@ export function match( raw = await response.json(); break; case "bytes": - raw = await response.arrayBuffer(); + raw = new Uint8Array(await response.arrayBuffer()); break; case "stream": raw = response.body; diff --git a/src/lib/primitives.ts b/src/lib/primitives.ts index 23794a2b..1dc4ee43 100644 --- a/src/lib/primitives.ts +++ b/src/lib/primitives.ts @@ -2,6 +2,26 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ +class InvariantError extends Error { + constructor(message: string) { + super(message); + this.name = "InvariantError"; + } +} + +export function invariant( + condition: unknown, + message: string, +): asserts condition { + if (!condition) { + throw new InvariantError(message); + } +} + +export type ExactPartial = { + [P in keyof T]?: T[P] | undefined; +}; + export type Remap = { [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ ? Mapping[k] @@ -38,3 +58,65 @@ export function remap< return out; } + +export function combineSignals( + ...signals: Array +): AbortSignal | null { + const filtered: AbortSignal[] = []; + for (const signal of signals) { + if (signal) { + filtered.push(signal); + } + } + + switch (filtered.length) { + case 0: + case 1: + return filtered[0] || null; + default: + if ("any" in AbortSignal && typeof AbortSignal.any === "function") { + return AbortSignal.any(filtered); + } + return abortSignalAny(filtered); + } +} + +export function abortSignalAny(signals: AbortSignal[]): AbortSignal { + const controller = new AbortController(); + const result = controller.signal; + if (!signals.length) { + return controller.signal; + } + + if (signals.length === 1) { + return signals[0] || controller.signal; + } + + for (const signal of signals) { + if (signal.aborted) { + return signal; + } + } + + function abort(this: AbortSignal) { + controller.abort(this.reason); + clean(); + } + + const signalRefs: WeakRef[] = []; + function clean() { + for (const signalRef of signalRefs) { + const signal = signalRef.deref(); + if (signal) { + signal.removeEventListener("abort", abort); + } + } + } + + for (const signal of signals) { + signalRefs.push(new WeakRef(signal)); + signal.addEventListener("abort", abort); + } + + return result; +} diff --git a/src/lib/retries.ts b/src/lib/retries.ts index df3e0bc2..93ebc8de 100644 --- a/src/lib/retries.ts +++ b/src/lib/retries.ts @@ -26,23 +26,44 @@ export type RetryConfig = retryConnectionErrors?: boolean; }; -class PermanentError extends Error { - inner: unknown; +/** + * PermanentError is an error that is not recoverable. Throwing this error will + * cause a retry loop to terminate. + */ +export class PermanentError extends Error { + /** The underlying cause of the error. */ + override readonly cause: unknown; - constructor(inner: unknown) { - super("Permanent error"); - this.inner = inner; + constructor(message: string, options?: { cause?: unknown }) { + let msg = message; + if (options?.cause) { + msg += `: ${options.cause}`; + } + + super(msg, options); + this.name = "PermanentError"; + // In older runtimes, the cause field would not have been assigned through + // the super() call. + if (typeof this.cause === "undefined") { + this.cause = options?.cause; + } Object.setPrototypeOf(this, PermanentError.prototype); } } -class TemporaryError extends Error { - res: Response; +/** + * TemporaryError is an error is used to signal that an HTTP request can be + * retried as part of a retry loop. If retry attempts are exhausted and this + * error is thrown, the response will be returned to the caller. + */ +export class TemporaryError extends Error { + response: Response; - constructor(res: Response) { - super("Temporary error"); - this.res = res; + constructor(message: string, response: Response) { + super(message); + this.response = response; + this.name = "TemporaryError"; Object.setPrototypeOf(this, TemporaryError.prototype); } @@ -80,11 +101,14 @@ function wrapFetcher( try { const res = await fn(); if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError(res); + throw new TemporaryError( + "Response failed with retryable status code", + res, + ); } return res; - } catch (err) { + } catch (err: unknown) { if (err instanceof TemporaryError) { throw err; } @@ -96,7 +120,7 @@ function wrapFetcher( throw err; } - throw new PermanentError(err); + throw new PermanentError("Permanent error", { cause: err }); } }; } @@ -139,37 +163,25 @@ async function retryBackoff( try { const res = await fn(); return res; - } catch (err) { + } catch (err: unknown) { if (err instanceof PermanentError) { - throw err.inner; + throw err.cause; } const elapsed = Date.now() - start; if (elapsed > maxElapsedTime) { if (err instanceof TemporaryError) { - return err.res; + return err.response; } throw err; } let retryInterval = 0; - if (err instanceof TemporaryError && err.res && err.res.headers) { - const retryVal = err.res.headers.get("retry-after") || ""; - if (retryVal != "") { - const parsedNumber = Number(retryVal); - if (!isNaN(parsedNumber) && Number.isInteger(parsedNumber)) { - retryInterval = parsedNumber * 1000; - } else { - const parsedDate = Date.parse(retryVal); - if (!isNaN(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - retryInterval = deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - } - } + if (err instanceof TemporaryError) { + retryInterval = retryIntervalFromResponse(err.response); } - if (retryInterval == 0) { + if (retryInterval <= 0) { retryInterval = initialInterval * Math.pow(x, exponent) + Math.random() * 1000; } @@ -182,6 +194,26 @@ async function retryBackoff( } } +function retryIntervalFromResponse(res: Response): number { + const retryVal = res.headers.get("retry-after") || ""; + if (!retryVal) { + return 0; + } + + const parsedNumber = Number(retryVal); + if (Number.isInteger(parsedNumber)) { + return parsedNumber * 1000; + } + + const parsedDate = Date.parse(retryVal); + if (Number.isInteger(parsedDate)) { + const deltaMS = parsedDate - Date.now(); + return deltaMS > 0 ? Math.ceil(deltaMS) : 0; + } + + return 0; +} + async function delay(delay: number): Promise { return new Promise((resolve) => setTimeout(resolve, delay)); } diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index bfbe7a5b..fbcfff59 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -41,6 +41,10 @@ export type RequestOptions = { * Specifies the status codes which should be retried using the given retry policy. */ retryCodes?: string[]; + /** + * Overrides the base server URL that will be used by an operation. + */ + serverURL?: string | URL; /** * Sets various request options on the `fetch` call made by an SDK method. * @@ -52,7 +56,7 @@ export type RequestOptions = { type RequestConfig = { method: string; path: string; - baseURL?: string | URL; + baseURL?: string | URL | undefined; query?: string; body?: RequestInit["body"]; headers?: HeadersInit; @@ -119,6 +123,7 @@ export class ClientSDK { const inputURL = new URL(path, reqURL); if (path) { + reqURL.pathname += reqURL.pathname.endsWith("/") ? "" : "/"; reqURL.pathname += inputURL.pathname.replace(/^\/+/, ""); } @@ -220,8 +225,8 @@ export class ClientSDK { options: { context: HookContext; errorCodes: number | string | (number | string)[]; - retryConfig?: RetryConfig | undefined; - retryCodes?: string[] | undefined; + retryConfig: RetryConfig; + retryCodes: string[]; }, ): Promise< Result< @@ -233,8 +238,6 @@ export class ClientSDK { > > { const { context, errorCodes } = options; - const retryConfig = options.retryConfig || { strategy: "none" }; - const retryCodes = options.retryCodes || []; return retry( async () => { @@ -245,22 +248,28 @@ export class ClientSDK { let response = await this.#httpClient.request(req); - if (matchStatusCode(response, errorCodes)) { - const result = await this.#hooks.afterError(context, response, null); - if (result.error) { - throw result.error; + try { + if (matchStatusCode(response, errorCodes)) { + const result = await this.#hooks.afterError( + context, + response, + null, + ); + if (result.error) { + throw result.error; + } + response = result.response || response; + } else { + response = await this.#hooks.afterSuccess(context, response); } - response = result.response || response; - } else { - response = await this.#hooks.afterSuccess(context, response); + } finally { + await logResponse(this.#logger, response, req) + .catch(e => this.#logger?.log("Failed to log response:", e)); } - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - return response; }, - { config: retryConfig, statusCodes: retryCodes }, + { config: options.retryConfig, statusCodes: options.retryCodes }, ).then( (r) => OK(r), (err) => { diff --git a/src/lib/security.ts b/src/lib/security.ts index 08c566f4..62ccd157 100644 --- a/src/lib/security.ts +++ b/src/lib/security.ts @@ -4,6 +4,14 @@ import * as shared from "../sdk/models/shared/index.js"; +type OAuth2PasswordFlow = { + username: string; + password?: string | undefined; + clientID: string; + clientSecret?: string | undefined; + tokenURL: string; +}; + export enum SecurityErrorCode { Incomplete = "incomplete", UnrecognisedSecurityType = "unrecognized_security_type", @@ -37,6 +45,7 @@ export type SecurityState = { headers: Record; queryParams: Record; cookies: Record; + oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; }; type SecurityInputBasic = { @@ -73,7 +82,18 @@ type SecurityInputOAuth2 = { type SecurityInputOAuth2ClientCredentials = { type: "oauth2:client_credentials"; - value: string | null | undefined; + value: + | { clientID?: string | undefined; clientSecret?: string | undefined } + | null + | undefined; +}; + +type SecurityInputOAuth2PasswordCredentials = { + type: "oauth2:password"; + value: + | string + | null + | undefined; fieldName: string; }; @@ -89,6 +109,7 @@ export type SecurityInput = | SecurityInputAPIKey | SecurityInputOAuth2 | SecurityInputOAuth2ClientCredentials + | SecurityInputOAuth2PasswordCredentials | SecurityInputOIDC | SecurityInputCustom; @@ -100,6 +121,7 @@ export function resolveSecurity( headers: {}, queryParams: {}, cookies: {}, + oauth2: { type: "none" }, }; const option = options.find((opts) => { @@ -110,6 +132,12 @@ export function resolveSecurity( return o.value.username != null || o.value.password != null; } else if (o.type === "http:custom") { return null; + } else if (o.type === "oauth2:password") { + return ( + typeof o.value === "string" && !!o.value + ); + } else if (o.type === "oauth2:client_credentials") { + return o.value.clientID != null || o.value.clientSecret != null; } else if (typeof o.value === "string") { return !!o.value; } else { @@ -152,6 +180,9 @@ export function resolveSecurity( case "oauth2": applyBearer(state, spec); break; + case "oauth2:password": + applyBearer(state, spec); + break; case "oauth2:client_credentials": break; case "openIdConnect": @@ -179,9 +210,13 @@ function applyBasic( function applyBearer( state: SecurityState, - spec: SecurityInputBearer | SecurityInputOAuth2 | SecurityInputOIDC, + spec: + | SecurityInputBearer + | SecurityInputOAuth2 + | SecurityInputOIDC + | SecurityInputOAuth2PasswordCredentials, ) { - if (spec.value == null) { + if (typeof spec.value !== "string" || !spec.value) { return; } @@ -192,6 +227,7 @@ function applyBearer( state.headers[spec.fieldName] = value; } + export function resolveGlobalSecurity( security: Partial | null | undefined, ): SecurityState | null { diff --git a/src/sdk/authentication.ts b/src/sdk/authentication.ts index 017cd528..22c45abf 100644 --- a/src/sdk/authentication.ts +++ b/src/sdk/authentication.ts @@ -55,7 +55,7 @@ export class Authentication extends ClientSDK { * Get the User data from the provided X-Plex-Token */ async getTokenDetails( - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(authenticationGetTokenDetails( this, @@ -71,7 +71,7 @@ export class Authentication extends ClientSDK { */ async postUsersSignInData( request: operations.PostUsersSignInDataRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(authenticationPostUsersSignInData( this, diff --git a/src/sdk/library.ts b/src/sdk/library.ts index 63c4e501..8af67152 100644 --- a/src/sdk/library.ts +++ b/src/sdk/library.ts @@ -174,6 +174,7 @@ export class Library extends ClientSDK { * - `resolution`: Items categorized by resolution. * - `firstCharacter`: Items categorized by the first letter. * - `folder`: Items categorized by folder. + * - `albums`: Items categorized by album. */ async getLibraryItems( request: operations.GetLibraryItemsRequest, diff --git a/src/sdk/models/errors/addplaylistcontents.ts b/src/sdk/models/errors/addplaylistcontents.ts index fd7f9949..803f37dd 100644 --- a/src/sdk/models/errors/addplaylistcontents.ts +++ b/src/sdk/models/errors/addplaylistcontents.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type AddPlaylistContentsPlaylistsErrors = { code?: number | undefined; @@ -136,6 +139,27 @@ export namespace AddPlaylistContentsPlaylistsErrors$ { export type Outbound = AddPlaylistContentsPlaylistsErrors$Outbound; } +export function addPlaylistContentsPlaylistsErrorsToJSON( + addPlaylistContentsPlaylistsErrors: AddPlaylistContentsPlaylistsErrors, +): string { + return JSON.stringify( + AddPlaylistContentsPlaylistsErrors$outboundSchema.parse( + addPlaylistContentsPlaylistsErrors, + ), + ); +} + +export function addPlaylistContentsPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + AddPlaylistContentsPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const AddPlaylistContentsUnauthorized$inboundSchema: z.ZodType< AddPlaylistContentsUnauthorized, @@ -238,6 +262,24 @@ export namespace AddPlaylistContentsErrors$ { export type Outbound = AddPlaylistContentsErrors$Outbound; } +export function addPlaylistContentsErrorsToJSON( + addPlaylistContentsErrors: AddPlaylistContentsErrors, +): string { + return JSON.stringify( + AddPlaylistContentsErrors$outboundSchema.parse(addPlaylistContentsErrors), + ); +} + +export function addPlaylistContentsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddPlaylistContentsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsErrors' from JSON`, + ); +} + /** @internal */ export const AddPlaylistContentsBadRequest$inboundSchema: z.ZodType< AddPlaylistContentsBadRequest, diff --git a/src/sdk/models/errors/applyupdates.ts b/src/sdk/models/errors/applyupdates.ts index 573b1c52..5133bb85 100644 --- a/src/sdk/models/errors/applyupdates.ts +++ b/src/sdk/models/errors/applyupdates.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type ApplyUpdatesUpdaterErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace ApplyUpdatesUpdaterErrors$ { export type Outbound = ApplyUpdatesUpdaterErrors$Outbound; } +export function applyUpdatesUpdaterErrorsToJSON( + applyUpdatesUpdaterErrors: ApplyUpdatesUpdaterErrors, +): string { + return JSON.stringify( + ApplyUpdatesUpdaterErrors$outboundSchema.parse(applyUpdatesUpdaterErrors), + ); +} + +export function applyUpdatesUpdaterErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ApplyUpdatesUpdaterErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ApplyUpdatesUpdaterErrors' from JSON`, + ); +} + /** @internal */ export const ApplyUpdatesUnauthorized$inboundSchema: z.ZodType< ApplyUpdatesUnauthorized, @@ -235,6 +256,24 @@ export namespace ApplyUpdatesErrors$ { export type Outbound = ApplyUpdatesErrors$Outbound; } +export function applyUpdatesErrorsToJSON( + applyUpdatesErrors: ApplyUpdatesErrors, +): string { + return JSON.stringify( + ApplyUpdatesErrors$outboundSchema.parse(applyUpdatesErrors), + ); +} + +export function applyUpdatesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ApplyUpdatesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ApplyUpdatesErrors' from JSON`, + ); +} + /** @internal */ export const ApplyUpdatesBadRequest$inboundSchema: z.ZodType< ApplyUpdatesBadRequest, diff --git a/src/sdk/models/errors/cancelserveractivities.ts b/src/sdk/models/errors/cancelserveractivities.ts index 9c238bcb..c22d1694 100644 --- a/src/sdk/models/errors/cancelserveractivities.ts +++ b/src/sdk/models/errors/cancelserveractivities.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type CancelServerActivitiesActivitiesErrors = { code?: number | undefined; @@ -137,6 +140,28 @@ export namespace CancelServerActivitiesActivitiesErrors$ { export type Outbound = CancelServerActivitiesActivitiesErrors$Outbound; } +export function cancelServerActivitiesActivitiesErrorsToJSON( + cancelServerActivitiesActivitiesErrors: + CancelServerActivitiesActivitiesErrors, +): string { + return JSON.stringify( + CancelServerActivitiesActivitiesErrors$outboundSchema.parse( + cancelServerActivitiesActivitiesErrors, + ), + ); +} + +export function cancelServerActivitiesActivitiesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + CancelServerActivitiesActivitiesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CancelServerActivitiesActivitiesErrors' from JSON`, + ); +} + /** @internal */ export const CancelServerActivitiesUnauthorized$inboundSchema: z.ZodType< CancelServerActivitiesUnauthorized, @@ -240,6 +265,26 @@ export namespace CancelServerActivitiesErrors$ { export type Outbound = CancelServerActivitiesErrors$Outbound; } +export function cancelServerActivitiesErrorsToJSON( + cancelServerActivitiesErrors: CancelServerActivitiesErrors, +): string { + return JSON.stringify( + CancelServerActivitiesErrors$outboundSchema.parse( + cancelServerActivitiesErrors, + ), + ); +} + +export function cancelServerActivitiesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CancelServerActivitiesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CancelServerActivitiesErrors' from JSON`, + ); +} + /** @internal */ export const CancelServerActivitiesBadRequest$inboundSchema: z.ZodType< CancelServerActivitiesBadRequest, diff --git a/src/sdk/models/errors/checkforupdates.ts b/src/sdk/models/errors/checkforupdates.ts index 9e743dc6..02f9eeb4 100644 --- a/src/sdk/models/errors/checkforupdates.ts +++ b/src/sdk/models/errors/checkforupdates.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type CheckForUpdatesUpdaterErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace CheckForUpdatesUpdaterErrors$ { export type Outbound = CheckForUpdatesUpdaterErrors$Outbound; } +export function checkForUpdatesUpdaterErrorsToJSON( + checkForUpdatesUpdaterErrors: CheckForUpdatesUpdaterErrors, +): string { + return JSON.stringify( + CheckForUpdatesUpdaterErrors$outboundSchema.parse( + checkForUpdatesUpdaterErrors, + ), + ); +} + +export function checkForUpdatesUpdaterErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CheckForUpdatesUpdaterErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CheckForUpdatesUpdaterErrors' from JSON`, + ); +} + /** @internal */ export const CheckForUpdatesUnauthorized$inboundSchema: z.ZodType< CheckForUpdatesUnauthorized, @@ -235,6 +258,24 @@ export namespace CheckForUpdatesErrors$ { export type Outbound = CheckForUpdatesErrors$Outbound; } +export function checkForUpdatesErrorsToJSON( + checkForUpdatesErrors: CheckForUpdatesErrors, +): string { + return JSON.stringify( + CheckForUpdatesErrors$outboundSchema.parse(checkForUpdatesErrors), + ); +} + +export function checkForUpdatesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CheckForUpdatesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CheckForUpdatesErrors' from JSON`, + ); +} + /** @internal */ export const CheckForUpdatesBadRequest$inboundSchema: z.ZodType< CheckForUpdatesBadRequest, diff --git a/src/sdk/models/errors/clearplaylistcontents.ts b/src/sdk/models/errors/clearplaylistcontents.ts index 1d18924d..a59997c4 100644 --- a/src/sdk/models/errors/clearplaylistcontents.ts +++ b/src/sdk/models/errors/clearplaylistcontents.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type ClearPlaylistContentsPlaylistsErrors = { code?: number | undefined; @@ -137,6 +140,27 @@ export namespace ClearPlaylistContentsPlaylistsErrors$ { export type Outbound = ClearPlaylistContentsPlaylistsErrors$Outbound; } +export function clearPlaylistContentsPlaylistsErrorsToJSON( + clearPlaylistContentsPlaylistsErrors: ClearPlaylistContentsPlaylistsErrors, +): string { + return JSON.stringify( + ClearPlaylistContentsPlaylistsErrors$outboundSchema.parse( + clearPlaylistContentsPlaylistsErrors, + ), + ); +} + +export function clearPlaylistContentsPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ClearPlaylistContentsPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ClearPlaylistContentsPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const ClearPlaylistContentsUnauthorized$inboundSchema: z.ZodType< ClearPlaylistContentsUnauthorized, @@ -240,6 +264,26 @@ export namespace ClearPlaylistContentsErrors$ { export type Outbound = ClearPlaylistContentsErrors$Outbound; } +export function clearPlaylistContentsErrorsToJSON( + clearPlaylistContentsErrors: ClearPlaylistContentsErrors, +): string { + return JSON.stringify( + ClearPlaylistContentsErrors$outboundSchema.parse( + clearPlaylistContentsErrors, + ), + ); +} + +export function clearPlaylistContentsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ClearPlaylistContentsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ClearPlaylistContentsErrors' from JSON`, + ); +} + /** @internal */ export const ClearPlaylistContentsBadRequest$inboundSchema: z.ZodType< ClearPlaylistContentsBadRequest, diff --git a/src/sdk/models/errors/createplaylist.ts b/src/sdk/models/errors/createplaylist.ts index d919689a..4085e919 100644 --- a/src/sdk/models/errors/createplaylist.ts +++ b/src/sdk/models/errors/createplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type CreatePlaylistPlaylistsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace CreatePlaylistPlaylistsErrors$ { export type Outbound = CreatePlaylistPlaylistsErrors$Outbound; } +export function createPlaylistPlaylistsErrorsToJSON( + createPlaylistPlaylistsErrors: CreatePlaylistPlaylistsErrors, +): string { + return JSON.stringify( + CreatePlaylistPlaylistsErrors$outboundSchema.parse( + createPlaylistPlaylistsErrors, + ), + ); +} + +export function createPlaylistPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const CreatePlaylistUnauthorized$inboundSchema: z.ZodType< CreatePlaylistUnauthorized, @@ -236,6 +259,24 @@ export namespace CreatePlaylistErrors$ { export type Outbound = CreatePlaylistErrors$Outbound; } +export function createPlaylistErrorsToJSON( + createPlaylistErrors: CreatePlaylistErrors, +): string { + return JSON.stringify( + CreatePlaylistErrors$outboundSchema.parse(createPlaylistErrors), + ); +} + +export function createPlaylistErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistErrors' from JSON`, + ); +} + /** @internal */ export const CreatePlaylistBadRequest$inboundSchema: z.ZodType< CreatePlaylistBadRequest, diff --git a/src/sdk/models/errors/deletelibrary.ts b/src/sdk/models/errors/deletelibrary.ts index 7cc53d00..b110ca8c 100644 --- a/src/sdk/models/errors/deletelibrary.ts +++ b/src/sdk/models/errors/deletelibrary.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type DeleteLibraryLibraryErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace DeleteLibraryLibraryErrors$ { export type Outbound = DeleteLibraryLibraryErrors$Outbound; } +export function deleteLibraryLibraryErrorsToJSON( + deleteLibraryLibraryErrors: DeleteLibraryLibraryErrors, +): string { + return JSON.stringify( + DeleteLibraryLibraryErrors$outboundSchema.parse(deleteLibraryLibraryErrors), + ); +} + +export function deleteLibraryLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteLibraryLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteLibraryLibraryErrors' from JSON`, + ); +} + /** @internal */ export const DeleteLibraryUnauthorized$inboundSchema: z.ZodType< DeleteLibraryUnauthorized, @@ -235,6 +256,24 @@ export namespace DeleteLibraryErrors$ { export type Outbound = DeleteLibraryErrors$Outbound; } +export function deleteLibraryErrorsToJSON( + deleteLibraryErrors: DeleteLibraryErrors, +): string { + return JSON.stringify( + DeleteLibraryErrors$outboundSchema.parse(deleteLibraryErrors), + ); +} + +export function deleteLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteLibraryErrors' from JSON`, + ); +} + /** @internal */ export const DeleteLibraryBadRequest$inboundSchema: z.ZodType< DeleteLibraryBadRequest, diff --git a/src/sdk/models/errors/deleteplaylist.ts b/src/sdk/models/errors/deleteplaylist.ts index bce0ab8c..83fced30 100644 --- a/src/sdk/models/errors/deleteplaylist.ts +++ b/src/sdk/models/errors/deleteplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type DeletePlaylistPlaylistsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace DeletePlaylistPlaylistsErrors$ { export type Outbound = DeletePlaylistPlaylistsErrors$Outbound; } +export function deletePlaylistPlaylistsErrorsToJSON( + deletePlaylistPlaylistsErrors: DeletePlaylistPlaylistsErrors, +): string { + return JSON.stringify( + DeletePlaylistPlaylistsErrors$outboundSchema.parse( + deletePlaylistPlaylistsErrors, + ), + ); +} + +export function deletePlaylistPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeletePlaylistPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeletePlaylistPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const DeletePlaylistUnauthorized$inboundSchema: z.ZodType< DeletePlaylistUnauthorized, @@ -236,6 +259,24 @@ export namespace DeletePlaylistErrors$ { export type Outbound = DeletePlaylistErrors$Outbound; } +export function deletePlaylistErrorsToJSON( + deletePlaylistErrors: DeletePlaylistErrors, +): string { + return JSON.stringify( + DeletePlaylistErrors$outboundSchema.parse(deletePlaylistErrors), + ); +} + +export function deletePlaylistErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeletePlaylistErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeletePlaylistErrors' from JSON`, + ); +} + /** @internal */ export const DeletePlaylistBadRequest$inboundSchema: z.ZodType< DeletePlaylistBadRequest, diff --git a/src/sdk/models/errors/enablepapertrail.ts b/src/sdk/models/errors/enablepapertrail.ts index 5c0b3866..aa5eb236 100644 --- a/src/sdk/models/errors/enablepapertrail.ts +++ b/src/sdk/models/errors/enablepapertrail.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type EnablePaperTrailLogErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace EnablePaperTrailLogErrors$ { export type Outbound = EnablePaperTrailLogErrors$Outbound; } +export function enablePaperTrailLogErrorsToJSON( + enablePaperTrailLogErrors: EnablePaperTrailLogErrors, +): string { + return JSON.stringify( + EnablePaperTrailLogErrors$outboundSchema.parse(enablePaperTrailLogErrors), + ); +} + +export function enablePaperTrailLogErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => EnablePaperTrailLogErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'EnablePaperTrailLogErrors' from JSON`, + ); +} + /** @internal */ export const EnablePaperTrailUnauthorized$inboundSchema: z.ZodType< EnablePaperTrailUnauthorized, @@ -235,6 +256,24 @@ export namespace EnablePaperTrailErrors$ { export type Outbound = EnablePaperTrailErrors$Outbound; } +export function enablePaperTrailErrorsToJSON( + enablePaperTrailErrors: EnablePaperTrailErrors, +): string { + return JSON.stringify( + EnablePaperTrailErrors$outboundSchema.parse(enablePaperTrailErrors), + ); +} + +export function enablePaperTrailErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => EnablePaperTrailErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'EnablePaperTrailErrors' from JSON`, + ); +} + /** @internal */ export const EnablePaperTrailBadRequest$inboundSchema: z.ZodType< EnablePaperTrailBadRequest, diff --git a/src/sdk/models/errors/getalllibraries.ts b/src/sdk/models/errors/getalllibraries.ts index 5207d802..75ce524b 100644 --- a/src/sdk/models/errors/getalllibraries.ts +++ b/src/sdk/models/errors/getalllibraries.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetAllLibrariesLibraryErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetAllLibrariesLibraryErrors$ { export type Outbound = GetAllLibrariesLibraryErrors$Outbound; } +export function getAllLibrariesLibraryErrorsToJSON( + getAllLibrariesLibraryErrors: GetAllLibrariesLibraryErrors, +): string { + return JSON.stringify( + GetAllLibrariesLibraryErrors$outboundSchema.parse( + getAllLibrariesLibraryErrors, + ), + ); +} + +export function getAllLibrariesLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetAllLibrariesUnauthorized$inboundSchema: z.ZodType< GetAllLibrariesUnauthorized, @@ -235,6 +258,24 @@ export namespace GetAllLibrariesErrors$ { export type Outbound = GetAllLibrariesErrors$Outbound; } +export function getAllLibrariesErrorsToJSON( + getAllLibrariesErrors: GetAllLibrariesErrors, +): string { + return JSON.stringify( + GetAllLibrariesErrors$outboundSchema.parse(getAllLibrariesErrors), + ); +} + +export function getAllLibrariesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesErrors' from JSON`, + ); +} + /** @internal */ export const GetAllLibrariesBadRequest$inboundSchema: z.ZodType< GetAllLibrariesBadRequest, diff --git a/src/sdk/models/errors/getavailableclients.ts b/src/sdk/models/errors/getavailableclients.ts index d5125e9c..13eb1852 100644 --- a/src/sdk/models/errors/getavailableclients.ts +++ b/src/sdk/models/errors/getavailableclients.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetAvailableClientsServerErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetAvailableClientsServerErrors$ { export type Outbound = GetAvailableClientsServerErrors$Outbound; } +export function getAvailableClientsServerErrorsToJSON( + getAvailableClientsServerErrors: GetAvailableClientsServerErrors, +): string { + return JSON.stringify( + GetAvailableClientsServerErrors$outboundSchema.parse( + getAvailableClientsServerErrors, + ), + ); +} + +export function getAvailableClientsServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAvailableClientsServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAvailableClientsServerErrors' from JSON`, + ); +} + /** @internal */ export const GetAvailableClientsUnauthorized$inboundSchema: z.ZodType< GetAvailableClientsUnauthorized, @@ -236,6 +259,24 @@ export namespace GetAvailableClientsErrors$ { export type Outbound = GetAvailableClientsErrors$Outbound; } +export function getAvailableClientsErrorsToJSON( + getAvailableClientsErrors: GetAvailableClientsErrors, +): string { + return JSON.stringify( + GetAvailableClientsErrors$outboundSchema.parse(getAvailableClientsErrors), + ); +} + +export function getAvailableClientsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAvailableClientsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAvailableClientsErrors' from JSON`, + ); +} + /** @internal */ export const GetAvailableClientsBadRequest$inboundSchema: z.ZodType< GetAvailableClientsBadRequest, diff --git a/src/sdk/models/errors/getbandwidthstatistics.ts b/src/sdk/models/errors/getbandwidthstatistics.ts index 9dbf3cee..7d02a4d0 100644 --- a/src/sdk/models/errors/getbandwidthstatistics.ts +++ b/src/sdk/models/errors/getbandwidthstatistics.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetBandwidthStatisticsStatisticsErrors = { code?: number | undefined; @@ -137,6 +140,28 @@ export namespace GetBandwidthStatisticsStatisticsErrors$ { export type Outbound = GetBandwidthStatisticsStatisticsErrors$Outbound; } +export function getBandwidthStatisticsStatisticsErrorsToJSON( + getBandwidthStatisticsStatisticsErrors: + GetBandwidthStatisticsStatisticsErrors, +): string { + return JSON.stringify( + GetBandwidthStatisticsStatisticsErrors$outboundSchema.parse( + getBandwidthStatisticsStatisticsErrors, + ), + ); +} + +export function getBandwidthStatisticsStatisticsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetBandwidthStatisticsStatisticsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsStatisticsErrors' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsUnauthorized$inboundSchema: z.ZodType< GetBandwidthStatisticsUnauthorized, @@ -240,6 +265,26 @@ export namespace GetBandwidthStatisticsErrors$ { export type Outbound = GetBandwidthStatisticsErrors$Outbound; } +export function getBandwidthStatisticsErrorsToJSON( + getBandwidthStatisticsErrors: GetBandwidthStatisticsErrors, +): string { + return JSON.stringify( + GetBandwidthStatisticsErrors$outboundSchema.parse( + getBandwidthStatisticsErrors, + ), + ); +} + +export function getBandwidthStatisticsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBandwidthStatisticsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsErrors' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsBadRequest$inboundSchema: z.ZodType< GetBandwidthStatisticsBadRequest, diff --git a/src/sdk/models/errors/getbannerimage.ts b/src/sdk/models/errors/getbannerimage.ts index 358113bd..12c3da21 100644 --- a/src/sdk/models/errors/getbannerimage.ts +++ b/src/sdk/models/errors/getbannerimage.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetBannerImageMediaErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetBannerImageMediaErrors$ { export type Outbound = GetBannerImageMediaErrors$Outbound; } +export function getBannerImageMediaErrorsToJSON( + getBannerImageMediaErrors: GetBannerImageMediaErrors, +): string { + return JSON.stringify( + GetBannerImageMediaErrors$outboundSchema.parse(getBannerImageMediaErrors), + ); +} + +export function getBannerImageMediaErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBannerImageMediaErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBannerImageMediaErrors' from JSON`, + ); +} + /** @internal */ export const GetBannerImageUnauthorized$inboundSchema: z.ZodType< GetBannerImageUnauthorized, @@ -235,6 +256,24 @@ export namespace GetBannerImageErrors$ { export type Outbound = GetBannerImageErrors$Outbound; } +export function getBannerImageErrorsToJSON( + getBannerImageErrors: GetBannerImageErrors, +): string { + return JSON.stringify( + GetBannerImageErrors$outboundSchema.parse(getBannerImageErrors), + ); +} + +export function getBannerImageErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBannerImageErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBannerImageErrors' from JSON`, + ); +} + /** @internal */ export const GetBannerImageBadRequest$inboundSchema: z.ZodType< GetBannerImageBadRequest, diff --git a/src/sdk/models/errors/getbutlertasks.ts b/src/sdk/models/errors/getbutlertasks.ts index 845b1a0c..7cc0e553 100644 --- a/src/sdk/models/errors/getbutlertasks.ts +++ b/src/sdk/models/errors/getbutlertasks.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetButlerTasksButlerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetButlerTasksButlerErrors$ { export type Outbound = GetButlerTasksButlerErrors$Outbound; } +export function getButlerTasksButlerErrorsToJSON( + getButlerTasksButlerErrors: GetButlerTasksButlerErrors, +): string { + return JSON.stringify( + GetButlerTasksButlerErrors$outboundSchema.parse(getButlerTasksButlerErrors), + ); +} + +export function getButlerTasksButlerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetButlerTasksButlerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetButlerTasksButlerErrors' from JSON`, + ); +} + /** @internal */ export const GetButlerTasksUnauthorized$inboundSchema: z.ZodType< GetButlerTasksUnauthorized, @@ -235,6 +256,24 @@ export namespace GetButlerTasksErrors$ { export type Outbound = GetButlerTasksErrors$Outbound; } +export function getButlerTasksErrorsToJSON( + getButlerTasksErrors: GetButlerTasksErrors, +): string { + return JSON.stringify( + GetButlerTasksErrors$outboundSchema.parse(getButlerTasksErrors), + ); +} + +export function getButlerTasksErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetButlerTasksErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetButlerTasksErrors' from JSON`, + ); +} + /** @internal */ export const GetButlerTasksBadRequest$inboundSchema: z.ZodType< GetButlerTasksBadRequest, diff --git a/src/sdk/models/errors/getcompanionsdata.ts b/src/sdk/models/errors/getcompanionsdata.ts index d02a4bb0..56fc65e9 100644 --- a/src/sdk/models/errors/getcompanionsdata.ts +++ b/src/sdk/models/errors/getcompanionsdata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetCompanionsDataPlexErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetCompanionsDataPlexErrors$ { export type Outbound = GetCompanionsDataPlexErrors$Outbound; } +export function getCompanionsDataPlexErrorsToJSON( + getCompanionsDataPlexErrors: GetCompanionsDataPlexErrors, +): string { + return JSON.stringify( + GetCompanionsDataPlexErrors$outboundSchema.parse( + getCompanionsDataPlexErrors, + ), + ); +} + +export function getCompanionsDataPlexErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCompanionsDataPlexErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCompanionsDataPlexErrors' from JSON`, + ); +} + /** @internal */ export const GetCompanionsDataUnauthorized$inboundSchema: z.ZodType< GetCompanionsDataUnauthorized, @@ -235,6 +258,24 @@ export namespace GetCompanionsDataErrors$ { export type Outbound = GetCompanionsDataErrors$Outbound; } +export function getCompanionsDataErrorsToJSON( + getCompanionsDataErrors: GetCompanionsDataErrors, +): string { + return JSON.stringify( + GetCompanionsDataErrors$outboundSchema.parse(getCompanionsDataErrors), + ); +} + +export function getCompanionsDataErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCompanionsDataErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCompanionsDataErrors' from JSON`, + ); +} + /** @internal */ export const GetCompanionsDataBadRequest$inboundSchema: z.ZodType< GetCompanionsDataBadRequest, diff --git a/src/sdk/models/errors/getdevices.ts b/src/sdk/models/errors/getdevices.ts index de3426a2..de989838 100644 --- a/src/sdk/models/errors/getdevices.ts +++ b/src/sdk/models/errors/getdevices.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetDevicesServerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetDevicesServerErrors$ { export type Outbound = GetDevicesServerErrors$Outbound; } +export function getDevicesServerErrorsToJSON( + getDevicesServerErrors: GetDevicesServerErrors, +): string { + return JSON.stringify( + GetDevicesServerErrors$outboundSchema.parse(getDevicesServerErrors), + ); +} + +export function getDevicesServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetDevicesServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetDevicesServerErrors' from JSON`, + ); +} + /** @internal */ export const GetDevicesUnauthorized$inboundSchema: z.ZodType< GetDevicesUnauthorized, @@ -235,6 +256,24 @@ export namespace GetDevicesErrors$ { export type Outbound = GetDevicesErrors$Outbound; } +export function getDevicesErrorsToJSON( + getDevicesErrors: GetDevicesErrors, +): string { + return JSON.stringify( + GetDevicesErrors$outboundSchema.parse(getDevicesErrors), + ); +} + +export function getDevicesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetDevicesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetDevicesErrors' from JSON`, + ); +} + /** @internal */ export const GetDevicesBadRequest$inboundSchema: z.ZodType< GetDevicesBadRequest, diff --git a/src/sdk/models/errors/getfilehash.ts b/src/sdk/models/errors/getfilehash.ts index 6bb2cdba..08e8d54d 100644 --- a/src/sdk/models/errors/getfilehash.ts +++ b/src/sdk/models/errors/getfilehash.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetFileHashLibraryErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetFileHashLibraryErrors$ { export type Outbound = GetFileHashLibraryErrors$Outbound; } +export function getFileHashLibraryErrorsToJSON( + getFileHashLibraryErrors: GetFileHashLibraryErrors, +): string { + return JSON.stringify( + GetFileHashLibraryErrors$outboundSchema.parse(getFileHashLibraryErrors), + ); +} + +export function getFileHashLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetFileHashLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetFileHashLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetFileHashUnauthorized$inboundSchema: z.ZodType< GetFileHashUnauthorized, @@ -235,6 +256,24 @@ export namespace GetFileHashErrors$ { export type Outbound = GetFileHashErrors$Outbound; } +export function getFileHashErrorsToJSON( + getFileHashErrors: GetFileHashErrors, +): string { + return JSON.stringify( + GetFileHashErrors$outboundSchema.parse(getFileHashErrors), + ); +} + +export function getFileHashErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetFileHashErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetFileHashErrors' from JSON`, + ); +} + /** @internal */ export const GetFileHashBadRequest$inboundSchema: z.ZodType< GetFileHashBadRequest, diff --git a/src/sdk/models/errors/getgeodata.ts b/src/sdk/models/errors/getgeodata.ts index 03622aa0..4d9b7a66 100644 --- a/src/sdk/models/errors/getgeodata.ts +++ b/src/sdk/models/errors/getgeodata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetGeoDataPlexErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetGeoDataPlexErrors$ { export type Outbound = GetGeoDataPlexErrors$Outbound; } +export function getGeoDataPlexErrorsToJSON( + getGeoDataPlexErrors: GetGeoDataPlexErrors, +): string { + return JSON.stringify( + GetGeoDataPlexErrors$outboundSchema.parse(getGeoDataPlexErrors), + ); +} + +export function getGeoDataPlexErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGeoDataPlexErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGeoDataPlexErrors' from JSON`, + ); +} + /** @internal */ export const GetGeoDataUnauthorized$inboundSchema: z.ZodType< GetGeoDataUnauthorized, @@ -234,6 +255,24 @@ export namespace GetGeoDataErrors$ { export type Outbound = GetGeoDataErrors$Outbound; } +export function getGeoDataErrorsToJSON( + getGeoDataErrors: GetGeoDataErrors, +): string { + return JSON.stringify( + GetGeoDataErrors$outboundSchema.parse(getGeoDataErrors), + ); +} + +export function getGeoDataErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGeoDataErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGeoDataErrors' from JSON`, + ); +} + /** @internal */ export const GetGeoDataBadRequest$inboundSchema: z.ZodType< GetGeoDataBadRequest, diff --git a/src/sdk/models/errors/getglobalhubs.ts b/src/sdk/models/errors/getglobalhubs.ts index bbc0f6bd..9df10451 100644 --- a/src/sdk/models/errors/getglobalhubs.ts +++ b/src/sdk/models/errors/getglobalhubs.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetGlobalHubsHubsErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetGlobalHubsHubsErrors$ { export type Outbound = GetGlobalHubsHubsErrors$Outbound; } +export function getGlobalHubsHubsErrorsToJSON( + getGlobalHubsHubsErrors: GetGlobalHubsHubsErrors, +): string { + return JSON.stringify( + GetGlobalHubsHubsErrors$outboundSchema.parse(getGlobalHubsHubsErrors), + ); +} + +export function getGlobalHubsHubsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsHubsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsHubsErrors' from JSON`, + ); +} + /** @internal */ export const GetGlobalHubsUnauthorized$inboundSchema: z.ZodType< GetGlobalHubsUnauthorized, @@ -235,6 +256,24 @@ export namespace GetGlobalHubsErrors$ { export type Outbound = GetGlobalHubsErrors$Outbound; } +export function getGlobalHubsErrorsToJSON( + getGlobalHubsErrors: GetGlobalHubsErrors, +): string { + return JSON.stringify( + GetGlobalHubsErrors$outboundSchema.parse(getGlobalHubsErrors), + ); +} + +export function getGlobalHubsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsErrors' from JSON`, + ); +} + /** @internal */ export const GetGlobalHubsBadRequest$inboundSchema: z.ZodType< GetGlobalHubsBadRequest, diff --git a/src/sdk/models/errors/gethomedata.ts b/src/sdk/models/errors/gethomedata.ts index 1106b59b..75e49b90 100644 --- a/src/sdk/models/errors/gethomedata.ts +++ b/src/sdk/models/errors/gethomedata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetHomeDataPlexErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetHomeDataPlexErrors$ { export type Outbound = GetHomeDataPlexErrors$Outbound; } +export function getHomeDataPlexErrorsToJSON( + getHomeDataPlexErrors: GetHomeDataPlexErrors, +): string { + return JSON.stringify( + GetHomeDataPlexErrors$outboundSchema.parse(getHomeDataPlexErrors), + ); +} + +export function getHomeDataPlexErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetHomeDataPlexErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetHomeDataPlexErrors' from JSON`, + ); +} + /** @internal */ export const GetHomeDataUnauthorized$inboundSchema: z.ZodType< GetHomeDataUnauthorized, @@ -234,6 +255,24 @@ export namespace GetHomeDataErrors$ { export type Outbound = GetHomeDataErrors$Outbound; } +export function getHomeDataErrorsToJSON( + getHomeDataErrors: GetHomeDataErrors, +): string { + return JSON.stringify( + GetHomeDataErrors$outboundSchema.parse(getHomeDataErrors), + ); +} + +export function getHomeDataErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetHomeDataErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetHomeDataErrors' from JSON`, + ); +} + /** @internal */ export const GetHomeDataBadRequest$inboundSchema: z.ZodType< GetHomeDataBadRequest, diff --git a/src/sdk/models/errors/getlibrarydetails.ts b/src/sdk/models/errors/getlibrarydetails.ts index 198cd352..9ab31802 100644 --- a/src/sdk/models/errors/getlibrarydetails.ts +++ b/src/sdk/models/errors/getlibrarydetails.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetLibraryDetailsLibraryErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetLibraryDetailsLibraryErrors$ { export type Outbound = GetLibraryDetailsLibraryErrors$Outbound; } +export function getLibraryDetailsLibraryErrorsToJSON( + getLibraryDetailsLibraryErrors: GetLibraryDetailsLibraryErrors, +): string { + return JSON.stringify( + GetLibraryDetailsLibraryErrors$outboundSchema.parse( + getLibraryDetailsLibraryErrors, + ), + ); +} + +export function getLibraryDetailsLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsUnauthorized$inboundSchema: z.ZodType< GetLibraryDetailsUnauthorized, @@ -236,6 +259,24 @@ export namespace GetLibraryDetailsErrors$ { export type Outbound = GetLibraryDetailsErrors$Outbound; } +export function getLibraryDetailsErrorsToJSON( + getLibraryDetailsErrors: GetLibraryDetailsErrors, +): string { + return JSON.stringify( + GetLibraryDetailsErrors$outboundSchema.parse(getLibraryDetailsErrors), + ); +} + +export function getLibraryDetailsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsErrors' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsBadRequest$inboundSchema: z.ZodType< GetLibraryDetailsBadRequest, diff --git a/src/sdk/models/errors/getlibraryhubs.ts b/src/sdk/models/errors/getlibraryhubs.ts index 9d37a84d..ffb1a23d 100644 --- a/src/sdk/models/errors/getlibraryhubs.ts +++ b/src/sdk/models/errors/getlibraryhubs.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetLibraryHubsHubsErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetLibraryHubsHubsErrors$ { export type Outbound = GetLibraryHubsHubsErrors$Outbound; } +export function getLibraryHubsHubsErrorsToJSON( + getLibraryHubsHubsErrors: GetLibraryHubsHubsErrors, +): string { + return JSON.stringify( + GetLibraryHubsHubsErrors$outboundSchema.parse(getLibraryHubsHubsErrors), + ); +} + +export function getLibraryHubsHubsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsHubsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsHubsErrors' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsUnauthorized$inboundSchema: z.ZodType< GetLibraryHubsUnauthorized, @@ -235,6 +256,24 @@ export namespace GetLibraryHubsErrors$ { export type Outbound = GetLibraryHubsErrors$Outbound; } +export function getLibraryHubsErrorsToJSON( + getLibraryHubsErrors: GetLibraryHubsErrors, +): string { + return JSON.stringify( + GetLibraryHubsErrors$outboundSchema.parse(getLibraryHubsErrors), + ); +} + +export function getLibraryHubsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsErrors' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsBadRequest$inboundSchema: z.ZodType< GetLibraryHubsBadRequest, diff --git a/src/sdk/models/errors/getlibraryitems.ts b/src/sdk/models/errors/getlibraryitems.ts index 7026699d..a38c39b3 100644 --- a/src/sdk/models/errors/getlibraryitems.ts +++ b/src/sdk/models/errors/getlibraryitems.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetLibraryItemsLibraryErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetLibraryItemsLibraryErrors$ { export type Outbound = GetLibraryItemsLibraryErrors$Outbound; } +export function getLibraryItemsLibraryErrorsToJSON( + getLibraryItemsLibraryErrors: GetLibraryItemsLibraryErrors, +): string { + return JSON.stringify( + GetLibraryItemsLibraryErrors$outboundSchema.parse( + getLibraryItemsLibraryErrors, + ), + ); +} + +export function getLibraryItemsLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsUnauthorized$inboundSchema: z.ZodType< GetLibraryItemsUnauthorized, @@ -235,6 +258,24 @@ export namespace GetLibraryItemsErrors$ { export type Outbound = GetLibraryItemsErrors$Outbound; } +export function getLibraryItemsErrorsToJSON( + getLibraryItemsErrors: GetLibraryItemsErrors, +): string { + return JSON.stringify( + GetLibraryItemsErrors$outboundSchema.parse(getLibraryItemsErrors), + ); +} + +export function getLibraryItemsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsErrors' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsBadRequest$inboundSchema: z.ZodType< GetLibraryItemsBadRequest, diff --git a/src/sdk/models/errors/getmediaproviders.ts b/src/sdk/models/errors/getmediaproviders.ts index ee1cb2f8..c771b299 100644 --- a/src/sdk/models/errors/getmediaproviders.ts +++ b/src/sdk/models/errors/getmediaproviders.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetMediaProvidersServerErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetMediaProvidersServerErrors$ { export type Outbound = GetMediaProvidersServerErrors$Outbound; } +export function getMediaProvidersServerErrorsToJSON( + getMediaProvidersServerErrors: GetMediaProvidersServerErrors, +): string { + return JSON.stringify( + GetMediaProvidersServerErrors$outboundSchema.parse( + getMediaProvidersServerErrors, + ), + ); +} + +export function getMediaProvidersServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersServerErrors' from JSON`, + ); +} + /** @internal */ export const GetMediaProvidersUnauthorized$inboundSchema: z.ZodType< GetMediaProvidersUnauthorized, @@ -236,6 +259,24 @@ export namespace GetMediaProvidersErrors$ { export type Outbound = GetMediaProvidersErrors$Outbound; } +export function getMediaProvidersErrorsToJSON( + getMediaProvidersErrors: GetMediaProvidersErrors, +): string { + return JSON.stringify( + GetMediaProvidersErrors$outboundSchema.parse(getMediaProvidersErrors), + ); +} + +export function getMediaProvidersErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersErrors' from JSON`, + ); +} + /** @internal */ export const GetMediaProvidersBadRequest$inboundSchema: z.ZodType< GetMediaProvidersBadRequest, diff --git a/src/sdk/models/errors/getmetadatabyratingkey.ts b/src/sdk/models/errors/getmetadatabyratingkey.ts index 91f800d1..3ffb94a9 100644 --- a/src/sdk/models/errors/getmetadatabyratingkey.ts +++ b/src/sdk/models/errors/getmetadatabyratingkey.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetMetaDataByRatingKeyLibraryErrors = { code?: number | undefined; @@ -137,6 +140,27 @@ export namespace GetMetaDataByRatingKeyLibraryErrors$ { export type Outbound = GetMetaDataByRatingKeyLibraryErrors$Outbound; } +export function getMetaDataByRatingKeyLibraryErrorsToJSON( + getMetaDataByRatingKeyLibraryErrors: GetMetaDataByRatingKeyLibraryErrors, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyLibraryErrors$outboundSchema.parse( + getMetaDataByRatingKeyLibraryErrors, + ), + ); +} + +export function getMetaDataByRatingKeyLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetMetaDataByRatingKeyLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyUnauthorized$inboundSchema: z.ZodType< GetMetaDataByRatingKeyUnauthorized, @@ -240,6 +264,26 @@ export namespace GetMetaDataByRatingKeyErrors$ { export type Outbound = GetMetaDataByRatingKeyErrors$Outbound; } +export function getMetaDataByRatingKeyErrorsToJSON( + getMetaDataByRatingKeyErrors: GetMetaDataByRatingKeyErrors, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyErrors$outboundSchema.parse( + getMetaDataByRatingKeyErrors, + ), + ); +} + +export function getMetaDataByRatingKeyErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyErrors' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyBadRequest$inboundSchema: z.ZodType< GetMetaDataByRatingKeyBadRequest, diff --git a/src/sdk/models/errors/getmetadatachildren.ts b/src/sdk/models/errors/getmetadatachildren.ts index 8b66b40c..7a94aa8c 100644 --- a/src/sdk/models/errors/getmetadatachildren.ts +++ b/src/sdk/models/errors/getmetadatachildren.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetMetadataChildrenLibraryErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetMetadataChildrenLibraryErrors$ { export type Outbound = GetMetadataChildrenLibraryErrors$Outbound; } +export function getMetadataChildrenLibraryErrorsToJSON( + getMetadataChildrenLibraryErrors: GetMetadataChildrenLibraryErrors, +): string { + return JSON.stringify( + GetMetadataChildrenLibraryErrors$outboundSchema.parse( + getMetadataChildrenLibraryErrors, + ), + ); +} + +export function getMetadataChildrenLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenUnauthorized$inboundSchema: z.ZodType< GetMetadataChildrenUnauthorized, @@ -236,6 +259,24 @@ export namespace GetMetadataChildrenErrors$ { export type Outbound = GetMetadataChildrenErrors$Outbound; } +export function getMetadataChildrenErrorsToJSON( + getMetadataChildrenErrors: GetMetadataChildrenErrors, +): string { + return JSON.stringify( + GetMetadataChildrenErrors$outboundSchema.parse(getMetadataChildrenErrors), + ); +} + +export function getMetadataChildrenErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenErrors' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenBadRequest$inboundSchema: z.ZodType< GetMetadataChildrenBadRequest, diff --git a/src/sdk/models/errors/getmyplexaccount.ts b/src/sdk/models/errors/getmyplexaccount.ts index b23574f2..1071f29d 100644 --- a/src/sdk/models/errors/getmyplexaccount.ts +++ b/src/sdk/models/errors/getmyplexaccount.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetMyPlexAccountServerErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetMyPlexAccountServerErrors$ { export type Outbound = GetMyPlexAccountServerErrors$Outbound; } +export function getMyPlexAccountServerErrorsToJSON( + getMyPlexAccountServerErrors: GetMyPlexAccountServerErrors, +): string { + return JSON.stringify( + GetMyPlexAccountServerErrors$outboundSchema.parse( + getMyPlexAccountServerErrors, + ), + ); +} + +export function getMyPlexAccountServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMyPlexAccountServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMyPlexAccountServerErrors' from JSON`, + ); +} + /** @internal */ export const GetMyPlexAccountUnauthorized$inboundSchema: z.ZodType< GetMyPlexAccountUnauthorized, @@ -235,6 +258,24 @@ export namespace GetMyPlexAccountErrors$ { export type Outbound = GetMyPlexAccountErrors$Outbound; } +export function getMyPlexAccountErrorsToJSON( + getMyPlexAccountErrors: GetMyPlexAccountErrors, +): string { + return JSON.stringify( + GetMyPlexAccountErrors$outboundSchema.parse(getMyPlexAccountErrors), + ); +} + +export function getMyPlexAccountErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMyPlexAccountErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMyPlexAccountErrors' from JSON`, + ); +} + /** @internal */ export const GetMyPlexAccountBadRequest$inboundSchema: z.ZodType< GetMyPlexAccountBadRequest, diff --git a/src/sdk/models/errors/getondeck.ts b/src/sdk/models/errors/getondeck.ts index 0bced3d0..d6896ef6 100644 --- a/src/sdk/models/errors/getondeck.ts +++ b/src/sdk/models/errors/getondeck.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetOnDeckLibraryErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetOnDeckLibraryErrors$ { export type Outbound = GetOnDeckLibraryErrors$Outbound; } +export function getOnDeckLibraryErrorsToJSON( + getOnDeckLibraryErrors: GetOnDeckLibraryErrors, +): string { + return JSON.stringify( + GetOnDeckLibraryErrors$outboundSchema.parse(getOnDeckLibraryErrors), + ); +} + +export function getOnDeckLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetOnDeckUnauthorized$inboundSchema: z.ZodType< GetOnDeckUnauthorized, @@ -235,6 +256,22 @@ export namespace GetOnDeckErrors$ { export type Outbound = GetOnDeckErrors$Outbound; } +export function getOnDeckErrorsToJSON( + getOnDeckErrors: GetOnDeckErrors, +): string { + return JSON.stringify(GetOnDeckErrors$outboundSchema.parse(getOnDeckErrors)); +} + +export function getOnDeckErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckErrors' from JSON`, + ); +} + /** @internal */ export const GetOnDeckBadRequest$inboundSchema: z.ZodType< GetOnDeckBadRequest, diff --git a/src/sdk/models/errors/getpin.ts b/src/sdk/models/errors/getpin.ts index 484acdbc..66148965 100644 --- a/src/sdk/models/errors/getpin.ts +++ b/src/sdk/models/errors/getpin.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetPinErrors = { code?: number | undefined; @@ -91,6 +94,20 @@ export namespace GetPinErrors$ { export type Outbound = GetPinErrors$Outbound; } +export function getPinErrorsToJSON(getPinErrors: GetPinErrors): string { + return JSON.stringify(GetPinErrors$outboundSchema.parse(getPinErrors)); +} + +export function getPinErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPinErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPinErrors' from JSON`, + ); +} + /** @internal */ export const GetPinBadRequest$inboundSchema: z.ZodType< GetPinBadRequest, diff --git a/src/sdk/models/errors/getplaylist.ts b/src/sdk/models/errors/getplaylist.ts index 90085494..fb367e57 100644 --- a/src/sdk/models/errors/getplaylist.ts +++ b/src/sdk/models/errors/getplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetPlaylistPlaylistsErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetPlaylistPlaylistsErrors$ { export type Outbound = GetPlaylistPlaylistsErrors$Outbound; } +export function getPlaylistPlaylistsErrorsToJSON( + getPlaylistPlaylistsErrors: GetPlaylistPlaylistsErrors, +): string { + return JSON.stringify( + GetPlaylistPlaylistsErrors$outboundSchema.parse(getPlaylistPlaylistsErrors), + ); +} + +export function getPlaylistPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const GetPlaylistUnauthorized$inboundSchema: z.ZodType< GetPlaylistUnauthorized, @@ -235,6 +256,24 @@ export namespace GetPlaylistErrors$ { export type Outbound = GetPlaylistErrors$Outbound; } +export function getPlaylistErrorsToJSON( + getPlaylistErrors: GetPlaylistErrors, +): string { + return JSON.stringify( + GetPlaylistErrors$outboundSchema.parse(getPlaylistErrors), + ); +} + +export function getPlaylistErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistErrors' from JSON`, + ); +} + /** @internal */ export const GetPlaylistBadRequest$inboundSchema: z.ZodType< GetPlaylistBadRequest, diff --git a/src/sdk/models/errors/getplaylistcontents.ts b/src/sdk/models/errors/getplaylistcontents.ts index 9a3b8afa..bf66b3e4 100644 --- a/src/sdk/models/errors/getplaylistcontents.ts +++ b/src/sdk/models/errors/getplaylistcontents.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetPlaylistContentsPlaylistsErrors = { code?: number | undefined; @@ -136,6 +139,27 @@ export namespace GetPlaylistContentsPlaylistsErrors$ { export type Outbound = GetPlaylistContentsPlaylistsErrors$Outbound; } +export function getPlaylistContentsPlaylistsErrorsToJSON( + getPlaylistContentsPlaylistsErrors: GetPlaylistContentsPlaylistsErrors, +): string { + return JSON.stringify( + GetPlaylistContentsPlaylistsErrors$outboundSchema.parse( + getPlaylistContentsPlaylistsErrors, + ), + ); +} + +export function getPlaylistContentsPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetPlaylistContentsPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsUnauthorized$inboundSchema: z.ZodType< GetPlaylistContentsUnauthorized, @@ -238,6 +262,24 @@ export namespace GetPlaylistContentsErrors$ { export type Outbound = GetPlaylistContentsErrors$Outbound; } +export function getPlaylistContentsErrorsToJSON( + getPlaylistContentsErrors: GetPlaylistContentsErrors, +): string { + return JSON.stringify( + GetPlaylistContentsErrors$outboundSchema.parse(getPlaylistContentsErrors), + ); +} + +export function getPlaylistContentsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsErrors' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsBadRequest$inboundSchema: z.ZodType< GetPlaylistContentsBadRequest, diff --git a/src/sdk/models/errors/getplaylists.ts b/src/sdk/models/errors/getplaylists.ts index efcafa35..af6d165b 100644 --- a/src/sdk/models/errors/getplaylists.ts +++ b/src/sdk/models/errors/getplaylists.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetPlaylistsPlaylistsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetPlaylistsPlaylistsErrors$ { export type Outbound = GetPlaylistsPlaylistsErrors$Outbound; } +export function getPlaylistsPlaylistsErrorsToJSON( + getPlaylistsPlaylistsErrors: GetPlaylistsPlaylistsErrors, +): string { + return JSON.stringify( + GetPlaylistsPlaylistsErrors$outboundSchema.parse( + getPlaylistsPlaylistsErrors, + ), + ); +} + +export function getPlaylistsPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const GetPlaylistsUnauthorized$inboundSchema: z.ZodType< GetPlaylistsUnauthorized, @@ -235,6 +258,24 @@ export namespace GetPlaylistsErrors$ { export type Outbound = GetPlaylistsErrors$Outbound; } +export function getPlaylistsErrorsToJSON( + getPlaylistsErrors: GetPlaylistsErrors, +): string { + return JSON.stringify( + GetPlaylistsErrors$outboundSchema.parse(getPlaylistsErrors), + ); +} + +export function getPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const GetPlaylistsBadRequest$inboundSchema: z.ZodType< GetPlaylistsBadRequest, diff --git a/src/sdk/models/errors/getrecentlyaddedlibrary.ts b/src/sdk/models/errors/getrecentlyaddedlibrary.ts index a24386ae..64eec58f 100644 --- a/src/sdk/models/errors/getrecentlyaddedlibrary.ts +++ b/src/sdk/models/errors/getrecentlyaddedlibrary.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetRecentlyAddedLibraryLibraryErrors = { code?: number | undefined; @@ -137,6 +140,27 @@ export namespace GetRecentlyAddedLibraryLibraryErrors$ { export type Outbound = GetRecentlyAddedLibraryLibraryErrors$Outbound; } +export function getRecentlyAddedLibraryLibraryErrorsToJSON( + getRecentlyAddedLibraryLibraryErrors: GetRecentlyAddedLibraryLibraryErrors, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryLibraryErrors$outboundSchema.parse( + getRecentlyAddedLibraryLibraryErrors, + ), + ); +} + +export function getRecentlyAddedLibraryLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetRecentlyAddedLibraryLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryUnauthorized$inboundSchema: z.ZodType< GetRecentlyAddedLibraryUnauthorized, @@ -241,6 +265,26 @@ export namespace GetRecentlyAddedLibraryErrors$ { export type Outbound = GetRecentlyAddedLibraryErrors$Outbound; } +export function getRecentlyAddedLibraryErrorsToJSON( + getRecentlyAddedLibraryErrors: GetRecentlyAddedLibraryErrors, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryErrors$outboundSchema.parse( + getRecentlyAddedLibraryErrors, + ), + ); +} + +export function getRecentlyAddedLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryBadRequest$inboundSchema: z.ZodType< GetRecentlyAddedLibraryBadRequest, diff --git a/src/sdk/models/errors/getrefreshlibrarymetadata.ts b/src/sdk/models/errors/getrefreshlibrarymetadata.ts index eb187724..b71a722b 100644 --- a/src/sdk/models/errors/getrefreshlibrarymetadata.ts +++ b/src/sdk/models/errors/getrefreshlibrarymetadata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetRefreshLibraryMetadataLibraryErrors = { code?: number | undefined; @@ -137,6 +140,28 @@ export namespace GetRefreshLibraryMetadataLibraryErrors$ { export type Outbound = GetRefreshLibraryMetadataLibraryErrors$Outbound; } +export function getRefreshLibraryMetadataLibraryErrorsToJSON( + getRefreshLibraryMetadataLibraryErrors: + GetRefreshLibraryMetadataLibraryErrors, +): string { + return JSON.stringify( + GetRefreshLibraryMetadataLibraryErrors$outboundSchema.parse( + getRefreshLibraryMetadataLibraryErrors, + ), + ); +} + +export function getRefreshLibraryMetadataLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetRefreshLibraryMetadataLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRefreshLibraryMetadataLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetRefreshLibraryMetadataUnauthorized$inboundSchema: z.ZodType< GetRefreshLibraryMetadataUnauthorized, @@ -241,6 +266,26 @@ export namespace GetRefreshLibraryMetadataErrors$ { export type Outbound = GetRefreshLibraryMetadataErrors$Outbound; } +export function getRefreshLibraryMetadataErrorsToJSON( + getRefreshLibraryMetadataErrors: GetRefreshLibraryMetadataErrors, +): string { + return JSON.stringify( + GetRefreshLibraryMetadataErrors$outboundSchema.parse( + getRefreshLibraryMetadataErrors, + ), + ); +} + +export function getRefreshLibraryMetadataErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRefreshLibraryMetadataErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRefreshLibraryMetadataErrors' from JSON`, + ); +} + /** @internal */ export const GetRefreshLibraryMetadataBadRequest$inboundSchema: z.ZodType< GetRefreshLibraryMetadataBadRequest, diff --git a/src/sdk/models/errors/getresizedphoto.ts b/src/sdk/models/errors/getresizedphoto.ts index b3617cbf..c707f6c7 100644 --- a/src/sdk/models/errors/getresizedphoto.ts +++ b/src/sdk/models/errors/getresizedphoto.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetResizedPhotoServerErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetResizedPhotoServerErrors$ { export type Outbound = GetResizedPhotoServerErrors$Outbound; } +export function getResizedPhotoServerErrorsToJSON( + getResizedPhotoServerErrors: GetResizedPhotoServerErrors, +): string { + return JSON.stringify( + GetResizedPhotoServerErrors$outboundSchema.parse( + getResizedPhotoServerErrors, + ), + ); +} + +export function getResizedPhotoServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResizedPhotoServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResizedPhotoServerErrors' from JSON`, + ); +} + /** @internal */ export const GetResizedPhotoUnauthorized$inboundSchema: z.ZodType< GetResizedPhotoUnauthorized, @@ -235,6 +258,24 @@ export namespace GetResizedPhotoErrors$ { export type Outbound = GetResizedPhotoErrors$Outbound; } +export function getResizedPhotoErrorsToJSON( + getResizedPhotoErrors: GetResizedPhotoErrors, +): string { + return JSON.stringify( + GetResizedPhotoErrors$outboundSchema.parse(getResizedPhotoErrors), + ); +} + +export function getResizedPhotoErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResizedPhotoErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResizedPhotoErrors' from JSON`, + ); +} + /** @internal */ export const GetResizedPhotoBadRequest$inboundSchema: z.ZodType< GetResizedPhotoBadRequest, diff --git a/src/sdk/models/errors/getresourcesstatistics.ts b/src/sdk/models/errors/getresourcesstatistics.ts index 57361d4a..95efa93f 100644 --- a/src/sdk/models/errors/getresourcesstatistics.ts +++ b/src/sdk/models/errors/getresourcesstatistics.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetResourcesStatisticsStatisticsErrors = { code?: number | undefined; @@ -137,6 +140,28 @@ export namespace GetResourcesStatisticsStatisticsErrors$ { export type Outbound = GetResourcesStatisticsStatisticsErrors$Outbound; } +export function getResourcesStatisticsStatisticsErrorsToJSON( + getResourcesStatisticsStatisticsErrors: + GetResourcesStatisticsStatisticsErrors, +): string { + return JSON.stringify( + GetResourcesStatisticsStatisticsErrors$outboundSchema.parse( + getResourcesStatisticsStatisticsErrors, + ), + ); +} + +export function getResourcesStatisticsStatisticsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetResourcesStatisticsStatisticsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResourcesStatisticsStatisticsErrors' from JSON`, + ); +} + /** @internal */ export const GetResourcesStatisticsUnauthorized$inboundSchema: z.ZodType< GetResourcesStatisticsUnauthorized, @@ -240,6 +265,26 @@ export namespace GetResourcesStatisticsErrors$ { export type Outbound = GetResourcesStatisticsErrors$Outbound; } +export function getResourcesStatisticsErrorsToJSON( + getResourcesStatisticsErrors: GetResourcesStatisticsErrors, +): string { + return JSON.stringify( + GetResourcesStatisticsErrors$outboundSchema.parse( + getResourcesStatisticsErrors, + ), + ); +} + +export function getResourcesStatisticsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResourcesStatisticsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResourcesStatisticsErrors' from JSON`, + ); +} + /** @internal */ export const GetResourcesStatisticsBadRequest$inboundSchema: z.ZodType< GetResourcesStatisticsBadRequest, diff --git a/src/sdk/models/errors/getsearchalllibraries.ts b/src/sdk/models/errors/getsearchalllibraries.ts index 7f5e976b..27854d7f 100644 --- a/src/sdk/models/errors/getsearchalllibraries.ts +++ b/src/sdk/models/errors/getsearchalllibraries.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSearchAllLibrariesLibraryErrors = { code?: number | undefined; @@ -136,6 +139,27 @@ export namespace GetSearchAllLibrariesLibraryErrors$ { export type Outbound = GetSearchAllLibrariesLibraryErrors$Outbound; } +export function getSearchAllLibrariesLibraryErrorsToJSON( + getSearchAllLibrariesLibraryErrors: GetSearchAllLibrariesLibraryErrors, +): string { + return JSON.stringify( + GetSearchAllLibrariesLibraryErrors$outboundSchema.parse( + getSearchAllLibrariesLibraryErrors, + ), + ); +} + +export function getSearchAllLibrariesLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSearchAllLibrariesLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesUnauthorized$inboundSchema: z.ZodType< GetSearchAllLibrariesUnauthorized, @@ -239,6 +263,26 @@ export namespace GetSearchAllLibrariesErrors$ { export type Outbound = GetSearchAllLibrariesErrors$Outbound; } +export function getSearchAllLibrariesErrorsToJSON( + getSearchAllLibrariesErrors: GetSearchAllLibrariesErrors, +): string { + return JSON.stringify( + GetSearchAllLibrariesErrors$outboundSchema.parse( + getSearchAllLibrariesErrors, + ), + ); +} + +export function getSearchAllLibrariesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesErrors' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesBadRequest$inboundSchema: z.ZodType< GetSearchAllLibrariesBadRequest, diff --git a/src/sdk/models/errors/getsearchlibrary.ts b/src/sdk/models/errors/getsearchlibrary.ts index 4fcde493..36da99b9 100644 --- a/src/sdk/models/errors/getsearchlibrary.ts +++ b/src/sdk/models/errors/getsearchlibrary.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSearchLibraryLibraryErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetSearchLibraryLibraryErrors$ { export type Outbound = GetSearchLibraryLibraryErrors$Outbound; } +export function getSearchLibraryLibraryErrorsToJSON( + getSearchLibraryLibraryErrors: GetSearchLibraryLibraryErrors, +): string { + return JSON.stringify( + GetSearchLibraryLibraryErrors$outboundSchema.parse( + getSearchLibraryLibraryErrors, + ), + ); +} + +export function getSearchLibraryLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetSearchLibraryUnauthorized$inboundSchema: z.ZodType< GetSearchLibraryUnauthorized, @@ -236,6 +259,24 @@ export namespace GetSearchLibraryErrors$ { export type Outbound = GetSearchLibraryErrors$Outbound; } +export function getSearchLibraryErrorsToJSON( + getSearchLibraryErrors: GetSearchLibraryErrors, +): string { + return JSON.stringify( + GetSearchLibraryErrors$outboundSchema.parse(getSearchLibraryErrors), + ); +} + +export function getSearchLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetSearchLibraryBadRequest$inboundSchema: z.ZodType< GetSearchLibraryBadRequest, diff --git a/src/sdk/models/errors/getsearchresults.ts b/src/sdk/models/errors/getsearchresults.ts index c42976cb..01292dd7 100644 --- a/src/sdk/models/errors/getsearchresults.ts +++ b/src/sdk/models/errors/getsearchresults.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSearchResultsSearchErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetSearchResultsSearchErrors$ { export type Outbound = GetSearchResultsSearchErrors$Outbound; } +export function getSearchResultsSearchErrorsToJSON( + getSearchResultsSearchErrors: GetSearchResultsSearchErrors, +): string { + return JSON.stringify( + GetSearchResultsSearchErrors$outboundSchema.parse( + getSearchResultsSearchErrors, + ), + ); +} + +export function getSearchResultsSearchErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsSearchErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsSearchErrors' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsUnauthorized$inboundSchema: z.ZodType< GetSearchResultsUnauthorized, @@ -235,6 +258,24 @@ export namespace GetSearchResultsErrors$ { export type Outbound = GetSearchResultsErrors$Outbound; } +export function getSearchResultsErrorsToJSON( + getSearchResultsErrors: GetSearchResultsErrors, +): string { + return JSON.stringify( + GetSearchResultsErrors$outboundSchema.parse(getSearchResultsErrors), + ); +} + +export function getSearchResultsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsErrors' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsBadRequest$inboundSchema: z.ZodType< GetSearchResultsBadRequest, diff --git a/src/sdk/models/errors/getserveractivities.ts b/src/sdk/models/errors/getserveractivities.ts index 6a06e9a6..fb33c755 100644 --- a/src/sdk/models/errors/getserveractivities.ts +++ b/src/sdk/models/errors/getserveractivities.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetServerActivitiesActivitiesErrors = { code?: number | undefined; @@ -137,6 +140,27 @@ export namespace GetServerActivitiesActivitiesErrors$ { export type Outbound = GetServerActivitiesActivitiesErrors$Outbound; } +export function getServerActivitiesActivitiesErrorsToJSON( + getServerActivitiesActivitiesErrors: GetServerActivitiesActivitiesErrors, +): string { + return JSON.stringify( + GetServerActivitiesActivitiesErrors$outboundSchema.parse( + getServerActivitiesActivitiesErrors, + ), + ); +} + +export function getServerActivitiesActivitiesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetServerActivitiesActivitiesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerActivitiesActivitiesErrors' from JSON`, + ); +} + /** @internal */ export const GetServerActivitiesUnauthorized$inboundSchema: z.ZodType< GetServerActivitiesUnauthorized, @@ -239,6 +263,24 @@ export namespace GetServerActivitiesErrors$ { export type Outbound = GetServerActivitiesErrors$Outbound; } +export function getServerActivitiesErrorsToJSON( + getServerActivitiesErrors: GetServerActivitiesErrors, +): string { + return JSON.stringify( + GetServerActivitiesErrors$outboundSchema.parse(getServerActivitiesErrors), + ); +} + +export function getServerActivitiesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerActivitiesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerActivitiesErrors' from JSON`, + ); +} + /** @internal */ export const GetServerActivitiesBadRequest$inboundSchema: z.ZodType< GetServerActivitiesBadRequest, diff --git a/src/sdk/models/errors/getservercapabilities.ts b/src/sdk/models/errors/getservercapabilities.ts index 6f9b7486..a578a281 100644 --- a/src/sdk/models/errors/getservercapabilities.ts +++ b/src/sdk/models/errors/getservercapabilities.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetServerCapabilitiesErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetServerCapabilitiesErrors$ { export type Outbound = GetServerCapabilitiesErrors$Outbound; } +export function getServerCapabilitiesErrorsToJSON( + getServerCapabilitiesErrors: GetServerCapabilitiesErrors, +): string { + return JSON.stringify( + GetServerCapabilitiesErrors$outboundSchema.parse( + getServerCapabilitiesErrors, + ), + ); +} + +export function getServerCapabilitiesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerCapabilitiesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerCapabilitiesErrors' from JSON`, + ); +} + /** @internal */ export const GetServerCapabilitiesUnauthorized$inboundSchema: z.ZodType< GetServerCapabilitiesUnauthorized, @@ -233,6 +256,20 @@ export namespace Errors$ { export type Outbound = Errors$Outbound; } +export function errorsToJSON(errors: Errors): string { + return JSON.stringify(Errors$outboundSchema.parse(errors)); +} + +export function errorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Errors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Errors' from JSON`, + ); +} + /** @internal */ export const GetServerCapabilitiesBadRequest$inboundSchema: z.ZodType< GetServerCapabilitiesBadRequest, diff --git a/src/sdk/models/errors/getserverlist.ts b/src/sdk/models/errors/getserverlist.ts index e4baac1a..1e92616d 100644 --- a/src/sdk/models/errors/getserverlist.ts +++ b/src/sdk/models/errors/getserverlist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetServerListServerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetServerListServerErrors$ { export type Outbound = GetServerListServerErrors$Outbound; } +export function getServerListServerErrorsToJSON( + getServerListServerErrors: GetServerListServerErrors, +): string { + return JSON.stringify( + GetServerListServerErrors$outboundSchema.parse(getServerListServerErrors), + ); +} + +export function getServerListServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerListServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerListServerErrors' from JSON`, + ); +} + /** @internal */ export const GetServerListUnauthorized$inboundSchema: z.ZodType< GetServerListUnauthorized, @@ -235,6 +256,24 @@ export namespace GetServerListErrors$ { export type Outbound = GetServerListErrors$Outbound; } +export function getServerListErrorsToJSON( + getServerListErrors: GetServerListErrors, +): string { + return JSON.stringify( + GetServerListErrors$outboundSchema.parse(getServerListErrors), + ); +} + +export function getServerListErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerListErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerListErrors' from JSON`, + ); +} + /** @internal */ export const GetServerListBadRequest$inboundSchema: z.ZodType< GetServerListBadRequest, diff --git a/src/sdk/models/errors/getserverpreferences.ts b/src/sdk/models/errors/getserverpreferences.ts index e6495436..84c28784 100644 --- a/src/sdk/models/errors/getserverpreferences.ts +++ b/src/sdk/models/errors/getserverpreferences.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetServerPreferencesServerErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetServerPreferencesServerErrors$ { export type Outbound = GetServerPreferencesServerErrors$Outbound; } +export function getServerPreferencesServerErrorsToJSON( + getServerPreferencesServerErrors: GetServerPreferencesServerErrors, +): string { + return JSON.stringify( + GetServerPreferencesServerErrors$outboundSchema.parse( + getServerPreferencesServerErrors, + ), + ); +} + +export function getServerPreferencesServerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerPreferencesServerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerPreferencesServerErrors' from JSON`, + ); +} + /** @internal */ export const GetServerPreferencesUnauthorized$inboundSchema: z.ZodType< GetServerPreferencesUnauthorized, @@ -236,6 +259,24 @@ export namespace GetServerPreferencesErrors$ { export type Outbound = GetServerPreferencesErrors$Outbound; } +export function getServerPreferencesErrorsToJSON( + getServerPreferencesErrors: GetServerPreferencesErrors, +): string { + return JSON.stringify( + GetServerPreferencesErrors$outboundSchema.parse(getServerPreferencesErrors), + ); +} + +export function getServerPreferencesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerPreferencesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerPreferencesErrors' from JSON`, + ); +} + /** @internal */ export const GetServerPreferencesBadRequest$inboundSchema: z.ZodType< GetServerPreferencesBadRequest, diff --git a/src/sdk/models/errors/getserverresources.ts b/src/sdk/models/errors/getserverresources.ts index e302d403..d50ea2cc 100644 --- a/src/sdk/models/errors/getserverresources.ts +++ b/src/sdk/models/errors/getserverresources.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetServerResourcesPlexErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetServerResourcesPlexErrors$ { export type Outbound = GetServerResourcesPlexErrors$Outbound; } +export function getServerResourcesPlexErrorsToJSON( + getServerResourcesPlexErrors: GetServerResourcesPlexErrors, +): string { + return JSON.stringify( + GetServerResourcesPlexErrors$outboundSchema.parse( + getServerResourcesPlexErrors, + ), + ); +} + +export function getServerResourcesPlexErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerResourcesPlexErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerResourcesPlexErrors' from JSON`, + ); +} + /** @internal */ export const GetServerResourcesUnauthorized$inboundSchema: z.ZodType< GetServerResourcesUnauthorized, @@ -235,6 +258,24 @@ export namespace GetServerResourcesErrors$ { export type Outbound = GetServerResourcesErrors$Outbound; } +export function getServerResourcesErrorsToJSON( + getServerResourcesErrors: GetServerResourcesErrors, +): string { + return JSON.stringify( + GetServerResourcesErrors$outboundSchema.parse(getServerResourcesErrors), + ); +} + +export function getServerResourcesErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerResourcesErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerResourcesErrors' from JSON`, + ); +} + /** @internal */ export const GetServerResourcesBadRequest$inboundSchema: z.ZodType< GetServerResourcesBadRequest, diff --git a/src/sdk/models/errors/getsessionhistory.ts b/src/sdk/models/errors/getsessionhistory.ts index dd12c18f..dd5d4f08 100644 --- a/src/sdk/models/errors/getsessionhistory.ts +++ b/src/sdk/models/errors/getsessionhistory.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSessionHistorySessionsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetSessionHistorySessionsErrors$ { export type Outbound = GetSessionHistorySessionsErrors$Outbound; } +export function getSessionHistorySessionsErrorsToJSON( + getSessionHistorySessionsErrors: GetSessionHistorySessionsErrors, +): string { + return JSON.stringify( + GetSessionHistorySessionsErrors$outboundSchema.parse( + getSessionHistorySessionsErrors, + ), + ); +} + +export function getSessionHistorySessionsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistorySessionsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistorySessionsErrors' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryUnauthorized$inboundSchema: z.ZodType< GetSessionHistoryUnauthorized, @@ -236,6 +259,24 @@ export namespace GetSessionHistoryErrors$ { export type Outbound = GetSessionHistoryErrors$Outbound; } +export function getSessionHistoryErrorsToJSON( + getSessionHistoryErrors: GetSessionHistoryErrors, +): string { + return JSON.stringify( + GetSessionHistoryErrors$outboundSchema.parse(getSessionHistoryErrors), + ); +} + +export function getSessionHistoryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistoryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistoryErrors' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryBadRequest$inboundSchema: z.ZodType< GetSessionHistoryBadRequest, diff --git a/src/sdk/models/errors/getsessions.ts b/src/sdk/models/errors/getsessions.ts index e367a021..84d1def3 100644 --- a/src/sdk/models/errors/getsessions.ts +++ b/src/sdk/models/errors/getsessions.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSessionsSessionsErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetSessionsSessionsErrors$ { export type Outbound = GetSessionsSessionsErrors$Outbound; } +export function getSessionsSessionsErrorsToJSON( + getSessionsSessionsErrors: GetSessionsSessionsErrors, +): string { + return JSON.stringify( + GetSessionsSessionsErrors$outboundSchema.parse(getSessionsSessionsErrors), + ); +} + +export function getSessionsSessionsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsSessionsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsSessionsErrors' from JSON`, + ); +} + /** @internal */ export const GetSessionsUnauthorized$inboundSchema: z.ZodType< GetSessionsUnauthorized, @@ -235,6 +256,24 @@ export namespace GetSessionsErrors$ { export type Outbound = GetSessionsErrors$Outbound; } +export function getSessionsErrorsToJSON( + getSessionsErrors: GetSessionsErrors, +): string { + return JSON.stringify( + GetSessionsErrors$outboundSchema.parse(getSessionsErrors), + ); +} + +export function getSessionsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsErrors' from JSON`, + ); +} + /** @internal */ export const GetSessionsBadRequest$inboundSchema: z.ZodType< GetSessionsBadRequest, diff --git a/src/sdk/models/errors/getsourceconnectioninformation.ts b/src/sdk/models/errors/getsourceconnectioninformation.ts index 884f0509..7b2b30d8 100644 --- a/src/sdk/models/errors/getsourceconnectioninformation.ts +++ b/src/sdk/models/errors/getsourceconnectioninformation.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetSourceConnectionInformationAuthenticationErrors = { code?: number | undefined; @@ -144,6 +147,33 @@ export namespace GetSourceConnectionInformationAuthenticationErrors$ { GetSourceConnectionInformationAuthenticationErrors$Outbound; } +export function getSourceConnectionInformationAuthenticationErrorsToJSON( + getSourceConnectionInformationAuthenticationErrors: + GetSourceConnectionInformationAuthenticationErrors, +): string { + return JSON.stringify( + GetSourceConnectionInformationAuthenticationErrors$outboundSchema.parse( + getSourceConnectionInformationAuthenticationErrors, + ), + ); +} + +export function getSourceConnectionInformationAuthenticationErrorsFromJSON( + jsonString: string, +): SafeParseResult< + GetSourceConnectionInformationAuthenticationErrors, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + GetSourceConnectionInformationAuthenticationErrors$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'GetSourceConnectionInformationAuthenticationErrors' from JSON`, + ); +} + /** @internal */ export const GetSourceConnectionInformationUnauthorized$inboundSchema: z.ZodType = @@ -253,6 +283,27 @@ export namespace GetSourceConnectionInformationErrors$ { export type Outbound = GetSourceConnectionInformationErrors$Outbound; } +export function getSourceConnectionInformationErrorsToJSON( + getSourceConnectionInformationErrors: GetSourceConnectionInformationErrors, +): string { + return JSON.stringify( + GetSourceConnectionInformationErrors$outboundSchema.parse( + getSourceConnectionInformationErrors, + ), + ); +} + +export function getSourceConnectionInformationErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSourceConnectionInformationErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSourceConnectionInformationErrors' from JSON`, + ); +} + /** @internal */ export const GetSourceConnectionInformationBadRequest$inboundSchema: z.ZodType< GetSourceConnectionInformationBadRequest, diff --git a/src/sdk/models/errors/getstatistics.ts b/src/sdk/models/errors/getstatistics.ts index 600e5e08..900ef9cc 100644 --- a/src/sdk/models/errors/getstatistics.ts +++ b/src/sdk/models/errors/getstatistics.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetStatisticsStatisticsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetStatisticsStatisticsErrors$ { export type Outbound = GetStatisticsStatisticsErrors$Outbound; } +export function getStatisticsStatisticsErrorsToJSON( + getStatisticsStatisticsErrors: GetStatisticsStatisticsErrors, +): string { + return JSON.stringify( + GetStatisticsStatisticsErrors$outboundSchema.parse( + getStatisticsStatisticsErrors, + ), + ); +} + +export function getStatisticsStatisticsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsStatisticsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsStatisticsErrors' from JSON`, + ); +} + /** @internal */ export const GetStatisticsUnauthorized$inboundSchema: z.ZodType< GetStatisticsUnauthorized, @@ -236,6 +259,24 @@ export namespace GetStatisticsErrors$ { export type Outbound = GetStatisticsErrors$Outbound; } +export function getStatisticsErrorsToJSON( + getStatisticsErrors: GetStatisticsErrors, +): string { + return JSON.stringify( + GetStatisticsErrors$outboundSchema.parse(getStatisticsErrors), + ); +} + +export function getStatisticsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsErrors' from JSON`, + ); +} + /** @internal */ export const GetStatisticsBadRequest$inboundSchema: z.ZodType< GetStatisticsBadRequest, diff --git a/src/sdk/models/errors/getthumbimage.ts b/src/sdk/models/errors/getthumbimage.ts index ecdf423c..d6733447 100644 --- a/src/sdk/models/errors/getthumbimage.ts +++ b/src/sdk/models/errors/getthumbimage.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetThumbImageMediaErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetThumbImageMediaErrors$ { export type Outbound = GetThumbImageMediaErrors$Outbound; } +export function getThumbImageMediaErrorsToJSON( + getThumbImageMediaErrors: GetThumbImageMediaErrors, +): string { + return JSON.stringify( + GetThumbImageMediaErrors$outboundSchema.parse(getThumbImageMediaErrors), + ); +} + +export function getThumbImageMediaErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetThumbImageMediaErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetThumbImageMediaErrors' from JSON`, + ); +} + /** @internal */ export const GetThumbImageUnauthorized$inboundSchema: z.ZodType< GetThumbImageUnauthorized, @@ -235,6 +256,24 @@ export namespace GetThumbImageErrors$ { export type Outbound = GetThumbImageErrors$Outbound; } +export function getThumbImageErrorsToJSON( + getThumbImageErrors: GetThumbImageErrors, +): string { + return JSON.stringify( + GetThumbImageErrors$outboundSchema.parse(getThumbImageErrors), + ); +} + +export function getThumbImageErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetThumbImageErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetThumbImageErrors' from JSON`, + ); +} + /** @internal */ export const GetThumbImageBadRequest$inboundSchema: z.ZodType< GetThumbImageBadRequest, diff --git a/src/sdk/models/errors/gettimeline.ts b/src/sdk/models/errors/gettimeline.ts index d4ab7974..567d8882 100644 --- a/src/sdk/models/errors/gettimeline.ts +++ b/src/sdk/models/errors/gettimeline.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetTimelineVideoErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetTimelineVideoErrors$ { export type Outbound = GetTimelineVideoErrors$Outbound; } +export function getTimelineVideoErrorsToJSON( + getTimelineVideoErrors: GetTimelineVideoErrors, +): string { + return JSON.stringify( + GetTimelineVideoErrors$outboundSchema.parse(getTimelineVideoErrors), + ); +} + +export function getTimelineVideoErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTimelineVideoErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTimelineVideoErrors' from JSON`, + ); +} + /** @internal */ export const GetTimelineUnauthorized$inboundSchema: z.ZodType< GetTimelineUnauthorized, @@ -235,6 +256,24 @@ export namespace GetTimelineErrors$ { export type Outbound = GetTimelineErrors$Outbound; } +export function getTimelineErrorsToJSON( + getTimelineErrors: GetTimelineErrors, +): string { + return JSON.stringify( + GetTimelineErrors$outboundSchema.parse(getTimelineErrors), + ); +} + +export function getTimelineErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTimelineErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTimelineErrors' from JSON`, + ); +} + /** @internal */ export const GetTimelineBadRequest$inboundSchema: z.ZodType< GetTimelineBadRequest, diff --git a/src/sdk/models/errors/gettokenbypinid.ts b/src/sdk/models/errors/gettokenbypinid.ts index 1b920462..85289c96 100644 --- a/src/sdk/models/errors/gettokenbypinid.ts +++ b/src/sdk/models/errors/gettokenbypinid.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetTokenByPinIdPlexErrors = { code?: number | undefined; @@ -131,6 +134,24 @@ export namespace GetTokenByPinIdPlexErrors$ { export type Outbound = GetTokenByPinIdPlexErrors$Outbound; } +export function getTokenByPinIdPlexErrorsToJSON( + getTokenByPinIdPlexErrors: GetTokenByPinIdPlexErrors, +): string { + return JSON.stringify( + GetTokenByPinIdPlexErrors$outboundSchema.parse(getTokenByPinIdPlexErrors), + ); +} + +export function getTokenByPinIdPlexErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenByPinIdPlexErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenByPinIdPlexErrors' from JSON`, + ); +} + /** @internal */ export const GetTokenByPinIdResponseBody$inboundSchema: z.ZodType< GetTokenByPinIdResponseBody, @@ -231,6 +252,24 @@ export namespace GetTokenByPinIdErrors$ { export type Outbound = GetTokenByPinIdErrors$Outbound; } +export function getTokenByPinIdErrorsToJSON( + getTokenByPinIdErrors: GetTokenByPinIdErrors, +): string { + return JSON.stringify( + GetTokenByPinIdErrors$outboundSchema.parse(getTokenByPinIdErrors), + ); +} + +export function getTokenByPinIdErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenByPinIdErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenByPinIdErrors' from JSON`, + ); +} + /** @internal */ export const GetTokenByPinIdBadRequest$inboundSchema: z.ZodType< GetTokenByPinIdBadRequest, diff --git a/src/sdk/models/errors/gettokendetails.ts b/src/sdk/models/errors/gettokendetails.ts index 35834971..9e19df78 100644 --- a/src/sdk/models/errors/gettokendetails.ts +++ b/src/sdk/models/errors/gettokendetails.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetTokenDetailsAuthenticationErrors = { code?: number | undefined; @@ -137,6 +140,27 @@ export namespace GetTokenDetailsAuthenticationErrors$ { export type Outbound = GetTokenDetailsAuthenticationErrors$Outbound; } +export function getTokenDetailsAuthenticationErrorsToJSON( + getTokenDetailsAuthenticationErrors: GetTokenDetailsAuthenticationErrors, +): string { + return JSON.stringify( + GetTokenDetailsAuthenticationErrors$outboundSchema.parse( + getTokenDetailsAuthenticationErrors, + ), + ); +} + +export function getTokenDetailsAuthenticationErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetTokenDetailsAuthenticationErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenDetailsAuthenticationErrors' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsUnauthorized$inboundSchema: z.ZodType< GetTokenDetailsUnauthorized, @@ -239,6 +263,24 @@ export namespace GetTokenDetailsErrors$ { export type Outbound = GetTokenDetailsErrors$Outbound; } +export function getTokenDetailsErrorsToJSON( + getTokenDetailsErrors: GetTokenDetailsErrors, +): string { + return JSON.stringify( + GetTokenDetailsErrors$outboundSchema.parse(getTokenDetailsErrors), + ); +} + +export function getTokenDetailsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenDetailsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenDetailsErrors' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsBadRequest$inboundSchema: z.ZodType< GetTokenDetailsBadRequest, diff --git a/src/sdk/models/errors/gettopwatchedcontent.ts b/src/sdk/models/errors/gettopwatchedcontent.ts index 39d6193f..32c83de1 100644 --- a/src/sdk/models/errors/gettopwatchedcontent.ts +++ b/src/sdk/models/errors/gettopwatchedcontent.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetTopWatchedContentLibraryErrors = { code?: number | undefined; @@ -136,6 +139,26 @@ export namespace GetTopWatchedContentLibraryErrors$ { export type Outbound = GetTopWatchedContentLibraryErrors$Outbound; } +export function getTopWatchedContentLibraryErrorsToJSON( + getTopWatchedContentLibraryErrors: GetTopWatchedContentLibraryErrors, +): string { + return JSON.stringify( + GetTopWatchedContentLibraryErrors$outboundSchema.parse( + getTopWatchedContentLibraryErrors, + ), + ); +} + +export function getTopWatchedContentLibraryErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentLibraryErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentLibraryErrors' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentUnauthorized$inboundSchema: z.ZodType< GetTopWatchedContentUnauthorized, @@ -237,6 +260,24 @@ export namespace GetTopWatchedContentErrors$ { export type Outbound = GetTopWatchedContentErrors$Outbound; } +export function getTopWatchedContentErrorsToJSON( + getTopWatchedContentErrors: GetTopWatchedContentErrors, +): string { + return JSON.stringify( + GetTopWatchedContentErrors$outboundSchema.parse(getTopWatchedContentErrors), + ); +} + +export function getTopWatchedContentErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentErrors' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentBadRequest$inboundSchema: z.ZodType< GetTopWatchedContentBadRequest, diff --git a/src/sdk/models/errors/gettranscodesessions.ts b/src/sdk/models/errors/gettranscodesessions.ts index 52df5146..c629633d 100644 --- a/src/sdk/models/errors/gettranscodesessions.ts +++ b/src/sdk/models/errors/gettranscodesessions.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetTranscodeSessionsSessionsErrors = { code?: number | undefined; @@ -136,6 +139,27 @@ export namespace GetTranscodeSessionsSessionsErrors$ { export type Outbound = GetTranscodeSessionsSessionsErrors$Outbound; } +export function getTranscodeSessionsSessionsErrorsToJSON( + getTranscodeSessionsSessionsErrors: GetTranscodeSessionsSessionsErrors, +): string { + return JSON.stringify( + GetTranscodeSessionsSessionsErrors$outboundSchema.parse( + getTranscodeSessionsSessionsErrors, + ), + ); +} + +export function getTranscodeSessionsSessionsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetTranscodeSessionsSessionsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTranscodeSessionsSessionsErrors' from JSON`, + ); +} + /** @internal */ export const GetTranscodeSessionsUnauthorized$inboundSchema: z.ZodType< GetTranscodeSessionsUnauthorized, @@ -238,6 +262,24 @@ export namespace GetTranscodeSessionsErrors$ { export type Outbound = GetTranscodeSessionsErrors$Outbound; } +export function getTranscodeSessionsErrorsToJSON( + getTranscodeSessionsErrors: GetTranscodeSessionsErrors, +): string { + return JSON.stringify( + GetTranscodeSessionsErrors$outboundSchema.parse(getTranscodeSessionsErrors), + ); +} + +export function getTranscodeSessionsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTranscodeSessionsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTranscodeSessionsErrors' from JSON`, + ); +} + /** @internal */ export const GetTranscodeSessionsBadRequest$inboundSchema: z.ZodType< GetTranscodeSessionsBadRequest, diff --git a/src/sdk/models/errors/gettransienttoken.ts b/src/sdk/models/errors/gettransienttoken.ts index 6b8a635b..b0b0724b 100644 --- a/src/sdk/models/errors/gettransienttoken.ts +++ b/src/sdk/models/errors/gettransienttoken.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetTransientTokenAuthenticationErrors = { code?: number | undefined; @@ -137,6 +140,27 @@ export namespace GetTransientTokenAuthenticationErrors$ { export type Outbound = GetTransientTokenAuthenticationErrors$Outbound; } +export function getTransientTokenAuthenticationErrorsToJSON( + getTransientTokenAuthenticationErrors: GetTransientTokenAuthenticationErrors, +): string { + return JSON.stringify( + GetTransientTokenAuthenticationErrors$outboundSchema.parse( + getTransientTokenAuthenticationErrors, + ), + ); +} + +export function getTransientTokenAuthenticationErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetTransientTokenAuthenticationErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTransientTokenAuthenticationErrors' from JSON`, + ); +} + /** @internal */ export const GetTransientTokenUnauthorized$inboundSchema: z.ZodType< GetTransientTokenUnauthorized, @@ -239,6 +263,24 @@ export namespace GetTransientTokenErrors$ { export type Outbound = GetTransientTokenErrors$Outbound; } +export function getTransientTokenErrorsToJSON( + getTransientTokenErrors: GetTransientTokenErrors, +): string { + return JSON.stringify( + GetTransientTokenErrors$outboundSchema.parse(getTransientTokenErrors), + ); +} + +export function getTransientTokenErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTransientTokenErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTransientTokenErrors' from JSON`, + ); +} + /** @internal */ export const GetTransientTokenBadRequest$inboundSchema: z.ZodType< GetTransientTokenBadRequest, diff --git a/src/sdk/models/errors/getupdatestatus.ts b/src/sdk/models/errors/getupdatestatus.ts index f1d33375..0da32129 100644 --- a/src/sdk/models/errors/getupdatestatus.ts +++ b/src/sdk/models/errors/getupdatestatus.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetUpdateStatusUpdaterErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetUpdateStatusUpdaterErrors$ { export type Outbound = GetUpdateStatusUpdaterErrors$Outbound; } +export function getUpdateStatusUpdaterErrorsToJSON( + getUpdateStatusUpdaterErrors: GetUpdateStatusUpdaterErrors, +): string { + return JSON.stringify( + GetUpdateStatusUpdaterErrors$outboundSchema.parse( + getUpdateStatusUpdaterErrors, + ), + ); +} + +export function getUpdateStatusUpdaterErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUpdateStatusUpdaterErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUpdateStatusUpdaterErrors' from JSON`, + ); +} + /** @internal */ export const GetUpdateStatusUnauthorized$inboundSchema: z.ZodType< GetUpdateStatusUnauthorized, @@ -235,6 +258,24 @@ export namespace GetUpdateStatusErrors$ { export type Outbound = GetUpdateStatusErrors$Outbound; } +export function getUpdateStatusErrorsToJSON( + getUpdateStatusErrors: GetUpdateStatusErrors, +): string { + return JSON.stringify( + GetUpdateStatusErrors$outboundSchema.parse(getUpdateStatusErrors), + ); +} + +export function getUpdateStatusErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUpdateStatusErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUpdateStatusErrors' from JSON`, + ); +} + /** @internal */ export const GetUpdateStatusBadRequest$inboundSchema: z.ZodType< GetUpdateStatusBadRequest, diff --git a/src/sdk/models/errors/getuserfriends.ts b/src/sdk/models/errors/getuserfriends.ts index 78fbcb08..3f79a6a2 100644 --- a/src/sdk/models/errors/getuserfriends.ts +++ b/src/sdk/models/errors/getuserfriends.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetUserFriendsPlexErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace GetUserFriendsPlexErrors$ { export type Outbound = GetUserFriendsPlexErrors$Outbound; } +export function getUserFriendsPlexErrorsToJSON( + getUserFriendsPlexErrors: GetUserFriendsPlexErrors, +): string { + return JSON.stringify( + GetUserFriendsPlexErrors$outboundSchema.parse(getUserFriendsPlexErrors), + ); +} + +export function getUserFriendsPlexErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUserFriendsPlexErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUserFriendsPlexErrors' from JSON`, + ); +} + /** @internal */ export const GetUserFriendsUnauthorized$inboundSchema: z.ZodType< GetUserFriendsUnauthorized, @@ -235,6 +256,24 @@ export namespace GetUserFriendsErrors$ { export type Outbound = GetUserFriendsErrors$Outbound; } +export function getUserFriendsErrorsToJSON( + getUserFriendsErrors: GetUserFriendsErrors, +): string { + return JSON.stringify( + GetUserFriendsErrors$outboundSchema.parse(getUserFriendsErrors), + ); +} + +export function getUserFriendsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUserFriendsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUserFriendsErrors' from JSON`, + ); +} + /** @internal */ export const GetUserFriendsBadRequest$inboundSchema: z.ZodType< GetUserFriendsBadRequest, diff --git a/src/sdk/models/errors/getwatchlist.ts b/src/sdk/models/errors/getwatchlist.ts index ecfca2c4..a08a6a2b 100644 --- a/src/sdk/models/errors/getwatchlist.ts +++ b/src/sdk/models/errors/getwatchlist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type GetWatchListWatchlistErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace GetWatchListWatchlistErrors$ { export type Outbound = GetWatchListWatchlistErrors$Outbound; } +export function getWatchListWatchlistErrorsToJSON( + getWatchListWatchlistErrors: GetWatchListWatchlistErrors, +): string { + return JSON.stringify( + GetWatchListWatchlistErrors$outboundSchema.parse( + getWatchListWatchlistErrors, + ), + ); +} + +export function getWatchListWatchlistErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWatchListWatchlistErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWatchListWatchlistErrors' from JSON`, + ); +} + /** @internal */ export const GetWatchListUnauthorized$inboundSchema: z.ZodType< GetWatchListUnauthorized, @@ -235,6 +258,24 @@ export namespace GetWatchListErrors$ { export type Outbound = GetWatchListErrors$Outbound; } +export function getWatchListErrorsToJSON( + getWatchListErrors: GetWatchListErrors, +): string { + return JSON.stringify( + GetWatchListErrors$outboundSchema.parse(getWatchListErrors), + ); +} + +export function getWatchListErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWatchListErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWatchListErrors' from JSON`, + ); +} + /** @internal */ export const GetWatchListBadRequest$inboundSchema: z.ZodType< GetWatchListBadRequest, diff --git a/src/sdk/models/errors/logline.ts b/src/sdk/models/errors/logline.ts index 1fed1e6d..cf25d437 100644 --- a/src/sdk/models/errors/logline.ts +++ b/src/sdk/models/errors/logline.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type LogLineLogErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace LogLineLogErrors$ { export type Outbound = LogLineLogErrors$Outbound; } +export function logLineLogErrorsToJSON( + logLineLogErrors: LogLineLogErrors, +): string { + return JSON.stringify( + LogLineLogErrors$outboundSchema.parse(logLineLogErrors), + ); +} + +export function logLineLogErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogLineLogErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogLineLogErrors' from JSON`, + ); +} + /** @internal */ export const LogLineUnauthorized$inboundSchema: z.ZodType< LogLineUnauthorized, @@ -233,6 +254,20 @@ export namespace LogLineErrors$ { export type Outbound = LogLineErrors$Outbound; } +export function logLineErrorsToJSON(logLineErrors: LogLineErrors): string { + return JSON.stringify(LogLineErrors$outboundSchema.parse(logLineErrors)); +} + +export function logLineErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogLineErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogLineErrors' from JSON`, + ); +} + /** @internal */ export const LogLineBadRequest$inboundSchema: z.ZodType< LogLineBadRequest, diff --git a/src/sdk/models/errors/logmultiline.ts b/src/sdk/models/errors/logmultiline.ts index e176f09a..d728ab0e 100644 --- a/src/sdk/models/errors/logmultiline.ts +++ b/src/sdk/models/errors/logmultiline.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type LogMultiLineLogErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace LogMultiLineLogErrors$ { export type Outbound = LogMultiLineLogErrors$Outbound; } +export function logMultiLineLogErrorsToJSON( + logMultiLineLogErrors: LogMultiLineLogErrors, +): string { + return JSON.stringify( + LogMultiLineLogErrors$outboundSchema.parse(logMultiLineLogErrors), + ); +} + +export function logMultiLineLogErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogMultiLineLogErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogMultiLineLogErrors' from JSON`, + ); +} + /** @internal */ export const LogMultiLineUnauthorized$inboundSchema: z.ZodType< LogMultiLineUnauthorized, @@ -234,6 +255,24 @@ export namespace LogMultiLineErrors$ { export type Outbound = LogMultiLineErrors$Outbound; } +export function logMultiLineErrorsToJSON( + logMultiLineErrors: LogMultiLineErrors, +): string { + return JSON.stringify( + LogMultiLineErrors$outboundSchema.parse(logMultiLineErrors), + ); +} + +export function logMultiLineErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogMultiLineErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogMultiLineErrors' from JSON`, + ); +} + /** @internal */ export const LogMultiLineBadRequest$inboundSchema: z.ZodType< LogMultiLineBadRequest, diff --git a/src/sdk/models/errors/markplayed.ts b/src/sdk/models/errors/markplayed.ts index bafc4e85..782ab979 100644 --- a/src/sdk/models/errors/markplayed.ts +++ b/src/sdk/models/errors/markplayed.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type MarkPlayedMediaErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace MarkPlayedMediaErrors$ { export type Outbound = MarkPlayedMediaErrors$Outbound; } +export function markPlayedMediaErrorsToJSON( + markPlayedMediaErrors: MarkPlayedMediaErrors, +): string { + return JSON.stringify( + MarkPlayedMediaErrors$outboundSchema.parse(markPlayedMediaErrors), + ); +} + +export function markPlayedMediaErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkPlayedMediaErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkPlayedMediaErrors' from JSON`, + ); +} + /** @internal */ export const MarkPlayedUnauthorized$inboundSchema: z.ZodType< MarkPlayedUnauthorized, @@ -234,6 +255,24 @@ export namespace MarkPlayedErrors$ { export type Outbound = MarkPlayedErrors$Outbound; } +export function markPlayedErrorsToJSON( + markPlayedErrors: MarkPlayedErrors, +): string { + return JSON.stringify( + MarkPlayedErrors$outboundSchema.parse(markPlayedErrors), + ); +} + +export function markPlayedErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkPlayedErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkPlayedErrors' from JSON`, + ); +} + /** @internal */ export const MarkPlayedBadRequest$inboundSchema: z.ZodType< MarkPlayedBadRequest, diff --git a/src/sdk/models/errors/markunplayed.ts b/src/sdk/models/errors/markunplayed.ts index 2a5ecbde..16d9ac20 100644 --- a/src/sdk/models/errors/markunplayed.ts +++ b/src/sdk/models/errors/markunplayed.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type MarkUnplayedMediaErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace MarkUnplayedMediaErrors$ { export type Outbound = MarkUnplayedMediaErrors$Outbound; } +export function markUnplayedMediaErrorsToJSON( + markUnplayedMediaErrors: MarkUnplayedMediaErrors, +): string { + return JSON.stringify( + MarkUnplayedMediaErrors$outboundSchema.parse(markUnplayedMediaErrors), + ); +} + +export function markUnplayedMediaErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkUnplayedMediaErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkUnplayedMediaErrors' from JSON`, + ); +} + /** @internal */ export const MarkUnplayedUnauthorized$inboundSchema: z.ZodType< MarkUnplayedUnauthorized, @@ -235,6 +256,24 @@ export namespace MarkUnplayedErrors$ { export type Outbound = MarkUnplayedErrors$Outbound; } +export function markUnplayedErrorsToJSON( + markUnplayedErrors: MarkUnplayedErrors, +): string { + return JSON.stringify( + MarkUnplayedErrors$outboundSchema.parse(markUnplayedErrors), + ); +} + +export function markUnplayedErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkUnplayedErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkUnplayedErrors' from JSON`, + ); +} + /** @internal */ export const MarkUnplayedBadRequest$inboundSchema: z.ZodType< MarkUnplayedBadRequest, diff --git a/src/sdk/models/errors/performsearch.ts b/src/sdk/models/errors/performsearch.ts index 8c39410d..3fd3580b 100644 --- a/src/sdk/models/errors/performsearch.ts +++ b/src/sdk/models/errors/performsearch.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type PerformSearchSearchErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace PerformSearchSearchErrors$ { export type Outbound = PerformSearchSearchErrors$Outbound; } +export function performSearchSearchErrorsToJSON( + performSearchSearchErrors: PerformSearchSearchErrors, +): string { + return JSON.stringify( + PerformSearchSearchErrors$outboundSchema.parse(performSearchSearchErrors), + ); +} + +export function performSearchSearchErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformSearchSearchErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformSearchSearchErrors' from JSON`, + ); +} + /** @internal */ export const PerformSearchUnauthorized$inboundSchema: z.ZodType< PerformSearchUnauthorized, @@ -235,6 +256,24 @@ export namespace PerformSearchErrors$ { export type Outbound = PerformSearchErrors$Outbound; } +export function performSearchErrorsToJSON( + performSearchErrors: PerformSearchErrors, +): string { + return JSON.stringify( + PerformSearchErrors$outboundSchema.parse(performSearchErrors), + ); +} + +export function performSearchErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformSearchErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformSearchErrors' from JSON`, + ); +} + /** @internal */ export const PerformSearchBadRequest$inboundSchema: z.ZodType< PerformSearchBadRequest, diff --git a/src/sdk/models/errors/performvoicesearch.ts b/src/sdk/models/errors/performvoicesearch.ts index 934190fd..34fc39fe 100644 --- a/src/sdk/models/errors/performvoicesearch.ts +++ b/src/sdk/models/errors/performvoicesearch.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type PerformVoiceSearchSearchErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace PerformVoiceSearchSearchErrors$ { export type Outbound = PerformVoiceSearchSearchErrors$Outbound; } +export function performVoiceSearchSearchErrorsToJSON( + performVoiceSearchSearchErrors: PerformVoiceSearchSearchErrors, +): string { + return JSON.stringify( + PerformVoiceSearchSearchErrors$outboundSchema.parse( + performVoiceSearchSearchErrors, + ), + ); +} + +export function performVoiceSearchSearchErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformVoiceSearchSearchErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformVoiceSearchSearchErrors' from JSON`, + ); +} + /** @internal */ export const PerformVoiceSearchUnauthorized$inboundSchema: z.ZodType< PerformVoiceSearchUnauthorized, @@ -236,6 +259,24 @@ export namespace PerformVoiceSearchErrors$ { export type Outbound = PerformVoiceSearchErrors$Outbound; } +export function performVoiceSearchErrorsToJSON( + performVoiceSearchErrors: PerformVoiceSearchErrors, +): string { + return JSON.stringify( + PerformVoiceSearchErrors$outboundSchema.parse(performVoiceSearchErrors), + ); +} + +export function performVoiceSearchErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformVoiceSearchErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformVoiceSearchErrors' from JSON`, + ); +} + /** @internal */ export const PerformVoiceSearchBadRequest$inboundSchema: z.ZodType< PerformVoiceSearchBadRequest, diff --git a/src/sdk/models/errors/postuserssignindata.ts b/src/sdk/models/errors/postuserssignindata.ts index 3df22df6..79041f7b 100644 --- a/src/sdk/models/errors/postuserssignindata.ts +++ b/src/sdk/models/errors/postuserssignindata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type PostUsersSignInDataAuthenticationErrors = { code?: number | undefined; @@ -137,6 +140,33 @@ export namespace PostUsersSignInDataAuthenticationErrors$ { export type Outbound = PostUsersSignInDataAuthenticationErrors$Outbound; } +export function postUsersSignInDataAuthenticationErrorsToJSON( + postUsersSignInDataAuthenticationErrors: + PostUsersSignInDataAuthenticationErrors, +): string { + return JSON.stringify( + PostUsersSignInDataAuthenticationErrors$outboundSchema.parse( + postUsersSignInDataAuthenticationErrors, + ), + ); +} + +export function postUsersSignInDataAuthenticationErrorsFromJSON( + jsonString: string, +): SafeParseResult< + PostUsersSignInDataAuthenticationErrors, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + PostUsersSignInDataAuthenticationErrors$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'PostUsersSignInDataAuthenticationErrors' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataUnauthorized$inboundSchema: z.ZodType< PostUsersSignInDataUnauthorized, @@ -239,6 +269,24 @@ export namespace PostUsersSignInDataErrors$ { export type Outbound = PostUsersSignInDataErrors$Outbound; } +export function postUsersSignInDataErrorsToJSON( + postUsersSignInDataErrors: PostUsersSignInDataErrors, +): string { + return JSON.stringify( + PostUsersSignInDataErrors$outboundSchema.parse(postUsersSignInDataErrors), + ); +} + +export function postUsersSignInDataErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataErrors' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataBadRequest$inboundSchema: z.ZodType< PostUsersSignInDataBadRequest, diff --git a/src/sdk/models/errors/startalltasks.ts b/src/sdk/models/errors/startalltasks.ts index e734bbd7..486d74a2 100644 --- a/src/sdk/models/errors/startalltasks.ts +++ b/src/sdk/models/errors/startalltasks.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type StartAllTasksButlerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace StartAllTasksButlerErrors$ { export type Outbound = StartAllTasksButlerErrors$Outbound; } +export function startAllTasksButlerErrorsToJSON( + startAllTasksButlerErrors: StartAllTasksButlerErrors, +): string { + return JSON.stringify( + StartAllTasksButlerErrors$outboundSchema.parse(startAllTasksButlerErrors), + ); +} + +export function startAllTasksButlerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartAllTasksButlerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartAllTasksButlerErrors' from JSON`, + ); +} + /** @internal */ export const StartAllTasksUnauthorized$inboundSchema: z.ZodType< StartAllTasksUnauthorized, @@ -235,6 +256,24 @@ export namespace StartAllTasksErrors$ { export type Outbound = StartAllTasksErrors$Outbound; } +export function startAllTasksErrorsToJSON( + startAllTasksErrors: StartAllTasksErrors, +): string { + return JSON.stringify( + StartAllTasksErrors$outboundSchema.parse(startAllTasksErrors), + ); +} + +export function startAllTasksErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartAllTasksErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartAllTasksErrors' from JSON`, + ); +} + /** @internal */ export const StartAllTasksBadRequest$inboundSchema: z.ZodType< StartAllTasksBadRequest, diff --git a/src/sdk/models/errors/starttask.ts b/src/sdk/models/errors/starttask.ts index 9dce80c8..09f63fac 100644 --- a/src/sdk/models/errors/starttask.ts +++ b/src/sdk/models/errors/starttask.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type StartTaskButlerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace StartTaskButlerErrors$ { export type Outbound = StartTaskButlerErrors$Outbound; } +export function startTaskButlerErrorsToJSON( + startTaskButlerErrors: StartTaskButlerErrors, +): string { + return JSON.stringify( + StartTaskButlerErrors$outboundSchema.parse(startTaskButlerErrors), + ); +} + +export function startTaskButlerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartTaskButlerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartTaskButlerErrors' from JSON`, + ); +} + /** @internal */ export const StartTaskUnauthorized$inboundSchema: z.ZodType< StartTaskUnauthorized, @@ -234,6 +255,22 @@ export namespace StartTaskErrors$ { export type Outbound = StartTaskErrors$Outbound; } +export function startTaskErrorsToJSON( + startTaskErrors: StartTaskErrors, +): string { + return JSON.stringify(StartTaskErrors$outboundSchema.parse(startTaskErrors)); +} + +export function startTaskErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartTaskErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartTaskErrors' from JSON`, + ); +} + /** @internal */ export const StartTaskBadRequest$inboundSchema: z.ZodType< StartTaskBadRequest, diff --git a/src/sdk/models/errors/startuniversaltranscode.ts b/src/sdk/models/errors/startuniversaltranscode.ts index 0df24ff2..c1b7c247 100644 --- a/src/sdk/models/errors/startuniversaltranscode.ts +++ b/src/sdk/models/errors/startuniversaltranscode.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type StartUniversalTranscodeVideoErrors = { code?: number | undefined; @@ -136,6 +139,27 @@ export namespace StartUniversalTranscodeVideoErrors$ { export type Outbound = StartUniversalTranscodeVideoErrors$Outbound; } +export function startUniversalTranscodeVideoErrorsToJSON( + startUniversalTranscodeVideoErrors: StartUniversalTranscodeVideoErrors, +): string { + return JSON.stringify( + StartUniversalTranscodeVideoErrors$outboundSchema.parse( + startUniversalTranscodeVideoErrors, + ), + ); +} + +export function startUniversalTranscodeVideoErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + StartUniversalTranscodeVideoErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartUniversalTranscodeVideoErrors' from JSON`, + ); +} + /** @internal */ export const StartUniversalTranscodeUnauthorized$inboundSchema: z.ZodType< StartUniversalTranscodeUnauthorized, @@ -240,6 +264,26 @@ export namespace StartUniversalTranscodeErrors$ { export type Outbound = StartUniversalTranscodeErrors$Outbound; } +export function startUniversalTranscodeErrorsToJSON( + startUniversalTranscodeErrors: StartUniversalTranscodeErrors, +): string { + return JSON.stringify( + StartUniversalTranscodeErrors$outboundSchema.parse( + startUniversalTranscodeErrors, + ), + ); +} + +export function startUniversalTranscodeErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartUniversalTranscodeErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartUniversalTranscodeErrors' from JSON`, + ); +} + /** @internal */ export const StartUniversalTranscodeBadRequest$inboundSchema: z.ZodType< StartUniversalTranscodeBadRequest, diff --git a/src/sdk/models/errors/stopalltasks.ts b/src/sdk/models/errors/stopalltasks.ts index 90ce9246..49faefef 100644 --- a/src/sdk/models/errors/stopalltasks.ts +++ b/src/sdk/models/errors/stopalltasks.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type StopAllTasksButlerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace StopAllTasksButlerErrors$ { export type Outbound = StopAllTasksButlerErrors$Outbound; } +export function stopAllTasksButlerErrorsToJSON( + stopAllTasksButlerErrors: StopAllTasksButlerErrors, +): string { + return JSON.stringify( + StopAllTasksButlerErrors$outboundSchema.parse(stopAllTasksButlerErrors), + ); +} + +export function stopAllTasksButlerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopAllTasksButlerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopAllTasksButlerErrors' from JSON`, + ); +} + /** @internal */ export const StopAllTasksUnauthorized$inboundSchema: z.ZodType< StopAllTasksUnauthorized, @@ -235,6 +256,24 @@ export namespace StopAllTasksErrors$ { export type Outbound = StopAllTasksErrors$Outbound; } +export function stopAllTasksErrorsToJSON( + stopAllTasksErrors: StopAllTasksErrors, +): string { + return JSON.stringify( + StopAllTasksErrors$outboundSchema.parse(stopAllTasksErrors), + ); +} + +export function stopAllTasksErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopAllTasksErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopAllTasksErrors' from JSON`, + ); +} + /** @internal */ export const StopAllTasksBadRequest$inboundSchema: z.ZodType< StopAllTasksBadRequest, diff --git a/src/sdk/models/errors/stoptask.ts b/src/sdk/models/errors/stoptask.ts index d2933c13..f8ad8eb9 100644 --- a/src/sdk/models/errors/stoptask.ts +++ b/src/sdk/models/errors/stoptask.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type StopTaskButlerErrors = { code?: number | undefined; @@ -135,6 +138,24 @@ export namespace StopTaskButlerErrors$ { export type Outbound = StopTaskButlerErrors$Outbound; } +export function stopTaskButlerErrorsToJSON( + stopTaskButlerErrors: StopTaskButlerErrors, +): string { + return JSON.stringify( + StopTaskButlerErrors$outboundSchema.parse(stopTaskButlerErrors), + ); +} + +export function stopTaskButlerErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTaskButlerErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTaskButlerErrors' from JSON`, + ); +} + /** @internal */ export const StopTaskUnauthorized$inboundSchema: z.ZodType< StopTaskUnauthorized, @@ -234,6 +255,20 @@ export namespace StopTaskErrors$ { export type Outbound = StopTaskErrors$Outbound; } +export function stopTaskErrorsToJSON(stopTaskErrors: StopTaskErrors): string { + return JSON.stringify(StopTaskErrors$outboundSchema.parse(stopTaskErrors)); +} + +export function stopTaskErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTaskErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTaskErrors' from JSON`, + ); +} + /** @internal */ export const StopTaskBadRequest$inboundSchema: z.ZodType< StopTaskBadRequest, diff --git a/src/sdk/models/errors/stoptranscodesession.ts b/src/sdk/models/errors/stoptranscodesession.ts index 4b2218ad..a0b7faa8 100644 --- a/src/sdk/models/errors/stoptranscodesession.ts +++ b/src/sdk/models/errors/stoptranscodesession.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type StopTranscodeSessionSessionsErrors = { code?: number | undefined; @@ -136,6 +139,27 @@ export namespace StopTranscodeSessionSessionsErrors$ { export type Outbound = StopTranscodeSessionSessionsErrors$Outbound; } +export function stopTranscodeSessionSessionsErrorsToJSON( + stopTranscodeSessionSessionsErrors: StopTranscodeSessionSessionsErrors, +): string { + return JSON.stringify( + StopTranscodeSessionSessionsErrors$outboundSchema.parse( + stopTranscodeSessionSessionsErrors, + ), + ); +} + +export function stopTranscodeSessionSessionsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + StopTranscodeSessionSessionsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTranscodeSessionSessionsErrors' from JSON`, + ); +} + /** @internal */ export const StopTranscodeSessionUnauthorized$inboundSchema: z.ZodType< StopTranscodeSessionUnauthorized, @@ -238,6 +262,24 @@ export namespace StopTranscodeSessionErrors$ { export type Outbound = StopTranscodeSessionErrors$Outbound; } +export function stopTranscodeSessionErrorsToJSON( + stopTranscodeSessionErrors: StopTranscodeSessionErrors, +): string { + return JSON.stringify( + StopTranscodeSessionErrors$outboundSchema.parse(stopTranscodeSessionErrors), + ); +} + +export function stopTranscodeSessionErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTranscodeSessionErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTranscodeSessionErrors' from JSON`, + ); +} + /** @internal */ export const StopTranscodeSessionBadRequest$inboundSchema: z.ZodType< StopTranscodeSessionBadRequest, diff --git a/src/sdk/models/errors/updateplaylist.ts b/src/sdk/models/errors/updateplaylist.ts index bcc2be1c..9d36149e 100644 --- a/src/sdk/models/errors/updateplaylist.ts +++ b/src/sdk/models/errors/updateplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type UpdatePlaylistPlaylistsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace UpdatePlaylistPlaylistsErrors$ { export type Outbound = UpdatePlaylistPlaylistsErrors$Outbound; } +export function updatePlaylistPlaylistsErrorsToJSON( + updatePlaylistPlaylistsErrors: UpdatePlaylistPlaylistsErrors, +): string { + return JSON.stringify( + UpdatePlaylistPlaylistsErrors$outboundSchema.parse( + updatePlaylistPlaylistsErrors, + ), + ); +} + +export function updatePlaylistPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlaylistPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlaylistPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const UpdatePlaylistUnauthorized$inboundSchema: z.ZodType< UpdatePlaylistUnauthorized, @@ -236,6 +259,24 @@ export namespace UpdatePlaylistErrors$ { export type Outbound = UpdatePlaylistErrors$Outbound; } +export function updatePlaylistErrorsToJSON( + updatePlaylistErrors: UpdatePlaylistErrors, +): string { + return JSON.stringify( + UpdatePlaylistErrors$outboundSchema.parse(updatePlaylistErrors), + ); +} + +export function updatePlaylistErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlaylistErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlaylistErrors' from JSON`, + ); +} + /** @internal */ export const UpdatePlaylistBadRequest$inboundSchema: z.ZodType< UpdatePlaylistBadRequest, diff --git a/src/sdk/models/errors/updateplayprogress.ts b/src/sdk/models/errors/updateplayprogress.ts index d6d3d595..0406a391 100644 --- a/src/sdk/models/errors/updateplayprogress.ts +++ b/src/sdk/models/errors/updateplayprogress.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type UpdatePlayProgressMediaErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace UpdatePlayProgressMediaErrors$ { export type Outbound = UpdatePlayProgressMediaErrors$Outbound; } +export function updatePlayProgressMediaErrorsToJSON( + updatePlayProgressMediaErrors: UpdatePlayProgressMediaErrors, +): string { + return JSON.stringify( + UpdatePlayProgressMediaErrors$outboundSchema.parse( + updatePlayProgressMediaErrors, + ), + ); +} + +export function updatePlayProgressMediaErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlayProgressMediaErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlayProgressMediaErrors' from JSON`, + ); +} + /** @internal */ export const UpdatePlayProgressUnauthorized$inboundSchema: z.ZodType< UpdatePlayProgressUnauthorized, @@ -236,6 +259,24 @@ export namespace UpdatePlayProgressErrors$ { export type Outbound = UpdatePlayProgressErrors$Outbound; } +export function updatePlayProgressErrorsToJSON( + updatePlayProgressErrors: UpdatePlayProgressErrors, +): string { + return JSON.stringify( + UpdatePlayProgressErrors$outboundSchema.parse(updatePlayProgressErrors), + ); +} + +export function updatePlayProgressErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlayProgressErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlayProgressErrors' from JSON`, + ); +} + /** @internal */ export const UpdatePlayProgressBadRequest$inboundSchema: z.ZodType< UpdatePlayProgressBadRequest, diff --git a/src/sdk/models/errors/uploadplaylist.ts b/src/sdk/models/errors/uploadplaylist.ts index 6a63df2e..4aaa00c9 100644 --- a/src/sdk/models/errors/uploadplaylist.ts +++ b/src/sdk/models/errors/uploadplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "./sdkvalidationerror.js"; export type UploadPlaylistPlaylistsErrors = { code?: number | undefined; @@ -135,6 +138,26 @@ export namespace UploadPlaylistPlaylistsErrors$ { export type Outbound = UploadPlaylistPlaylistsErrors$Outbound; } +export function uploadPlaylistPlaylistsErrorsToJSON( + uploadPlaylistPlaylistsErrors: UploadPlaylistPlaylistsErrors, +): string { + return JSON.stringify( + UploadPlaylistPlaylistsErrors$outboundSchema.parse( + uploadPlaylistPlaylistsErrors, + ), + ); +} + +export function uploadPlaylistPlaylistsErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UploadPlaylistPlaylistsErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UploadPlaylistPlaylistsErrors' from JSON`, + ); +} + /** @internal */ export const UploadPlaylistUnauthorized$inboundSchema: z.ZodType< UploadPlaylistUnauthorized, @@ -236,6 +259,24 @@ export namespace UploadPlaylistErrors$ { export type Outbound = UploadPlaylistErrors$Outbound; } +export function uploadPlaylistErrorsToJSON( + uploadPlaylistErrors: UploadPlaylistErrors, +): string { + return JSON.stringify( + UploadPlaylistErrors$outboundSchema.parse(uploadPlaylistErrors), + ); +} + +export function uploadPlaylistErrorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UploadPlaylistErrors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UploadPlaylistErrors' from JSON`, + ); +} + /** @internal */ export const UploadPlaylistBadRequest$inboundSchema: z.ZodType< UploadPlaylistBadRequest, diff --git a/src/sdk/models/operations/addplaylistcontents.ts b/src/sdk/models/operations/addplaylistcontents.ts index 52317f09..1a42302c 100644 --- a/src/sdk/models/operations/addplaylistcontents.ts +++ b/src/sdk/models/operations/addplaylistcontents.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type AddPlaylistContentsRequest = { /** @@ -111,6 +114,24 @@ export namespace AddPlaylistContentsRequest$ { export type Outbound = AddPlaylistContentsRequest$Outbound; } +export function addPlaylistContentsRequestToJSON( + addPlaylistContentsRequest: AddPlaylistContentsRequest, +): string { + return JSON.stringify( + AddPlaylistContentsRequest$outboundSchema.parse(addPlaylistContentsRequest), + ); +} + +export function addPlaylistContentsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddPlaylistContentsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsRequest' from JSON`, + ); +} + /** @internal */ export const AddPlaylistContentsMetadata$inboundSchema: z.ZodType< AddPlaylistContentsMetadata, @@ -183,6 +204,26 @@ export namespace AddPlaylistContentsMetadata$ { export type Outbound = AddPlaylistContentsMetadata$Outbound; } +export function addPlaylistContentsMetadataToJSON( + addPlaylistContentsMetadata: AddPlaylistContentsMetadata, +): string { + return JSON.stringify( + AddPlaylistContentsMetadata$outboundSchema.parse( + addPlaylistContentsMetadata, + ), + ); +} + +export function addPlaylistContentsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddPlaylistContentsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsMetadata' from JSON`, + ); +} + /** @internal */ export const AddPlaylistContentsMediaContainer$inboundSchema: z.ZodType< AddPlaylistContentsMediaContainer, @@ -239,6 +280,26 @@ export namespace AddPlaylistContentsMediaContainer$ { export type Outbound = AddPlaylistContentsMediaContainer$Outbound; } +export function addPlaylistContentsMediaContainerToJSON( + addPlaylistContentsMediaContainer: AddPlaylistContentsMediaContainer, +): string { + return JSON.stringify( + AddPlaylistContentsMediaContainer$outboundSchema.parse( + addPlaylistContentsMediaContainer, + ), + ); +} + +export function addPlaylistContentsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddPlaylistContentsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsMediaContainer' from JSON`, + ); +} + /** @internal */ export const AddPlaylistContentsResponseBody$inboundSchema: z.ZodType< AddPlaylistContentsResponseBody, @@ -285,6 +346,26 @@ export namespace AddPlaylistContentsResponseBody$ { export type Outbound = AddPlaylistContentsResponseBody$Outbound; } +export function addPlaylistContentsResponseBodyToJSON( + addPlaylistContentsResponseBody: AddPlaylistContentsResponseBody, +): string { + return JSON.stringify( + AddPlaylistContentsResponseBody$outboundSchema.parse( + addPlaylistContentsResponseBody, + ), + ); +} + +export function addPlaylistContentsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddPlaylistContentsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsResponseBody' from JSON`, + ); +} + /** @internal */ export const AddPlaylistContentsResponse$inboundSchema: z.ZodType< AddPlaylistContentsResponse, @@ -345,3 +426,23 @@ export namespace AddPlaylistContentsResponse$ { /** @deprecated use `AddPlaylistContentsResponse$Outbound` instead. */ export type Outbound = AddPlaylistContentsResponse$Outbound; } + +export function addPlaylistContentsResponseToJSON( + addPlaylistContentsResponse: AddPlaylistContentsResponse, +): string { + return JSON.stringify( + AddPlaylistContentsResponse$outboundSchema.parse( + addPlaylistContentsResponse, + ), + ); +} + +export function addPlaylistContentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AddPlaylistContentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AddPlaylistContentsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/applyupdates.ts b/src/sdk/models/operations/applyupdates.ts index 5342dbf0..40b2d43e 100644 --- a/src/sdk/models/operations/applyupdates.ts +++ b/src/sdk/models/operations/applyupdates.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install @@ -125,6 +128,24 @@ export namespace ApplyUpdatesRequest$ { export type Outbound = ApplyUpdatesRequest$Outbound; } +export function applyUpdatesRequestToJSON( + applyUpdatesRequest: ApplyUpdatesRequest, +): string { + return JSON.stringify( + ApplyUpdatesRequest$outboundSchema.parse(applyUpdatesRequest), + ); +} + +export function applyUpdatesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ApplyUpdatesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ApplyUpdatesRequest' from JSON`, + ); +} + /** @internal */ export const ApplyUpdatesResponse$inboundSchema: z.ZodType< ApplyUpdatesResponse, @@ -180,3 +201,21 @@ export namespace ApplyUpdatesResponse$ { /** @deprecated use `ApplyUpdatesResponse$Outbound` instead. */ export type Outbound = ApplyUpdatesResponse$Outbound; } + +export function applyUpdatesResponseToJSON( + applyUpdatesResponse: ApplyUpdatesResponse, +): string { + return JSON.stringify( + ApplyUpdatesResponse$outboundSchema.parse(applyUpdatesResponse), + ); +} + +export function applyUpdatesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ApplyUpdatesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ApplyUpdatesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/cancelserveractivities.ts b/src/sdk/models/operations/cancelserveractivities.ts index 5a8df785..f8bf94d1 100644 --- a/src/sdk/models/operations/cancelserveractivities.ts +++ b/src/sdk/models/operations/cancelserveractivities.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type CancelServerActivitiesRequest = { /** @@ -63,6 +66,26 @@ export namespace CancelServerActivitiesRequest$ { export type Outbound = CancelServerActivitiesRequest$Outbound; } +export function cancelServerActivitiesRequestToJSON( + cancelServerActivitiesRequest: CancelServerActivitiesRequest, +): string { + return JSON.stringify( + CancelServerActivitiesRequest$outboundSchema.parse( + cancelServerActivitiesRequest, + ), + ); +} + +export function cancelServerActivitiesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CancelServerActivitiesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CancelServerActivitiesRequest' from JSON`, + ); +} + /** @internal */ export const CancelServerActivitiesResponse$inboundSchema: z.ZodType< CancelServerActivitiesResponse, @@ -118,3 +141,23 @@ export namespace CancelServerActivitiesResponse$ { /** @deprecated use `CancelServerActivitiesResponse$Outbound` instead. */ export type Outbound = CancelServerActivitiesResponse$Outbound; } + +export function cancelServerActivitiesResponseToJSON( + cancelServerActivitiesResponse: CancelServerActivitiesResponse, +): string { + return JSON.stringify( + CancelServerActivitiesResponse$outboundSchema.parse( + cancelServerActivitiesResponse, + ), + ); +} + +export function cancelServerActivitiesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CancelServerActivitiesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CancelServerActivitiesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/checkforupdates.ts b/src/sdk/models/operations/checkforupdates.ts index 504bdcf8..2167b26f 100644 --- a/src/sdk/models/operations/checkforupdates.ts +++ b/src/sdk/models/operations/checkforupdates.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Indicate that you want to start download any updates found. @@ -90,6 +93,24 @@ export namespace CheckForUpdatesRequest$ { export type Outbound = CheckForUpdatesRequest$Outbound; } +export function checkForUpdatesRequestToJSON( + checkForUpdatesRequest: CheckForUpdatesRequest, +): string { + return JSON.stringify( + CheckForUpdatesRequest$outboundSchema.parse(checkForUpdatesRequest), + ); +} + +export function checkForUpdatesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CheckForUpdatesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CheckForUpdatesRequest' from JSON`, + ); +} + /** @internal */ export const CheckForUpdatesResponse$inboundSchema: z.ZodType< CheckForUpdatesResponse, @@ -145,3 +166,21 @@ export namespace CheckForUpdatesResponse$ { /** @deprecated use `CheckForUpdatesResponse$Outbound` instead. */ export type Outbound = CheckForUpdatesResponse$Outbound; } + +export function checkForUpdatesResponseToJSON( + checkForUpdatesResponse: CheckForUpdatesResponse, +): string { + return JSON.stringify( + CheckForUpdatesResponse$outboundSchema.parse(checkForUpdatesResponse), + ); +} + +export function checkForUpdatesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CheckForUpdatesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CheckForUpdatesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/clearplaylistcontents.ts b/src/sdk/models/operations/clearplaylistcontents.ts index bee8b184..ee12e5ef 100644 --- a/src/sdk/models/operations/clearplaylistcontents.ts +++ b/src/sdk/models/operations/clearplaylistcontents.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ClearPlaylistContentsRequest = { /** @@ -63,6 +66,26 @@ export namespace ClearPlaylistContentsRequest$ { export type Outbound = ClearPlaylistContentsRequest$Outbound; } +export function clearPlaylistContentsRequestToJSON( + clearPlaylistContentsRequest: ClearPlaylistContentsRequest, +): string { + return JSON.stringify( + ClearPlaylistContentsRequest$outboundSchema.parse( + clearPlaylistContentsRequest, + ), + ); +} + +export function clearPlaylistContentsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ClearPlaylistContentsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ClearPlaylistContentsRequest' from JSON`, + ); +} + /** @internal */ export const ClearPlaylistContentsResponse$inboundSchema: z.ZodType< ClearPlaylistContentsResponse, @@ -118,3 +141,23 @@ export namespace ClearPlaylistContentsResponse$ { /** @deprecated use `ClearPlaylistContentsResponse$Outbound` instead. */ export type Outbound = ClearPlaylistContentsResponse$Outbound; } + +export function clearPlaylistContentsResponseToJSON( + clearPlaylistContentsResponse: ClearPlaylistContentsResponse, +): string { + return JSON.stringify( + ClearPlaylistContentsResponse$outboundSchema.parse( + clearPlaylistContentsResponse, + ), + ); +} + +export function clearPlaylistContentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ClearPlaylistContentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ClearPlaylistContentsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/createplaylist.ts b/src/sdk/models/operations/createplaylist.ts index c51b6196..2c4a91ae 100644 --- a/src/sdk/models/operations/createplaylist.ts +++ b/src/sdk/models/operations/createplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * type of playlist to create @@ -184,6 +187,24 @@ export namespace CreatePlaylistRequest$ { export type Outbound = CreatePlaylistRequest$Outbound; } +export function createPlaylistRequestToJSON( + createPlaylistRequest: CreatePlaylistRequest, +): string { + return JSON.stringify( + CreatePlaylistRequest$outboundSchema.parse(createPlaylistRequest), + ); +} + +export function createPlaylistRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistRequest' from JSON`, + ); +} + /** @internal */ export const CreatePlaylistMetadata$inboundSchema: z.ZodType< CreatePlaylistMetadata, @@ -265,6 +286,24 @@ export namespace CreatePlaylistMetadata$ { export type Outbound = CreatePlaylistMetadata$Outbound; } +export function createPlaylistMetadataToJSON( + createPlaylistMetadata: CreatePlaylistMetadata, +): string { + return JSON.stringify( + CreatePlaylistMetadata$outboundSchema.parse(createPlaylistMetadata), + ); +} + +export function createPlaylistMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistMetadata' from JSON`, + ); +} + /** @internal */ export const CreatePlaylistMediaContainer$inboundSchema: z.ZodType< CreatePlaylistMediaContainer, @@ -314,6 +353,26 @@ export namespace CreatePlaylistMediaContainer$ { export type Outbound = CreatePlaylistMediaContainer$Outbound; } +export function createPlaylistMediaContainerToJSON( + createPlaylistMediaContainer: CreatePlaylistMediaContainer, +): string { + return JSON.stringify( + CreatePlaylistMediaContainer$outboundSchema.parse( + createPlaylistMediaContainer, + ), + ); +} + +export function createPlaylistMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistMediaContainer' from JSON`, + ); +} + /** @internal */ export const CreatePlaylistResponseBody$inboundSchema: z.ZodType< CreatePlaylistResponseBody, @@ -360,6 +419,24 @@ export namespace CreatePlaylistResponseBody$ { export type Outbound = CreatePlaylistResponseBody$Outbound; } +export function createPlaylistResponseBodyToJSON( + createPlaylistResponseBody: CreatePlaylistResponseBody, +): string { + return JSON.stringify( + CreatePlaylistResponseBody$outboundSchema.parse(createPlaylistResponseBody), + ); +} + +export function createPlaylistResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistResponseBody' from JSON`, + ); +} + /** @internal */ export const CreatePlaylistResponse$inboundSchema: z.ZodType< CreatePlaylistResponse, @@ -418,3 +495,21 @@ export namespace CreatePlaylistResponse$ { /** @deprecated use `CreatePlaylistResponse$Outbound` instead. */ export type Outbound = CreatePlaylistResponse$Outbound; } + +export function createPlaylistResponseToJSON( + createPlaylistResponse: CreatePlaylistResponse, +): string { + return JSON.stringify( + CreatePlaylistResponse$outboundSchema.parse(createPlaylistResponse), + ); +} + +export function createPlaylistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreatePlaylistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreatePlaylistResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/deletelibrary.ts b/src/sdk/models/operations/deletelibrary.ts index 2aaa9986..933ad843 100644 --- a/src/sdk/models/operations/deletelibrary.ts +++ b/src/sdk/models/operations/deletelibrary.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type DeleteLibraryRequest = { /** @@ -66,6 +69,24 @@ export namespace DeleteLibraryRequest$ { export type Outbound = DeleteLibraryRequest$Outbound; } +export function deleteLibraryRequestToJSON( + deleteLibraryRequest: DeleteLibraryRequest, +): string { + return JSON.stringify( + DeleteLibraryRequest$outboundSchema.parse(deleteLibraryRequest), + ); +} + +export function deleteLibraryRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteLibraryRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteLibraryRequest' from JSON`, + ); +} + /** @internal */ export const DeleteLibraryResponse$inboundSchema: z.ZodType< DeleteLibraryResponse, @@ -121,3 +142,21 @@ export namespace DeleteLibraryResponse$ { /** @deprecated use `DeleteLibraryResponse$Outbound` instead. */ export type Outbound = DeleteLibraryResponse$Outbound; } + +export function deleteLibraryResponseToJSON( + deleteLibraryResponse: DeleteLibraryResponse, +): string { + return JSON.stringify( + DeleteLibraryResponse$outboundSchema.parse(deleteLibraryResponse), + ); +} + +export function deleteLibraryResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteLibraryResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteLibraryResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/deleteplaylist.ts b/src/sdk/models/operations/deleteplaylist.ts index 290d348b..a400ae6c 100644 --- a/src/sdk/models/operations/deleteplaylist.ts +++ b/src/sdk/models/operations/deleteplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type DeletePlaylistRequest = { /** @@ -63,6 +66,24 @@ export namespace DeletePlaylistRequest$ { export type Outbound = DeletePlaylistRequest$Outbound; } +export function deletePlaylistRequestToJSON( + deletePlaylistRequest: DeletePlaylistRequest, +): string { + return JSON.stringify( + DeletePlaylistRequest$outboundSchema.parse(deletePlaylistRequest), + ); +} + +export function deletePlaylistRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeletePlaylistRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeletePlaylistRequest' from JSON`, + ); +} + /** @internal */ export const DeletePlaylistResponse$inboundSchema: z.ZodType< DeletePlaylistResponse, @@ -118,3 +139,21 @@ export namespace DeletePlaylistResponse$ { /** @deprecated use `DeletePlaylistResponse$Outbound` instead. */ export type Outbound = DeletePlaylistResponse$Outbound; } + +export function deletePlaylistResponseToJSON( + deletePlaylistResponse: DeletePlaylistResponse, +): string { + return JSON.stringify( + DeletePlaylistResponse$outboundSchema.parse(deletePlaylistResponse), + ); +} + +export function deletePlaylistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeletePlaylistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeletePlaylistResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/enablepapertrail.ts b/src/sdk/models/operations/enablepapertrail.ts index 78e0fa94..ea6da92d 100644 --- a/src/sdk/models/operations/enablepapertrail.ts +++ b/src/sdk/models/operations/enablepapertrail.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type EnablePaperTrailResponse = { /** @@ -75,3 +78,21 @@ export namespace EnablePaperTrailResponse$ { /** @deprecated use `EnablePaperTrailResponse$Outbound` instead. */ export type Outbound = EnablePaperTrailResponse$Outbound; } + +export function enablePaperTrailResponseToJSON( + enablePaperTrailResponse: EnablePaperTrailResponse, +): string { + return JSON.stringify( + EnablePaperTrailResponse$outboundSchema.parse(enablePaperTrailResponse), + ); +} + +export function enablePaperTrailResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => EnablePaperTrailResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'EnablePaperTrailResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getalllibraries.ts b/src/sdk/models/operations/getalllibraries.ts index 1c95d0a6..76ba60df 100644 --- a/src/sdk/models/operations/getalllibraries.ts +++ b/src/sdk/models/operations/getalllibraries.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetAllLibrariesLocation = { id: number; @@ -118,6 +121,24 @@ export namespace GetAllLibrariesLocation$ { export type Outbound = GetAllLibrariesLocation$Outbound; } +export function getAllLibrariesLocationToJSON( + getAllLibrariesLocation: GetAllLibrariesLocation, +): string { + return JSON.stringify( + GetAllLibrariesLocation$outboundSchema.parse(getAllLibrariesLocation), + ); +} + +export function getAllLibrariesLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesLocation' from JSON`, + ); +} + /** @internal */ export const GetAllLibrariesDirectory$inboundSchema: z.ZodType< GetAllLibrariesDirectory, @@ -222,6 +243,24 @@ export namespace GetAllLibrariesDirectory$ { export type Outbound = GetAllLibrariesDirectory$Outbound; } +export function getAllLibrariesDirectoryToJSON( + getAllLibrariesDirectory: GetAllLibrariesDirectory, +): string { + return JSON.stringify( + GetAllLibrariesDirectory$outboundSchema.parse(getAllLibrariesDirectory), + ); +} + +export function getAllLibrariesDirectoryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesDirectory$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesDirectory' from JSON`, + ); +} + /** @internal */ export const GetAllLibrariesMediaContainer$inboundSchema: z.ZodType< GetAllLibrariesMediaContainer, @@ -275,6 +314,26 @@ export namespace GetAllLibrariesMediaContainer$ { export type Outbound = GetAllLibrariesMediaContainer$Outbound; } +export function getAllLibrariesMediaContainerToJSON( + getAllLibrariesMediaContainer: GetAllLibrariesMediaContainer, +): string { + return JSON.stringify( + GetAllLibrariesMediaContainer$outboundSchema.parse( + getAllLibrariesMediaContainer, + ), + ); +} + +export function getAllLibrariesMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetAllLibrariesResponseBody$inboundSchema: z.ZodType< GetAllLibrariesResponseBody, @@ -319,6 +378,26 @@ export namespace GetAllLibrariesResponseBody$ { export type Outbound = GetAllLibrariesResponseBody$Outbound; } +export function getAllLibrariesResponseBodyToJSON( + getAllLibrariesResponseBody: GetAllLibrariesResponseBody, +): string { + return JSON.stringify( + GetAllLibrariesResponseBody$outboundSchema.parse( + getAllLibrariesResponseBody, + ), + ); +} + +export function getAllLibrariesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesResponseBody' from JSON`, + ); +} + /** @internal */ export const GetAllLibrariesResponse$inboundSchema: z.ZodType< GetAllLibrariesResponse, @@ -377,3 +456,21 @@ export namespace GetAllLibrariesResponse$ { /** @deprecated use `GetAllLibrariesResponse$Outbound` instead. */ export type Outbound = GetAllLibrariesResponse$Outbound; } + +export function getAllLibrariesResponseToJSON( + getAllLibrariesResponse: GetAllLibrariesResponse, +): string { + return JSON.stringify( + GetAllLibrariesResponse$outboundSchema.parse(getAllLibrariesResponse), + ); +} + +export function getAllLibrariesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAllLibrariesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAllLibrariesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getavailableclients.ts b/src/sdk/models/operations/getavailableclients.ts index 9900ffbb..e83423b7 100644 --- a/src/sdk/models/operations/getavailableclients.ts +++ b/src/sdk/models/operations/getavailableclients.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Server = { name?: string | undefined; @@ -113,6 +116,20 @@ export namespace Server$ { export type Outbound = Server$Outbound; } +export function serverToJSON(server: Server): string { + return JSON.stringify(Server$outboundSchema.parse(server)); +} + +export function serverFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Server$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Server' from JSON`, + ); +} + /** @internal */ export const GetAvailableClientsMediaContainer$inboundSchema: z.ZodType< GetAvailableClientsMediaContainer, @@ -161,6 +178,26 @@ export namespace GetAvailableClientsMediaContainer$ { export type Outbound = GetAvailableClientsMediaContainer$Outbound; } +export function getAvailableClientsMediaContainerToJSON( + getAvailableClientsMediaContainer: GetAvailableClientsMediaContainer, +): string { + return JSON.stringify( + GetAvailableClientsMediaContainer$outboundSchema.parse( + getAvailableClientsMediaContainer, + ), + ); +} + +export function getAvailableClientsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAvailableClientsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAvailableClientsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetAvailableClientsResponseBody$inboundSchema: z.ZodType< GetAvailableClientsResponseBody, @@ -207,6 +244,26 @@ export namespace GetAvailableClientsResponseBody$ { export type Outbound = GetAvailableClientsResponseBody$Outbound; } +export function getAvailableClientsResponseBodyToJSON( + getAvailableClientsResponseBody: GetAvailableClientsResponseBody, +): string { + return JSON.stringify( + GetAvailableClientsResponseBody$outboundSchema.parse( + getAvailableClientsResponseBody, + ), + ); +} + +export function getAvailableClientsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAvailableClientsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAvailableClientsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetAvailableClientsResponse$inboundSchema: z.ZodType< GetAvailableClientsResponse, @@ -267,3 +324,23 @@ export namespace GetAvailableClientsResponse$ { /** @deprecated use `GetAvailableClientsResponse$Outbound` instead. */ export type Outbound = GetAvailableClientsResponse$Outbound; } + +export function getAvailableClientsResponseToJSON( + getAvailableClientsResponse: GetAvailableClientsResponse, +): string { + return JSON.stringify( + GetAvailableClientsResponse$outboundSchema.parse( + getAvailableClientsResponse, + ), + ); +} + +export function getAvailableClientsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetAvailableClientsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetAvailableClientsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getbandwidthstatistics.ts b/src/sdk/models/operations/getbandwidthstatistics.ts index 4dc4f592..6fdae10a 100644 --- a/src/sdk/models/operations/getbandwidthstatistics.ts +++ b/src/sdk/models/operations/getbandwidthstatistics.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetBandwidthStatisticsRequest = { /** @@ -112,6 +115,26 @@ export namespace GetBandwidthStatisticsRequest$ { export type Outbound = GetBandwidthStatisticsRequest$Outbound; } +export function getBandwidthStatisticsRequestToJSON( + getBandwidthStatisticsRequest: GetBandwidthStatisticsRequest, +): string { + return JSON.stringify( + GetBandwidthStatisticsRequest$outboundSchema.parse( + getBandwidthStatisticsRequest, + ), + ); +} + +export function getBandwidthStatisticsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBandwidthStatisticsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsRequest' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsDevice$inboundSchema: z.ZodType< GetBandwidthStatisticsDevice, @@ -160,6 +183,26 @@ export namespace GetBandwidthStatisticsDevice$ { export type Outbound = GetBandwidthStatisticsDevice$Outbound; } +export function getBandwidthStatisticsDeviceToJSON( + getBandwidthStatisticsDevice: GetBandwidthStatisticsDevice, +): string { + return JSON.stringify( + GetBandwidthStatisticsDevice$outboundSchema.parse( + getBandwidthStatisticsDevice, + ), + ); +} + +export function getBandwidthStatisticsDeviceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBandwidthStatisticsDevice$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsDevice' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsAccount$inboundSchema: z.ZodType< GetBandwidthStatisticsAccount, @@ -217,6 +260,26 @@ export namespace GetBandwidthStatisticsAccount$ { export type Outbound = GetBandwidthStatisticsAccount$Outbound; } +export function getBandwidthStatisticsAccountToJSON( + getBandwidthStatisticsAccount: GetBandwidthStatisticsAccount, +): string { + return JSON.stringify( + GetBandwidthStatisticsAccount$outboundSchema.parse( + getBandwidthStatisticsAccount, + ), + ); +} + +export function getBandwidthStatisticsAccountFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBandwidthStatisticsAccount$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsAccount' from JSON`, + ); +} + /** @internal */ export const StatisticsBandwidth$inboundSchema: z.ZodType< StatisticsBandwidth, @@ -268,6 +331,24 @@ export namespace StatisticsBandwidth$ { export type Outbound = StatisticsBandwidth$Outbound; } +export function statisticsBandwidthToJSON( + statisticsBandwidth: StatisticsBandwidth, +): string { + return JSON.stringify( + StatisticsBandwidth$outboundSchema.parse(statisticsBandwidth), + ); +} + +export function statisticsBandwidthFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StatisticsBandwidth$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StatisticsBandwidth' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsMediaContainer$inboundSchema: z.ZodType< GetBandwidthStatisticsMediaContainer, @@ -333,6 +414,27 @@ export namespace GetBandwidthStatisticsMediaContainer$ { export type Outbound = GetBandwidthStatisticsMediaContainer$Outbound; } +export function getBandwidthStatisticsMediaContainerToJSON( + getBandwidthStatisticsMediaContainer: GetBandwidthStatisticsMediaContainer, +): string { + return JSON.stringify( + GetBandwidthStatisticsMediaContainer$outboundSchema.parse( + getBandwidthStatisticsMediaContainer, + ), + ); +} + +export function getBandwidthStatisticsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetBandwidthStatisticsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsResponseBody$inboundSchema: z.ZodType< GetBandwidthStatisticsResponseBody, @@ -382,6 +484,27 @@ export namespace GetBandwidthStatisticsResponseBody$ { export type Outbound = GetBandwidthStatisticsResponseBody$Outbound; } +export function getBandwidthStatisticsResponseBodyToJSON( + getBandwidthStatisticsResponseBody: GetBandwidthStatisticsResponseBody, +): string { + return JSON.stringify( + GetBandwidthStatisticsResponseBody$outboundSchema.parse( + getBandwidthStatisticsResponseBody, + ), + ); +} + +export function getBandwidthStatisticsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetBandwidthStatisticsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetBandwidthStatisticsResponse$inboundSchema: z.ZodType< GetBandwidthStatisticsResponse, @@ -442,3 +565,23 @@ export namespace GetBandwidthStatisticsResponse$ { /** @deprecated use `GetBandwidthStatisticsResponse$Outbound` instead. */ export type Outbound = GetBandwidthStatisticsResponse$Outbound; } + +export function getBandwidthStatisticsResponseToJSON( + getBandwidthStatisticsResponse: GetBandwidthStatisticsResponse, +): string { + return JSON.stringify( + GetBandwidthStatisticsResponse$outboundSchema.parse( + getBandwidthStatisticsResponse, + ), + ); +} + +export function getBandwidthStatisticsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBandwidthStatisticsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBandwidthStatisticsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getbannerimage.ts b/src/sdk/models/operations/getbannerimage.ts index 909484df..d75215f7 100644 --- a/src/sdk/models/operations/getbannerimage.ts +++ b/src/sdk/models/operations/getbannerimage.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetBannerImageRequest = { /** @@ -99,6 +102,24 @@ export namespace GetBannerImageRequest$ { export type Outbound = GetBannerImageRequest$Outbound; } +export function getBannerImageRequestToJSON( + getBannerImageRequest: GetBannerImageRequest, +): string { + return JSON.stringify( + GetBannerImageRequest$outboundSchema.parse(getBannerImageRequest), + ); +} + +export function getBannerImageRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBannerImageRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBannerImageRequest' from JSON`, + ); +} + /** @internal */ export const GetBannerImageResponse$inboundSchema: z.ZodType< GetBannerImageResponse, @@ -164,3 +185,21 @@ export namespace GetBannerImageResponse$ { /** @deprecated use `GetBannerImageResponse$Outbound` instead. */ export type Outbound = GetBannerImageResponse$Outbound; } + +export function getBannerImageResponseToJSON( + getBannerImageResponse: GetBannerImageResponse, +): string { + return JSON.stringify( + GetBannerImageResponse$outboundSchema.parse(getBannerImageResponse), + ); +} + +export function getBannerImageResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetBannerImageResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetBannerImageResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getbutlertasks.ts b/src/sdk/models/operations/getbutlertasks.ts index edb447c2..f658d0e3 100644 --- a/src/sdk/models/operations/getbutlertasks.ts +++ b/src/sdk/models/operations/getbutlertasks.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type ButlerTask = { name?: string | undefined; @@ -95,6 +98,20 @@ export namespace ButlerTask$ { export type Outbound = ButlerTask$Outbound; } +export function butlerTaskToJSON(butlerTask: ButlerTask): string { + return JSON.stringify(ButlerTask$outboundSchema.parse(butlerTask)); +} + +export function butlerTaskFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ButlerTask$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ButlerTask' from JSON`, + ); +} + /** @internal */ export const ButlerTasks$inboundSchema: z.ZodType< ButlerTasks, @@ -139,6 +156,20 @@ export namespace ButlerTasks$ { export type Outbound = ButlerTasks$Outbound; } +export function butlerTasksToJSON(butlerTasks: ButlerTasks): string { + return JSON.stringify(ButlerTasks$outboundSchema.parse(butlerTasks)); +} + +export function butlerTasksFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ButlerTasks$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ButlerTasks' from JSON`, + ); +} + /** @internal */ export const GetButlerTasksResponseBody$inboundSchema: z.ZodType< GetButlerTasksResponseBody, @@ -183,6 +214,24 @@ export namespace GetButlerTasksResponseBody$ { export type Outbound = GetButlerTasksResponseBody$Outbound; } +export function getButlerTasksResponseBodyToJSON( + getButlerTasksResponseBody: GetButlerTasksResponseBody, +): string { + return JSON.stringify( + GetButlerTasksResponseBody$outboundSchema.parse(getButlerTasksResponseBody), + ); +} + +export function getButlerTasksResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetButlerTasksResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetButlerTasksResponseBody' from JSON`, + ); +} + /** @internal */ export const GetButlerTasksResponse$inboundSchema: z.ZodType< GetButlerTasksResponse, @@ -241,3 +290,21 @@ export namespace GetButlerTasksResponse$ { /** @deprecated use `GetButlerTasksResponse$Outbound` instead. */ export type Outbound = GetButlerTasksResponse$Outbound; } + +export function getButlerTasksResponseToJSON( + getButlerTasksResponse: GetButlerTasksResponse, +): string { + return JSON.stringify( + GetButlerTasksResponse$outboundSchema.parse(getButlerTasksResponse), + ); +} + +export function getButlerTasksResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetButlerTasksResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetButlerTasksResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getcompanionsdata.ts b/src/sdk/models/operations/getcompanionsdata.ts index c243afcd..36073df3 100644 --- a/src/sdk/models/operations/getcompanionsdata.ts +++ b/src/sdk/models/operations/getcompanionsdata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetCompanionsDataServerList = [ "https://plex.tv/api/v2", @@ -91,6 +94,20 @@ export namespace ResponseBody$ { export type Outbound = ResponseBody$Outbound; } +export function responseBodyToJSON(responseBody: ResponseBody): string { + return JSON.stringify(ResponseBody$outboundSchema.parse(responseBody)); +} + +export function responseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ResponseBody' from JSON`, + ); +} + /** @internal */ export const GetCompanionsDataResponse$inboundSchema: z.ZodType< GetCompanionsDataResponse, @@ -149,3 +166,21 @@ export namespace GetCompanionsDataResponse$ { /** @deprecated use `GetCompanionsDataResponse$Outbound` instead. */ export type Outbound = GetCompanionsDataResponse$Outbound; } + +export function getCompanionsDataResponseToJSON( + getCompanionsDataResponse: GetCompanionsDataResponse, +): string { + return JSON.stringify( + GetCompanionsDataResponse$outboundSchema.parse(getCompanionsDataResponse), + ); +} + +export function getCompanionsDataResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetCompanionsDataResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetCompanionsDataResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getdevices.ts b/src/sdk/models/operations/getdevices.ts index 12f04428..8af3bce9 100644 --- a/src/sdk/models/operations/getdevices.ts +++ b/src/sdk/models/operations/getdevices.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Device = { id?: number | undefined; @@ -90,6 +93,20 @@ export namespace Device$ { export type Outbound = Device$Outbound; } +export function deviceToJSON(device: Device): string { + return JSON.stringify(Device$outboundSchema.parse(device)); +} + +export function deviceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Device$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Device' from JSON`, + ); +} + /** @internal */ export const GetDevicesMediaContainer$inboundSchema: z.ZodType< GetDevicesMediaContainer, @@ -140,6 +157,24 @@ export namespace GetDevicesMediaContainer$ { export type Outbound = GetDevicesMediaContainer$Outbound; } +export function getDevicesMediaContainerToJSON( + getDevicesMediaContainer: GetDevicesMediaContainer, +): string { + return JSON.stringify( + GetDevicesMediaContainer$outboundSchema.parse(getDevicesMediaContainer), + ); +} + +export function getDevicesMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetDevicesMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetDevicesMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetDevicesResponseBody$inboundSchema: z.ZodType< GetDevicesResponseBody, @@ -186,6 +221,24 @@ export namespace GetDevicesResponseBody$ { export type Outbound = GetDevicesResponseBody$Outbound; } +export function getDevicesResponseBodyToJSON( + getDevicesResponseBody: GetDevicesResponseBody, +): string { + return JSON.stringify( + GetDevicesResponseBody$outboundSchema.parse(getDevicesResponseBody), + ); +} + +export function getDevicesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetDevicesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetDevicesResponseBody' from JSON`, + ); +} + /** @internal */ export const GetDevicesResponse$inboundSchema: z.ZodType< GetDevicesResponse, @@ -244,3 +297,21 @@ export namespace GetDevicesResponse$ { /** @deprecated use `GetDevicesResponse$Outbound` instead. */ export type Outbound = GetDevicesResponse$Outbound; } + +export function getDevicesResponseToJSON( + getDevicesResponse: GetDevicesResponse, +): string { + return JSON.stringify( + GetDevicesResponse$outboundSchema.parse(getDevicesResponse), + ); +} + +export function getDevicesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetDevicesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetDevicesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getfilehash.ts b/src/sdk/models/operations/getfilehash.ts index dcaba999..1267a278 100644 --- a/src/sdk/models/operations/getfilehash.ts +++ b/src/sdk/models/operations/getfilehash.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetFileHashRequest = { /** @@ -70,6 +73,24 @@ export namespace GetFileHashRequest$ { export type Outbound = GetFileHashRequest$Outbound; } +export function getFileHashRequestToJSON( + getFileHashRequest: GetFileHashRequest, +): string { + return JSON.stringify( + GetFileHashRequest$outboundSchema.parse(getFileHashRequest), + ); +} + +export function getFileHashRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetFileHashRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetFileHashRequest' from JSON`, + ); +} + /** @internal */ export const GetFileHashResponse$inboundSchema: z.ZodType< GetFileHashResponse, @@ -125,3 +146,21 @@ export namespace GetFileHashResponse$ { /** @deprecated use `GetFileHashResponse$Outbound` instead. */ export type Outbound = GetFileHashResponse$Outbound; } + +export function getFileHashResponseToJSON( + getFileHashResponse: GetFileHashResponse, +): string { + return JSON.stringify( + GetFileHashResponse$outboundSchema.parse(getFileHashResponse), + ); +} + +export function getFileHashResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetFileHashResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetFileHashResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getgeodata.ts b/src/sdk/models/operations/getgeodata.ts index ceed1b24..d3644ac5 100644 --- a/src/sdk/models/operations/getgeodata.ts +++ b/src/sdk/models/operations/getgeodata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetGeoDataServerList = [ "https://plex.tv/api/v2", @@ -162,6 +165,24 @@ export namespace GetGeoDataGeoData$ { export type Outbound = GetGeoDataGeoData$Outbound; } +export function getGeoDataGeoDataToJSON( + getGeoDataGeoData: GetGeoDataGeoData, +): string { + return JSON.stringify( + GetGeoDataGeoData$outboundSchema.parse(getGeoDataGeoData), + ); +} + +export function getGeoDataGeoDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGeoDataGeoData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGeoDataGeoData' from JSON`, + ); +} + /** @internal */ export const GetGeoDataResponse$inboundSchema: z.ZodType< GetGeoDataResponse, @@ -222,3 +243,21 @@ export namespace GetGeoDataResponse$ { /** @deprecated use `GetGeoDataResponse$Outbound` instead. */ export type Outbound = GetGeoDataResponse$Outbound; } + +export function getGeoDataResponseToJSON( + getGeoDataResponse: GetGeoDataResponse, +): string { + return JSON.stringify( + GetGeoDataResponse$outboundSchema.parse(getGeoDataResponse), + ); +} + +export function getGeoDataResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGeoDataResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGeoDataResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getglobalhubs.ts b/src/sdk/models/operations/getglobalhubs.ts index 60d1561b..25554657 100644 --- a/src/sdk/models/operations/getglobalhubs.ts +++ b/src/sdk/models/operations/getglobalhubs.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). @@ -151,6 +154,24 @@ export namespace GetGlobalHubsRequest$ { export type Outbound = GetGlobalHubsRequest$Outbound; } +export function getGlobalHubsRequestToJSON( + getGlobalHubsRequest: GetGlobalHubsRequest, +): string { + return JSON.stringify( + GetGlobalHubsRequest$outboundSchema.parse(getGlobalHubsRequest), + ); +} + +export function getGlobalHubsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsRequest' from JSON`, + ); +} + /** @internal */ export const GetGlobalHubsMetadata$inboundSchema: z.ZodType< GetGlobalHubsMetadata, @@ -235,6 +256,24 @@ export namespace GetGlobalHubsMetadata$ { export type Outbound = GetGlobalHubsMetadata$Outbound; } +export function getGlobalHubsMetadataToJSON( + getGlobalHubsMetadata: GetGlobalHubsMetadata, +): string { + return JSON.stringify( + GetGlobalHubsMetadata$outboundSchema.parse(getGlobalHubsMetadata), + ); +} + +export function getGlobalHubsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsMetadata' from JSON`, + ); +} + /** @internal */ export const Hub$inboundSchema: z.ZodType = z .object({ @@ -305,6 +344,20 @@ export namespace Hub$ { export type Outbound = Hub$Outbound; } +export function hubToJSON(hub: Hub): string { + return JSON.stringify(Hub$outboundSchema.parse(hub)); +} + +export function hubFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Hub$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Hub' from JSON`, + ); +} + /** @internal */ export const GetGlobalHubsMediaContainer$inboundSchema: z.ZodType< GetGlobalHubsMediaContainer, @@ -358,6 +411,26 @@ export namespace GetGlobalHubsMediaContainer$ { export type Outbound = GetGlobalHubsMediaContainer$Outbound; } +export function getGlobalHubsMediaContainerToJSON( + getGlobalHubsMediaContainer: GetGlobalHubsMediaContainer, +): string { + return JSON.stringify( + GetGlobalHubsMediaContainer$outboundSchema.parse( + getGlobalHubsMediaContainer, + ), + ); +} + +export function getGlobalHubsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetGlobalHubsResponseBody$inboundSchema: z.ZodType< GetGlobalHubsResponseBody, @@ -404,6 +477,24 @@ export namespace GetGlobalHubsResponseBody$ { export type Outbound = GetGlobalHubsResponseBody$Outbound; } +export function getGlobalHubsResponseBodyToJSON( + getGlobalHubsResponseBody: GetGlobalHubsResponseBody, +): string { + return JSON.stringify( + GetGlobalHubsResponseBody$outboundSchema.parse(getGlobalHubsResponseBody), + ); +} + +export function getGlobalHubsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetGlobalHubsResponse$inboundSchema: z.ZodType< GetGlobalHubsResponse, @@ -462,3 +553,21 @@ export namespace GetGlobalHubsResponse$ { /** @deprecated use `GetGlobalHubsResponse$Outbound` instead. */ export type Outbound = GetGlobalHubsResponse$Outbound; } + +export function getGlobalHubsResponseToJSON( + getGlobalHubsResponse: GetGlobalHubsResponse, +): string { + return JSON.stringify( + GetGlobalHubsResponse$outboundSchema.parse(getGlobalHubsResponse), + ); +} + +export function getGlobalHubsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetGlobalHubsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetGlobalHubsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gethomedata.ts b/src/sdk/models/operations/gethomedata.ts index ad31b838..01bd971f 100644 --- a/src/sdk/models/operations/gethomedata.ts +++ b/src/sdk/models/operations/gethomedata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Home Data @@ -87,6 +90,24 @@ export namespace GetHomeDataResponseBody$ { export type Outbound = GetHomeDataResponseBody$Outbound; } +export function getHomeDataResponseBodyToJSON( + getHomeDataResponseBody: GetHomeDataResponseBody, +): string { + return JSON.stringify( + GetHomeDataResponseBody$outboundSchema.parse(getHomeDataResponseBody), + ); +} + +export function getHomeDataResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetHomeDataResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetHomeDataResponseBody' from JSON`, + ); +} + /** @internal */ export const GetHomeDataResponse$inboundSchema: z.ZodType< GetHomeDataResponse, @@ -145,3 +166,21 @@ export namespace GetHomeDataResponse$ { /** @deprecated use `GetHomeDataResponse$Outbound` instead. */ export type Outbound = GetHomeDataResponse$Outbound; } + +export function getHomeDataResponseToJSON( + getHomeDataResponse: GetHomeDataResponse, +): string { + return JSON.stringify( + GetHomeDataResponse$outboundSchema.parse(getHomeDataResponse), + ); +} + +export function getHomeDataResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetHomeDataResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetHomeDataResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getlibrarydetails.ts b/src/sdk/models/operations/getlibrarydetails.ts index f54f0ffa..e859bb64 100644 --- a/src/sdk/models/operations/getlibrarydetails.ts +++ b/src/sdk/models/operations/getlibrarydetails.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Whether or not to include details for a section (types, filters, and sorts). @@ -189,6 +192,24 @@ export namespace GetLibraryDetailsRequest$ { export type Outbound = GetLibraryDetailsRequest$Outbound; } +export function getLibraryDetailsRequestToJSON( + getLibraryDetailsRequest: GetLibraryDetailsRequest, +): string { + return JSON.stringify( + GetLibraryDetailsRequest$outboundSchema.parse(getLibraryDetailsRequest), + ); +} + +export function getLibraryDetailsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsRequest' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsDirectory$inboundSchema: z.ZodType< GetLibraryDetailsDirectory, @@ -237,6 +258,24 @@ export namespace GetLibraryDetailsDirectory$ { export type Outbound = GetLibraryDetailsDirectory$Outbound; } +export function getLibraryDetailsDirectoryToJSON( + getLibraryDetailsDirectory: GetLibraryDetailsDirectory, +): string { + return JSON.stringify( + GetLibraryDetailsDirectory$outboundSchema.parse(getLibraryDetailsDirectory), + ); +} + +export function getLibraryDetailsDirectoryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsDirectory$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsDirectory' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsFilter$inboundSchema: z.ZodType< GetLibraryDetailsFilter, @@ -285,6 +324,24 @@ export namespace GetLibraryDetailsFilter$ { export type Outbound = GetLibraryDetailsFilter$Outbound; } +export function getLibraryDetailsFilterToJSON( + getLibraryDetailsFilter: GetLibraryDetailsFilter, +): string { + return JSON.stringify( + GetLibraryDetailsFilter$outboundSchema.parse(getLibraryDetailsFilter), + ); +} + +export function getLibraryDetailsFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsFilter' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsSort$inboundSchema: z.ZodType< GetLibraryDetailsSort, @@ -336,6 +393,24 @@ export namespace GetLibraryDetailsSort$ { export type Outbound = GetLibraryDetailsSort$Outbound; } +export function getLibraryDetailsSortToJSON( + getLibraryDetailsSort: GetLibraryDetailsSort, +): string { + return JSON.stringify( + GetLibraryDetailsSort$outboundSchema.parse(getLibraryDetailsSort), + ); +} + +export function getLibraryDetailsSortFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsSort$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsSort' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsField$inboundSchema: z.ZodType< GetLibraryDetailsField, @@ -381,6 +456,24 @@ export namespace GetLibraryDetailsField$ { export type Outbound = GetLibraryDetailsField$Outbound; } +export function getLibraryDetailsFieldToJSON( + getLibraryDetailsField: GetLibraryDetailsField, +): string { + return JSON.stringify( + GetLibraryDetailsField$outboundSchema.parse(getLibraryDetailsField), + ); +} + +export function getLibraryDetailsFieldFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsField$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsField' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsType$inboundSchema: z.ZodType< GetLibraryDetailsType, @@ -450,6 +543,24 @@ export namespace GetLibraryDetailsType$ { export type Outbound = GetLibraryDetailsType$Outbound; } +export function getLibraryDetailsTypeToJSON( + getLibraryDetailsType: GetLibraryDetailsType, +): string { + return JSON.stringify( + GetLibraryDetailsType$outboundSchema.parse(getLibraryDetailsType), + ); +} + +export function getLibraryDetailsTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsType' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsOperator$inboundSchema: z.ZodType< GetLibraryDetailsOperator, @@ -489,6 +600,24 @@ export namespace GetLibraryDetailsOperator$ { export type Outbound = GetLibraryDetailsOperator$Outbound; } +export function getLibraryDetailsOperatorToJSON( + getLibraryDetailsOperator: GetLibraryDetailsOperator, +): string { + return JSON.stringify( + GetLibraryDetailsOperator$outboundSchema.parse(getLibraryDetailsOperator), + ); +} + +export function getLibraryDetailsOperatorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsOperator$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsOperator' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsFieldType$inboundSchema: z.ZodType< GetLibraryDetailsFieldType, @@ -538,6 +667,24 @@ export namespace GetLibraryDetailsFieldType$ { export type Outbound = GetLibraryDetailsFieldType$Outbound; } +export function getLibraryDetailsFieldTypeToJSON( + getLibraryDetailsFieldType: GetLibraryDetailsFieldType, +): string { + return JSON.stringify( + GetLibraryDetailsFieldType$outboundSchema.parse(getLibraryDetailsFieldType), + ); +} + +export function getLibraryDetailsFieldTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsFieldType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsFieldType' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsMediaContainer$inboundSchema: z.ZodType< GetLibraryDetailsMediaContainer, @@ -632,6 +779,26 @@ export namespace GetLibraryDetailsMediaContainer$ { export type Outbound = GetLibraryDetailsMediaContainer$Outbound; } +export function getLibraryDetailsMediaContainerToJSON( + getLibraryDetailsMediaContainer: GetLibraryDetailsMediaContainer, +): string { + return JSON.stringify( + GetLibraryDetailsMediaContainer$outboundSchema.parse( + getLibraryDetailsMediaContainer, + ), + ); +} + +export function getLibraryDetailsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsResponseBody$inboundSchema: z.ZodType< GetLibraryDetailsResponseBody, @@ -678,6 +845,26 @@ export namespace GetLibraryDetailsResponseBody$ { export type Outbound = GetLibraryDetailsResponseBody$Outbound; } +export function getLibraryDetailsResponseBodyToJSON( + getLibraryDetailsResponseBody: GetLibraryDetailsResponseBody, +): string { + return JSON.stringify( + GetLibraryDetailsResponseBody$outboundSchema.parse( + getLibraryDetailsResponseBody, + ), + ); +} + +export function getLibraryDetailsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetLibraryDetailsResponse$inboundSchema: z.ZodType< GetLibraryDetailsResponse, @@ -736,3 +923,21 @@ export namespace GetLibraryDetailsResponse$ { /** @deprecated use `GetLibraryDetailsResponse$Outbound` instead. */ export type Outbound = GetLibraryDetailsResponse$Outbound; } + +export function getLibraryDetailsResponseToJSON( + getLibraryDetailsResponse: GetLibraryDetailsResponse, +): string { + return JSON.stringify( + GetLibraryDetailsResponse$outboundSchema.parse(getLibraryDetailsResponse), + ); +} + +export function getLibraryDetailsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryDetailsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryDetailsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getlibraryhubs.ts b/src/sdk/models/operations/getlibraryhubs.ts index 9253ab15..907706b8 100644 --- a/src/sdk/models/operations/getlibraryhubs.ts +++ b/src/sdk/models/operations/getlibraryhubs.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added). @@ -233,6 +236,24 @@ export namespace GetLibraryHubsRequest$ { export type Outbound = GetLibraryHubsRequest$Outbound; } +export function getLibraryHubsRequestToJSON( + getLibraryHubsRequest: GetLibraryHubsRequest, +): string { + return JSON.stringify( + GetLibraryHubsRequest$outboundSchema.parse(getLibraryHubsRequest), + ); +} + +export function getLibraryHubsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsRequest' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsPart$inboundSchema: z.ZodType< GetLibraryHubsPart, @@ -296,6 +317,24 @@ export namespace GetLibraryHubsPart$ { export type Outbound = GetLibraryHubsPart$Outbound; } +export function getLibraryHubsPartToJSON( + getLibraryHubsPart: GetLibraryHubsPart, +): string { + return JSON.stringify( + GetLibraryHubsPart$outboundSchema.parse(getLibraryHubsPart), + ); +} + +export function getLibraryHubsPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsPart' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsMedia$inboundSchema: z.ZodType< GetLibraryHubsMedia, @@ -388,6 +427,24 @@ export namespace GetLibraryHubsMedia$ { export type Outbound = GetLibraryHubsMedia$Outbound; } +export function getLibraryHubsMediaToJSON( + getLibraryHubsMedia: GetLibraryHubsMedia, +): string { + return JSON.stringify( + GetLibraryHubsMedia$outboundSchema.parse(getLibraryHubsMedia), + ); +} + +export function getLibraryHubsMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsMedia' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsGenre$inboundSchema: z.ZodType< GetLibraryHubsGenre, @@ -424,6 +481,24 @@ export namespace GetLibraryHubsGenre$ { export type Outbound = GetLibraryHubsGenre$Outbound; } +export function getLibraryHubsGenreToJSON( + getLibraryHubsGenre: GetLibraryHubsGenre, +): string { + return JSON.stringify( + GetLibraryHubsGenre$outboundSchema.parse(getLibraryHubsGenre), + ); +} + +export function getLibraryHubsGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsGenre' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsCountry$inboundSchema: z.ZodType< GetLibraryHubsCountry, @@ -460,6 +535,24 @@ export namespace GetLibraryHubsCountry$ { export type Outbound = GetLibraryHubsCountry$Outbound; } +export function getLibraryHubsCountryToJSON( + getLibraryHubsCountry: GetLibraryHubsCountry, +): string { + return JSON.stringify( + GetLibraryHubsCountry$outboundSchema.parse(getLibraryHubsCountry), + ); +} + +export function getLibraryHubsCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsCountry' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsDirector$inboundSchema: z.ZodType< GetLibraryHubsDirector, @@ -496,6 +589,24 @@ export namespace GetLibraryHubsDirector$ { export type Outbound = GetLibraryHubsDirector$Outbound; } +export function getLibraryHubsDirectorToJSON( + getLibraryHubsDirector: GetLibraryHubsDirector, +): string { + return JSON.stringify( + GetLibraryHubsDirector$outboundSchema.parse(getLibraryHubsDirector), + ); +} + +export function getLibraryHubsDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsDirector' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsRole$inboundSchema: z.ZodType< GetLibraryHubsRole, @@ -532,6 +643,24 @@ export namespace GetLibraryHubsRole$ { export type Outbound = GetLibraryHubsRole$Outbound; } +export function getLibraryHubsRoleToJSON( + getLibraryHubsRole: GetLibraryHubsRole, +): string { + return JSON.stringify( + GetLibraryHubsRole$outboundSchema.parse(getLibraryHubsRole), + ); +} + +export function getLibraryHubsRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsRole' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsWriter$inboundSchema: z.ZodType< GetLibraryHubsWriter, @@ -568,6 +697,24 @@ export namespace GetLibraryHubsWriter$ { export type Outbound = GetLibraryHubsWriter$Outbound; } +export function getLibraryHubsWriterToJSON( + getLibraryHubsWriter: GetLibraryHubsWriter, +): string { + return JSON.stringify( + GetLibraryHubsWriter$outboundSchema.parse(getLibraryHubsWriter), + ); +} + +export function getLibraryHubsWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsWriter' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsMetadata$inboundSchema: z.ZodType< GetLibraryHubsMetadata, @@ -726,6 +873,24 @@ export namespace GetLibraryHubsMetadata$ { export type Outbound = GetLibraryHubsMetadata$Outbound; } +export function getLibraryHubsMetadataToJSON( + getLibraryHubsMetadata: GetLibraryHubsMetadata, +): string { + return JSON.stringify( + GetLibraryHubsMetadata$outboundSchema.parse(getLibraryHubsMetadata), + ); +} + +export function getLibraryHubsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsMetadata' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsHub$inboundSchema: z.ZodType< GetLibraryHubsHub, @@ -805,6 +970,24 @@ export namespace GetLibraryHubsHub$ { export type Outbound = GetLibraryHubsHub$Outbound; } +export function getLibraryHubsHubToJSON( + getLibraryHubsHub: GetLibraryHubsHub, +): string { + return JSON.stringify( + GetLibraryHubsHub$outboundSchema.parse(getLibraryHubsHub), + ); +} + +export function getLibraryHubsHubFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsHub$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsHub' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsMediaContainer$inboundSchema: z.ZodType< GetLibraryHubsMediaContainer, @@ -867,6 +1050,26 @@ export namespace GetLibraryHubsMediaContainer$ { export type Outbound = GetLibraryHubsMediaContainer$Outbound; } +export function getLibraryHubsMediaContainerToJSON( + getLibraryHubsMediaContainer: GetLibraryHubsMediaContainer, +): string { + return JSON.stringify( + GetLibraryHubsMediaContainer$outboundSchema.parse( + getLibraryHubsMediaContainer, + ), + ); +} + +export function getLibraryHubsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsResponseBody$inboundSchema: z.ZodType< GetLibraryHubsResponseBody, @@ -913,6 +1116,24 @@ export namespace GetLibraryHubsResponseBody$ { export type Outbound = GetLibraryHubsResponseBody$Outbound; } +export function getLibraryHubsResponseBodyToJSON( + getLibraryHubsResponseBody: GetLibraryHubsResponseBody, +): string { + return JSON.stringify( + GetLibraryHubsResponseBody$outboundSchema.parse(getLibraryHubsResponseBody), + ); +} + +export function getLibraryHubsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetLibraryHubsResponse$inboundSchema: z.ZodType< GetLibraryHubsResponse, @@ -971,3 +1192,21 @@ export namespace GetLibraryHubsResponse$ { /** @deprecated use `GetLibraryHubsResponse$Outbound` instead. */ export type Outbound = GetLibraryHubsResponse$Outbound; } + +export function getLibraryHubsResponseToJSON( + getLibraryHubsResponse: GetLibraryHubsResponse, +): string { + return JSON.stringify( + GetLibraryHubsResponse$outboundSchema.parse(getLibraryHubsResponse), + ); +} + +export function getLibraryHubsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryHubsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryHubsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getlibraryitems.ts b/src/sdk/models/operations/getlibraryitems.ts index d39703b2..0086937b 100644 --- a/src/sdk/models/operations/getlibraryitems.ts +++ b/src/sdk/models/operations/getlibraryitems.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * A key representing a specific tag within the section. @@ -29,6 +32,7 @@ export enum Tag { Resolution = "resolution", FirstCharacter = "firstCharacter", Folder = "folder", + Albums = "albums", } /** @@ -57,6 +61,8 @@ export enum GetLibraryItemsQueryParamType { Season = 3, Episode = 4, Audio = 8, + Album = 9, + Track = 10, } /** @@ -221,16 +227,16 @@ export enum GetLibraryItemsFlattenSeasons { * @remarks * None = Library default, * tmdbAiring = The Movie Database (Aired), - * aired = TheTVDB (Aired), - * dvd = TheTVDB (DVD), - * absolute = TheTVDB (Absolute)). + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). */ export enum GetLibraryItemsShowOrdering { None = "None", TmdbAiring = "tmdbAiring", - Aired = "aired", - Dvd = "dvd", - Absolute = "absolute", + TvdbAiring = "tvdbAiring", + TvdbDvd = "tvdbDvd", + TvdbAbsolute = "tvdbAbsolute", } export enum GetLibraryItemsOptimizedForStreaming { @@ -561,9 +567,9 @@ export type GetLibraryItemsMetadata = { * @remarks * None = Library default, * tmdbAiring = The Movie Database (Aired), - * aired = TheTVDB (Aired), - * dvd = TheTVDB (DVD), - * absolute = TheTVDB (Absolute)). + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). */ showOrdering?: GetLibraryItemsShowOrdering | undefined; thumb?: string | undefined; @@ -939,6 +945,24 @@ export namespace GetLibraryItemsRequest$ { export type Outbound = GetLibraryItemsRequest$Outbound; } +export function getLibraryItemsRequestToJSON( + getLibraryItemsRequest: GetLibraryItemsRequest, +): string { + return JSON.stringify( + GetLibraryItemsRequest$outboundSchema.parse(getLibraryItemsRequest), + ); +} + +export function getLibraryItemsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsRequest' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsFilter$inboundSchema: z.ZodType< GetLibraryItemsFilter, @@ -987,6 +1011,24 @@ export namespace GetLibraryItemsFilter$ { export type Outbound = GetLibraryItemsFilter$Outbound; } +export function getLibraryItemsFilterToJSON( + getLibraryItemsFilter: GetLibraryItemsFilter, +): string { + return JSON.stringify( + GetLibraryItemsFilter$outboundSchema.parse(getLibraryItemsFilter), + ); +} + +export function getLibraryItemsFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsFilter' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsActiveDirection$inboundSchema: z.ZodNativeEnum< typeof GetLibraryItemsActiveDirection @@ -1094,6 +1136,24 @@ export namespace GetLibraryItemsSort$ { export type Outbound = GetLibraryItemsSort$Outbound; } +export function getLibraryItemsSortToJSON( + getLibraryItemsSort: GetLibraryItemsSort, +): string { + return JSON.stringify( + GetLibraryItemsSort$outboundSchema.parse(getLibraryItemsSort), + ); +} + +export function getLibraryItemsSortFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsSort$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsSort' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsField$inboundSchema: z.ZodType< GetLibraryItemsField, @@ -1139,6 +1199,24 @@ export namespace GetLibraryItemsField$ { export type Outbound = GetLibraryItemsField$Outbound; } +export function getLibraryItemsFieldToJSON( + getLibraryItemsField: GetLibraryItemsField, +): string { + return JSON.stringify( + GetLibraryItemsField$outboundSchema.parse(getLibraryItemsField), + ); +} + +export function getLibraryItemsFieldFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsField$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsField' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsType$inboundSchema: z.ZodType< GetLibraryItemsType, @@ -1206,6 +1284,24 @@ export namespace GetLibraryItemsType$ { export type Outbound = GetLibraryItemsType$Outbound; } +export function getLibraryItemsTypeToJSON( + getLibraryItemsType: GetLibraryItemsType, +): string { + return JSON.stringify( + GetLibraryItemsType$outboundSchema.parse(getLibraryItemsType), + ); +} + +export function getLibraryItemsTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsType' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsOperator$inboundSchema: z.ZodType< GetLibraryItemsOperator, @@ -1245,6 +1341,24 @@ export namespace GetLibraryItemsOperator$ { export type Outbound = GetLibraryItemsOperator$Outbound; } +export function getLibraryItemsOperatorToJSON( + getLibraryItemsOperator: GetLibraryItemsOperator, +): string { + return JSON.stringify( + GetLibraryItemsOperator$outboundSchema.parse(getLibraryItemsOperator), + ); +} + +export function getLibraryItemsOperatorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsOperator$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsOperator' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsFieldType$inboundSchema: z.ZodType< GetLibraryItemsFieldType, @@ -1292,6 +1406,24 @@ export namespace GetLibraryItemsFieldType$ { export type Outbound = GetLibraryItemsFieldType$Outbound; } +export function getLibraryItemsFieldTypeToJSON( + getLibraryItemsFieldType: GetLibraryItemsFieldType, +): string { + return JSON.stringify( + GetLibraryItemsFieldType$outboundSchema.parse(getLibraryItemsFieldType), + ); +} + +export function getLibraryItemsFieldTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsFieldType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsFieldType' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryType$inboundSchema: z.ZodNativeEnum< typeof GetLibraryItemsLibraryType @@ -1547,6 +1679,24 @@ export namespace GetLibraryItemsStream$ { export type Outbound = GetLibraryItemsStream$Outbound; } +export function getLibraryItemsStreamToJSON( + getLibraryItemsStream: GetLibraryItemsStream, +): string { + return JSON.stringify( + GetLibraryItemsStream$outboundSchema.parse(getLibraryItemsStream), + ); +} + +export function getLibraryItemsStreamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsStream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsStream' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsPart$inboundSchema: z.ZodType< GetLibraryItemsPart, @@ -1632,6 +1782,24 @@ export namespace GetLibraryItemsPart$ { export type Outbound = GetLibraryItemsPart$Outbound; } +export function getLibraryItemsPartToJSON( + getLibraryItemsPart: GetLibraryItemsPart, +): string { + return JSON.stringify( + GetLibraryItemsPart$outboundSchema.parse(getLibraryItemsPart), + ); +} + +export function getLibraryItemsPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsPart' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsMedia$inboundSchema: z.ZodType< GetLibraryItemsMedia, @@ -1728,6 +1896,24 @@ export namespace GetLibraryItemsMedia$ { export type Outbound = GetLibraryItemsMedia$Outbound; } +export function getLibraryItemsMediaToJSON( + getLibraryItemsMedia: GetLibraryItemsMedia, +): string { + return JSON.stringify( + GetLibraryItemsMedia$outboundSchema.parse(getLibraryItemsMedia), + ); +} + +export function getLibraryItemsMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsMedia' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsGenre$inboundSchema: z.ZodType< GetLibraryItemsGenre, @@ -1764,6 +1950,24 @@ export namespace GetLibraryItemsGenre$ { export type Outbound = GetLibraryItemsGenre$Outbound; } +export function getLibraryItemsGenreToJSON( + getLibraryItemsGenre: GetLibraryItemsGenre, +): string { + return JSON.stringify( + GetLibraryItemsGenre$outboundSchema.parse(getLibraryItemsGenre), + ); +} + +export function getLibraryItemsGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsGenre' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsCountry$inboundSchema: z.ZodType< GetLibraryItemsCountry, @@ -1800,6 +2004,24 @@ export namespace GetLibraryItemsCountry$ { export type Outbound = GetLibraryItemsCountry$Outbound; } +export function getLibraryItemsCountryToJSON( + getLibraryItemsCountry: GetLibraryItemsCountry, +): string { + return JSON.stringify( + GetLibraryItemsCountry$outboundSchema.parse(getLibraryItemsCountry), + ); +} + +export function getLibraryItemsCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsCountry' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsDirector$inboundSchema: z.ZodType< GetLibraryItemsDirector, @@ -1836,6 +2058,24 @@ export namespace GetLibraryItemsDirector$ { export type Outbound = GetLibraryItemsDirector$Outbound; } +export function getLibraryItemsDirectorToJSON( + getLibraryItemsDirector: GetLibraryItemsDirector, +): string { + return JSON.stringify( + GetLibraryItemsDirector$outboundSchema.parse(getLibraryItemsDirector), + ); +} + +export function getLibraryItemsDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsDirector' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsWriter$inboundSchema: z.ZodType< GetLibraryItemsWriter, @@ -1872,6 +2112,24 @@ export namespace GetLibraryItemsWriter$ { export type Outbound = GetLibraryItemsWriter$Outbound; } +export function getLibraryItemsWriterToJSON( + getLibraryItemsWriter: GetLibraryItemsWriter, +): string { + return JSON.stringify( + GetLibraryItemsWriter$outboundSchema.parse(getLibraryItemsWriter), + ); +} + +export function getLibraryItemsWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsWriter' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsCollection$inboundSchema: z.ZodType< GetLibraryItemsCollection, @@ -1908,6 +2166,24 @@ export namespace GetLibraryItemsCollection$ { export type Outbound = GetLibraryItemsCollection$Outbound; } +export function getLibraryItemsCollectionToJSON( + getLibraryItemsCollection: GetLibraryItemsCollection, +): string { + return JSON.stringify( + GetLibraryItemsCollection$outboundSchema.parse(getLibraryItemsCollection), + ); +} + +export function getLibraryItemsCollectionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsCollection$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsCollection' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsRole$inboundSchema: z.ZodType< GetLibraryItemsRole, @@ -1959,6 +2235,24 @@ export namespace GetLibraryItemsRole$ { export type Outbound = GetLibraryItemsRole$Outbound; } +export function getLibraryItemsRoleToJSON( + getLibraryItemsRole: GetLibraryItemsRole, +): string { + return JSON.stringify( + GetLibraryItemsRole$outboundSchema.parse(getLibraryItemsRole), + ); +} + +export function getLibraryItemsRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsRole' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLocation$inboundSchema: z.ZodType< GetLibraryItemsLocation, @@ -1995,6 +2289,24 @@ export namespace GetLibraryItemsLocation$ { export type Outbound = GetLibraryItemsLocation$Outbound; } +export function getLibraryItemsLocationToJSON( + getLibraryItemsLocation: GetLibraryItemsLocation, +): string { + return JSON.stringify( + GetLibraryItemsLocation$outboundSchema.parse(getLibraryItemsLocation), + ); +} + +export function getLibraryItemsLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLocation' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsMediaGuid$inboundSchema: z.ZodType< GetLibraryItemsMediaGuid, @@ -2031,6 +2343,24 @@ export namespace GetLibraryItemsMediaGuid$ { export type Outbound = GetLibraryItemsMediaGuid$Outbound; } +export function getLibraryItemsMediaGuidToJSON( + getLibraryItemsMediaGuid: GetLibraryItemsMediaGuid, +): string { + return JSON.stringify( + GetLibraryItemsMediaGuid$outboundSchema.parse(getLibraryItemsMediaGuid), + ); +} + +export function getLibraryItemsMediaGuidFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsMediaGuid$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsMediaGuid' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsUltraBlurColors$inboundSchema: z.ZodType< GetLibraryItemsUltraBlurColors, @@ -2076,6 +2406,26 @@ export namespace GetLibraryItemsUltraBlurColors$ { export type Outbound = GetLibraryItemsUltraBlurColors$Outbound; } +export function getLibraryItemsUltraBlurColorsToJSON( + getLibraryItemsUltraBlurColors: GetLibraryItemsUltraBlurColors, +): string { + return JSON.stringify( + GetLibraryItemsUltraBlurColors$outboundSchema.parse( + getLibraryItemsUltraBlurColors, + ), + ); +} + +export function getLibraryItemsUltraBlurColorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsUltraBlurColors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsUltraBlurColors' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsMetaDataRating$inboundSchema: z.ZodType< GetLibraryItemsMetaDataRating, @@ -2118,6 +2468,26 @@ export namespace GetLibraryItemsMetaDataRating$ { export type Outbound = GetLibraryItemsMetaDataRating$Outbound; } +export function getLibraryItemsMetaDataRatingToJSON( + getLibraryItemsMetaDataRating: GetLibraryItemsMetaDataRating, +): string { + return JSON.stringify( + GetLibraryItemsMetaDataRating$outboundSchema.parse( + getLibraryItemsMetaDataRating, + ), + ); +} + +export function getLibraryItemsMetaDataRatingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsMetaDataRating$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsMetaDataRating' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryResponse200Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum( @@ -2184,6 +2554,24 @@ export namespace GetLibraryItemsImage$ { export type Outbound = GetLibraryItemsImage$Outbound; } +export function getLibraryItemsImageToJSON( + getLibraryItemsImage: GetLibraryItemsImage, +): string { + return JSON.stringify( + GetLibraryItemsImage$outboundSchema.parse(getLibraryItemsImage), + ); +} + +export function getLibraryItemsImageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsImage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsImage' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsMetadata$inboundSchema: z.ZodType< GetLibraryItemsMetadata, @@ -2490,6 +2878,24 @@ export namespace GetLibraryItemsMetadata$ { export type Outbound = GetLibraryItemsMetadata$Outbound; } +export function getLibraryItemsMetadataToJSON( + getLibraryItemsMetadata: GetLibraryItemsMetadata, +): string { + return JSON.stringify( + GetLibraryItemsMetadata$outboundSchema.parse(getLibraryItemsMetadata), + ); +} + +export function getLibraryItemsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsMetadata' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryFilter$inboundSchema: z.ZodType< GetLibraryItemsLibraryFilter, @@ -2538,6 +2944,26 @@ export namespace GetLibraryItemsLibraryFilter$ { export type Outbound = GetLibraryItemsLibraryFilter$Outbound; } +export function getLibraryItemsLibraryFilterToJSON( + getLibraryItemsLibraryFilter: GetLibraryItemsLibraryFilter, +): string { + return JSON.stringify( + GetLibraryItemsLibraryFilter$outboundSchema.parse( + getLibraryItemsLibraryFilter, + ), + ); +} + +export function getLibraryItemsLibraryFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLibraryFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibraryFilter' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryActiveDirection$inboundSchema: z.ZodNativeEnum = z.nativeEnum( @@ -2649,6 +3075,24 @@ export namespace GetLibraryItemsLibrarySort$ { export type Outbound = GetLibraryItemsLibrarySort$Outbound; } +export function getLibraryItemsLibrarySortToJSON( + getLibraryItemsLibrarySort: GetLibraryItemsLibrarySort, +): string { + return JSON.stringify( + GetLibraryItemsLibrarySort$outboundSchema.parse(getLibraryItemsLibrarySort), + ); +} + +export function getLibraryItemsLibrarySortFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLibrarySort$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibrarySort' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryField$inboundSchema: z.ZodType< GetLibraryItemsLibraryField, @@ -2694,6 +3138,26 @@ export namespace GetLibraryItemsLibraryField$ { export type Outbound = GetLibraryItemsLibraryField$Outbound; } +export function getLibraryItemsLibraryFieldToJSON( + getLibraryItemsLibraryField: GetLibraryItemsLibraryField, +): string { + return JSON.stringify( + GetLibraryItemsLibraryField$outboundSchema.parse( + getLibraryItemsLibraryField, + ), + ); +} + +export function getLibraryItemsLibraryFieldFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLibraryField$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibraryField' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryResponseType$inboundSchema: z.ZodType< GetLibraryItemsLibraryResponseType, @@ -2767,6 +3231,27 @@ export namespace GetLibraryItemsLibraryResponseType$ { export type Outbound = GetLibraryItemsLibraryResponseType$Outbound; } +export function getLibraryItemsLibraryResponseTypeToJSON( + getLibraryItemsLibraryResponseType: GetLibraryItemsLibraryResponseType, +): string { + return JSON.stringify( + GetLibraryItemsLibraryResponseType$outboundSchema.parse( + getLibraryItemsLibraryResponseType, + ), + ); +} + +export function getLibraryItemsLibraryResponseTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetLibraryItemsLibraryResponseType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibraryResponseType' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryOperator$inboundSchema: z.ZodType< GetLibraryItemsLibraryOperator, @@ -2806,6 +3291,26 @@ export namespace GetLibraryItemsLibraryOperator$ { export type Outbound = GetLibraryItemsLibraryOperator$Outbound; } +export function getLibraryItemsLibraryOperatorToJSON( + getLibraryItemsLibraryOperator: GetLibraryItemsLibraryOperator, +): string { + return JSON.stringify( + GetLibraryItemsLibraryOperator$outboundSchema.parse( + getLibraryItemsLibraryOperator, + ), + ); +} + +export function getLibraryItemsLibraryOperatorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLibraryOperator$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibraryOperator' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsLibraryFieldType$inboundSchema: z.ZodType< GetLibraryItemsLibraryFieldType, @@ -2855,6 +3360,26 @@ export namespace GetLibraryItemsLibraryFieldType$ { export type Outbound = GetLibraryItemsLibraryFieldType$Outbound; } +export function getLibraryItemsLibraryFieldTypeToJSON( + getLibraryItemsLibraryFieldType: GetLibraryItemsLibraryFieldType, +): string { + return JSON.stringify( + GetLibraryItemsLibraryFieldType$outboundSchema.parse( + getLibraryItemsLibraryFieldType, + ), + ); +} + +export function getLibraryItemsLibraryFieldTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsLibraryFieldType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsLibraryFieldType' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsMeta$inboundSchema: z.ZodType< GetLibraryItemsMeta, @@ -2910,6 +3435,24 @@ export namespace GetLibraryItemsMeta$ { export type Outbound = GetLibraryItemsMeta$Outbound; } +export function getLibraryItemsMetaToJSON( + getLibraryItemsMeta: GetLibraryItemsMeta, +): string { + return JSON.stringify( + GetLibraryItemsMeta$outboundSchema.parse(getLibraryItemsMeta), + ); +} + +export function getLibraryItemsMetaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsMeta$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsMeta' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsMediaContainer$inboundSchema: z.ZodType< GetLibraryItemsMediaContainer, @@ -3030,6 +3573,26 @@ export namespace GetLibraryItemsMediaContainer$ { export type Outbound = GetLibraryItemsMediaContainer$Outbound; } +export function getLibraryItemsMediaContainerToJSON( + getLibraryItemsMediaContainer: GetLibraryItemsMediaContainer, +): string { + return JSON.stringify( + GetLibraryItemsMediaContainer$outboundSchema.parse( + getLibraryItemsMediaContainer, + ), + ); +} + +export function getLibraryItemsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsResponseBody$inboundSchema: z.ZodType< GetLibraryItemsResponseBody, @@ -3076,6 +3639,26 @@ export namespace GetLibraryItemsResponseBody$ { export type Outbound = GetLibraryItemsResponseBody$Outbound; } +export function getLibraryItemsResponseBodyToJSON( + getLibraryItemsResponseBody: GetLibraryItemsResponseBody, +): string { + return JSON.stringify( + GetLibraryItemsResponseBody$outboundSchema.parse( + getLibraryItemsResponseBody, + ), + ); +} + +export function getLibraryItemsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetLibraryItemsResponse$inboundSchema: z.ZodType< GetLibraryItemsResponse, @@ -3134,3 +3717,21 @@ export namespace GetLibraryItemsResponse$ { /** @deprecated use `GetLibraryItemsResponse$Outbound` instead. */ export type Outbound = GetLibraryItemsResponse$Outbound; } + +export function getLibraryItemsResponseToJSON( + getLibraryItemsResponse: GetLibraryItemsResponse, +): string { + return JSON.stringify( + GetLibraryItemsResponse$outboundSchema.parse(getLibraryItemsResponse), + ); +} + +export function getLibraryItemsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetLibraryItemsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetLibraryItemsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getmediaproviders.ts b/src/sdk/models/operations/getmediaproviders.ts index ad3538a8..f16c1611 100644 --- a/src/sdk/models/operations/getmediaproviders.ts +++ b/src/sdk/models/operations/getmediaproviders.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetMediaProvidersRequest = { /** @@ -178,6 +181,24 @@ export namespace GetMediaProvidersRequest$ { export type Outbound = GetMediaProvidersRequest$Outbound; } +export function getMediaProvidersRequestToJSON( + getMediaProvidersRequest: GetMediaProvidersRequest, +): string { + return JSON.stringify( + GetMediaProvidersRequest$outboundSchema.parse(getMediaProvidersRequest), + ); +} + +export function getMediaProvidersRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersRequest' from JSON`, + ); +} + /** @internal */ export const Pivot$inboundSchema: z.ZodType = z .object({ @@ -226,6 +247,20 @@ export namespace Pivot$ { export type Outbound = Pivot$Outbound; } +export function pivotToJSON(pivot: Pivot): string { + return JSON.stringify(Pivot$outboundSchema.parse(pivot)); +} + +export function pivotFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Pivot$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Pivot' from JSON`, + ); +} + /** @internal */ export const GetMediaProvidersDirectory$inboundSchema: z.ZodType< GetMediaProvidersDirectory, @@ -309,6 +344,24 @@ export namespace GetMediaProvidersDirectory$ { export type Outbound = GetMediaProvidersDirectory$Outbound; } +export function getMediaProvidersDirectoryToJSON( + getMediaProvidersDirectory: GetMediaProvidersDirectory, +): string { + return JSON.stringify( + GetMediaProvidersDirectory$outboundSchema.parse(getMediaProvidersDirectory), + ); +} + +export function getMediaProvidersDirectoryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersDirectory$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersDirectory' from JSON`, + ); +} + /** @internal */ export const Action$inboundSchema: z.ZodType = z .object({ @@ -345,6 +398,20 @@ export namespace Action$ { export type Outbound = Action$Outbound; } +export function actionToJSON(action: Action): string { + return JSON.stringify(Action$outboundSchema.parse(action)); +} + +export function actionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Action$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Action' from JSON`, + ); +} + /** @internal */ export const Feature$inboundSchema: z.ZodType = z.object({ @@ -408,6 +475,20 @@ export namespace Feature$ { export type Outbound = Feature$Outbound; } +export function featureToJSON(feature: Feature): string { + return JSON.stringify(Feature$outboundSchema.parse(feature)); +} + +export function featureFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Feature$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Feature' from JSON`, + ); +} + /** @internal */ export const MediaProvider$inboundSchema: z.ZodType< MediaProvider, @@ -464,6 +545,20 @@ export namespace MediaProvider$ { export type Outbound = MediaProvider$Outbound; } +export function mediaProviderToJSON(mediaProvider: MediaProvider): string { + return JSON.stringify(MediaProvider$outboundSchema.parse(mediaProvider)); +} + +export function mediaProviderFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MediaProvider$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MediaProvider' from JSON`, + ); +} + /** @internal */ export const GetMediaProvidersMediaContainer$inboundSchema: z.ZodType< GetMediaProvidersMediaContainer, @@ -637,6 +732,26 @@ export namespace GetMediaProvidersMediaContainer$ { export type Outbound = GetMediaProvidersMediaContainer$Outbound; } +export function getMediaProvidersMediaContainerToJSON( + getMediaProvidersMediaContainer: GetMediaProvidersMediaContainer, +): string { + return JSON.stringify( + GetMediaProvidersMediaContainer$outboundSchema.parse( + getMediaProvidersMediaContainer, + ), + ); +} + +export function getMediaProvidersMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetMediaProvidersResponseBody$inboundSchema: z.ZodType< GetMediaProvidersResponseBody, @@ -683,6 +798,26 @@ export namespace GetMediaProvidersResponseBody$ { export type Outbound = GetMediaProvidersResponseBody$Outbound; } +export function getMediaProvidersResponseBodyToJSON( + getMediaProvidersResponseBody: GetMediaProvidersResponseBody, +): string { + return JSON.stringify( + GetMediaProvidersResponseBody$outboundSchema.parse( + getMediaProvidersResponseBody, + ), + ); +} + +export function getMediaProvidersResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersResponseBody' from JSON`, + ); +} + /** @internal */ export const GetMediaProvidersResponse$inboundSchema: z.ZodType< GetMediaProvidersResponse, @@ -741,3 +876,21 @@ export namespace GetMediaProvidersResponse$ { /** @deprecated use `GetMediaProvidersResponse$Outbound` instead. */ export type Outbound = GetMediaProvidersResponse$Outbound; } + +export function getMediaProvidersResponseToJSON( + getMediaProvidersResponse: GetMediaProvidersResponse, +): string { + return JSON.stringify( + GetMediaProvidersResponse$outboundSchema.parse(getMediaProvidersResponse), + ); +} + +export function getMediaProvidersResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMediaProvidersResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMediaProvidersResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getmetadatabyratingkey.ts b/src/sdk/models/operations/getmetadatabyratingkey.ts index 0ced9c3f..ecafc8e7 100644 --- a/src/sdk/models/operations/getmetadatabyratingkey.ts +++ b/src/sdk/models/operations/getmetadatabyratingkey.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetMetaDataByRatingKeyRequest = { /** @@ -147,6 +150,26 @@ export type GetMetaDataByRatingKeyMetadata = { librarySectionTitle?: string | undefined; librarySectionID?: number | undefined; librarySectionKey?: string | undefined; + /** + * The name of the album artist for the track when audio, and the name of the TV show for the episode when video. + */ + grandparentTitle?: string | undefined; + /** + * The name of the album for the track when audio, and the name of the season for the episode when TV show. + */ + parentTitle?: string | undefined; + /** + * The orginal untranslated name of the media item when non-english. + */ + originalTitle?: string | undefined; + /** + * The index starting from 0 of this media item in the MetaData array. + */ + index?: number | undefined; + /** + * The parent index starting from 0 of this media item in the parent MetaData array. + */ + parentIndex?: number | undefined; contentRating?: string | undefined; summary?: string | undefined; rating?: number | undefined; @@ -247,6 +270,26 @@ export namespace GetMetaDataByRatingKeyRequest$ { export type Outbound = GetMetaDataByRatingKeyRequest$Outbound; } +export function getMetaDataByRatingKeyRequestToJSON( + getMetaDataByRatingKeyRequest: GetMetaDataByRatingKeyRequest, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyRequest$outboundSchema.parse( + getMetaDataByRatingKeyRequest, + ), + ); +} + +export function getMetaDataByRatingKeyRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyRequest' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyStream$inboundSchema: z.ZodType< GetMetaDataByRatingKeyStream, @@ -376,6 +419,26 @@ export namespace GetMetaDataByRatingKeyStream$ { export type Outbound = GetMetaDataByRatingKeyStream$Outbound; } +export function getMetaDataByRatingKeyStreamToJSON( + getMetaDataByRatingKeyStream: GetMetaDataByRatingKeyStream, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyStream$outboundSchema.parse( + getMetaDataByRatingKeyStream, + ), + ); +} + +export function getMetaDataByRatingKeyStreamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyStream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyStream' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyPart$inboundSchema: z.ZodType< GetMetaDataByRatingKeyPart, @@ -452,6 +515,24 @@ export namespace GetMetaDataByRatingKeyPart$ { export type Outbound = GetMetaDataByRatingKeyPart$Outbound; } +export function getMetaDataByRatingKeyPartToJSON( + getMetaDataByRatingKeyPart: GetMetaDataByRatingKeyPart, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyPart$outboundSchema.parse(getMetaDataByRatingKeyPart), + ); +} + +export function getMetaDataByRatingKeyPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyPart' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyMedia$inboundSchema: z.ZodType< GetMetaDataByRatingKeyMedia, @@ -546,6 +627,26 @@ export namespace GetMetaDataByRatingKeyMedia$ { export type Outbound = GetMetaDataByRatingKeyMedia$Outbound; } +export function getMetaDataByRatingKeyMediaToJSON( + getMetaDataByRatingKeyMedia: GetMetaDataByRatingKeyMedia, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyMedia$outboundSchema.parse( + getMetaDataByRatingKeyMedia, + ), + ); +} + +export function getMetaDataByRatingKeyMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyMedia' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyGenre$inboundSchema: z.ZodType< GetMetaDataByRatingKeyGenre, @@ -588,6 +689,26 @@ export namespace GetMetaDataByRatingKeyGenre$ { export type Outbound = GetMetaDataByRatingKeyGenre$Outbound; } +export function getMetaDataByRatingKeyGenreToJSON( + getMetaDataByRatingKeyGenre: GetMetaDataByRatingKeyGenre, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyGenre$outboundSchema.parse( + getMetaDataByRatingKeyGenre, + ), + ); +} + +export function getMetaDataByRatingKeyGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyGenre' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyCountry$inboundSchema: z.ZodType< GetMetaDataByRatingKeyCountry, @@ -630,6 +751,26 @@ export namespace GetMetaDataByRatingKeyCountry$ { export type Outbound = GetMetaDataByRatingKeyCountry$Outbound; } +export function getMetaDataByRatingKeyCountryToJSON( + getMetaDataByRatingKeyCountry: GetMetaDataByRatingKeyCountry, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyCountry$outboundSchema.parse( + getMetaDataByRatingKeyCountry, + ), + ); +} + +export function getMetaDataByRatingKeyCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyCountry' from JSON`, + ); +} + /** @internal */ export const Guids$inboundSchema: z.ZodType = z .object({ @@ -663,6 +804,20 @@ export namespace Guids$ { export type Outbound = Guids$Outbound; } +export function guidsToJSON(guids: Guids): string { + return JSON.stringify(Guids$outboundSchema.parse(guids)); +} + +export function guidsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Guids$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Guids' from JSON`, + ); +} + /** @internal */ export const Ratings$inboundSchema: z.ZodType = z.object({ @@ -702,6 +857,20 @@ export namespace Ratings$ { export type Outbound = Ratings$Outbound; } +export function ratingsToJSON(ratings: Ratings): string { + return JSON.stringify(Ratings$outboundSchema.parse(ratings)); +} + +export function ratingsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Ratings$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Ratings' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyDirector$inboundSchema: z.ZodType< GetMetaDataByRatingKeyDirector, @@ -750,6 +919,26 @@ export namespace GetMetaDataByRatingKeyDirector$ { export type Outbound = GetMetaDataByRatingKeyDirector$Outbound; } +export function getMetaDataByRatingKeyDirectorToJSON( + getMetaDataByRatingKeyDirector: GetMetaDataByRatingKeyDirector, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyDirector$outboundSchema.parse( + getMetaDataByRatingKeyDirector, + ), + ); +} + +export function getMetaDataByRatingKeyDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyDirector' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyWriter$inboundSchema: z.ZodType< GetMetaDataByRatingKeyWriter, @@ -798,6 +987,26 @@ export namespace GetMetaDataByRatingKeyWriter$ { export type Outbound = GetMetaDataByRatingKeyWriter$Outbound; } +export function getMetaDataByRatingKeyWriterToJSON( + getMetaDataByRatingKeyWriter: GetMetaDataByRatingKeyWriter, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyWriter$outboundSchema.parse( + getMetaDataByRatingKeyWriter, + ), + ); +} + +export function getMetaDataByRatingKeyWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyWriter' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyRole$inboundSchema: z.ZodType< GetMetaDataByRatingKeyRole, @@ -849,6 +1058,24 @@ export namespace GetMetaDataByRatingKeyRole$ { export type Outbound = GetMetaDataByRatingKeyRole$Outbound; } +export function getMetaDataByRatingKeyRoleToJSON( + getMetaDataByRatingKeyRole: GetMetaDataByRatingKeyRole, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyRole$outboundSchema.parse(getMetaDataByRatingKeyRole), + ); +} + +export function getMetaDataByRatingKeyRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyRole' from JSON`, + ); +} + /** @internal */ export const Producer$inboundSchema: z.ZodType< Producer, @@ -897,6 +1124,20 @@ export namespace Producer$ { export type Outbound = Producer$Outbound; } +export function producerToJSON(producer: Producer): string { + return JSON.stringify(Producer$outboundSchema.parse(producer)); +} + +export function producerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Producer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Producer' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyMetadata$inboundSchema: z.ZodType< GetMetaDataByRatingKeyMetadata, @@ -912,6 +1153,11 @@ export const GetMetaDataByRatingKeyMetadata$inboundSchema: z.ZodType< librarySectionTitle: z.string().optional(), librarySectionID: z.number().int().optional(), librarySectionKey: z.string().optional(), + grandparentTitle: z.string().optional(), + parentTitle: z.string().optional(), + originalTitle: z.string().optional(), + index: z.number().int().optional(), + parentIndex: z.number().int().optional(), contentRating: z.string().optional(), summary: z.string().optional(), rating: z.number().optional(), @@ -967,6 +1213,11 @@ export type GetMetaDataByRatingKeyMetadata$Outbound = { librarySectionTitle?: string | undefined; librarySectionID?: number | undefined; librarySectionKey?: string | undefined; + grandparentTitle?: string | undefined; + parentTitle?: string | undefined; + originalTitle?: string | undefined; + index?: number | undefined; + parentIndex?: number | undefined; contentRating?: string | undefined; summary?: string | undefined; rating?: number | undefined; @@ -1008,6 +1259,11 @@ export const GetMetaDataByRatingKeyMetadata$outboundSchema: z.ZodType< librarySectionTitle: z.string().optional(), librarySectionID: z.number().int().optional(), librarySectionKey: z.string().optional(), + grandparentTitle: z.string().optional(), + parentTitle: z.string().optional(), + originalTitle: z.string().optional(), + index: z.number().int().optional(), + parentIndex: z.number().int().optional(), contentRating: z.string().optional(), summary: z.string().optional(), rating: z.number().optional(), @@ -1066,6 +1322,26 @@ export namespace GetMetaDataByRatingKeyMetadata$ { export type Outbound = GetMetaDataByRatingKeyMetadata$Outbound; } +export function getMetaDataByRatingKeyMetadataToJSON( + getMetaDataByRatingKeyMetadata: GetMetaDataByRatingKeyMetadata, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyMetadata$outboundSchema.parse( + getMetaDataByRatingKeyMetadata, + ), + ); +} + +export function getMetaDataByRatingKeyMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyMetadata' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyMediaContainer$inboundSchema: z.ZodType< GetMetaDataByRatingKeyMediaContainer, @@ -1138,6 +1414,27 @@ export namespace GetMetaDataByRatingKeyMediaContainer$ { export type Outbound = GetMetaDataByRatingKeyMediaContainer$Outbound; } +export function getMetaDataByRatingKeyMediaContainerToJSON( + getMetaDataByRatingKeyMediaContainer: GetMetaDataByRatingKeyMediaContainer, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyMediaContainer$outboundSchema.parse( + getMetaDataByRatingKeyMediaContainer, + ), + ); +} + +export function getMetaDataByRatingKeyMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetMetaDataByRatingKeyMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyResponseBody$inboundSchema: z.ZodType< GetMetaDataByRatingKeyResponseBody, @@ -1187,6 +1484,27 @@ export namespace GetMetaDataByRatingKeyResponseBody$ { export type Outbound = GetMetaDataByRatingKeyResponseBody$Outbound; } +export function getMetaDataByRatingKeyResponseBodyToJSON( + getMetaDataByRatingKeyResponseBody: GetMetaDataByRatingKeyResponseBody, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyResponseBody$outboundSchema.parse( + getMetaDataByRatingKeyResponseBody, + ), + ); +} + +export function getMetaDataByRatingKeyResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetMetaDataByRatingKeyResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyResponseBody' from JSON`, + ); +} + /** @internal */ export const GetMetaDataByRatingKeyResponse$inboundSchema: z.ZodType< GetMetaDataByRatingKeyResponse, @@ -1247,3 +1565,23 @@ export namespace GetMetaDataByRatingKeyResponse$ { /** @deprecated use `GetMetaDataByRatingKeyResponse$Outbound` instead. */ export type Outbound = GetMetaDataByRatingKeyResponse$Outbound; } + +export function getMetaDataByRatingKeyResponseToJSON( + getMetaDataByRatingKeyResponse: GetMetaDataByRatingKeyResponse, +): string { + return JSON.stringify( + GetMetaDataByRatingKeyResponse$outboundSchema.parse( + getMetaDataByRatingKeyResponse, + ), + ); +} + +export function getMetaDataByRatingKeyResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetaDataByRatingKeyResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetaDataByRatingKeyResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getmetadatachildren.ts b/src/sdk/models/operations/getmetadatachildren.ts index bfebf22e..71dbca05 100644 --- a/src/sdk/models/operations/getmetadatachildren.ts +++ b/src/sdk/models/operations/getmetadatachildren.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetMetadataChildrenRequest = { /** @@ -147,6 +150,24 @@ export namespace GetMetadataChildrenRequest$ { export type Outbound = GetMetadataChildrenRequest$Outbound; } +export function getMetadataChildrenRequestToJSON( + getMetadataChildrenRequest: GetMetadataChildrenRequest, +): string { + return JSON.stringify( + GetMetadataChildrenRequest$outboundSchema.parse(getMetadataChildrenRequest), + ); +} + +export function getMetadataChildrenRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenRequest' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenDirectory$inboundSchema: z.ZodType< GetMetadataChildrenDirectory, @@ -195,6 +216,26 @@ export namespace GetMetadataChildrenDirectory$ { export type Outbound = GetMetadataChildrenDirectory$Outbound; } +export function getMetadataChildrenDirectoryToJSON( + getMetadataChildrenDirectory: GetMetadataChildrenDirectory, +): string { + return JSON.stringify( + GetMetadataChildrenDirectory$outboundSchema.parse( + getMetadataChildrenDirectory, + ), + ); +} + +export function getMetadataChildrenDirectoryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenDirectory$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenDirectory' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenMetadata$inboundSchema: z.ZodType< GetMetadataChildrenMetadata, @@ -309,6 +350,26 @@ export namespace GetMetadataChildrenMetadata$ { export type Outbound = GetMetadataChildrenMetadata$Outbound; } +export function getMetadataChildrenMetadataToJSON( + getMetadataChildrenMetadata: GetMetadataChildrenMetadata, +): string { + return JSON.stringify( + GetMetadataChildrenMetadata$outboundSchema.parse( + getMetadataChildrenMetadata, + ), + ); +} + +export function getMetadataChildrenMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenMetadata' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenMediaContainer$inboundSchema: z.ZodType< GetMetadataChildrenMediaContainer, @@ -426,6 +487,26 @@ export namespace GetMetadataChildrenMediaContainer$ { export type Outbound = GetMetadataChildrenMediaContainer$Outbound; } +export function getMetadataChildrenMediaContainerToJSON( + getMetadataChildrenMediaContainer: GetMetadataChildrenMediaContainer, +): string { + return JSON.stringify( + GetMetadataChildrenMediaContainer$outboundSchema.parse( + getMetadataChildrenMediaContainer, + ), + ); +} + +export function getMetadataChildrenMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenResponseBody$inboundSchema: z.ZodType< GetMetadataChildrenResponseBody, @@ -472,6 +553,26 @@ export namespace GetMetadataChildrenResponseBody$ { export type Outbound = GetMetadataChildrenResponseBody$Outbound; } +export function getMetadataChildrenResponseBodyToJSON( + getMetadataChildrenResponseBody: GetMetadataChildrenResponseBody, +): string { + return JSON.stringify( + GetMetadataChildrenResponseBody$outboundSchema.parse( + getMetadataChildrenResponseBody, + ), + ); +} + +export function getMetadataChildrenResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenResponseBody' from JSON`, + ); +} + /** @internal */ export const GetMetadataChildrenResponse$inboundSchema: z.ZodType< GetMetadataChildrenResponse, @@ -532,3 +633,23 @@ export namespace GetMetadataChildrenResponse$ { /** @deprecated use `GetMetadataChildrenResponse$Outbound` instead. */ export type Outbound = GetMetadataChildrenResponse$Outbound; } + +export function getMetadataChildrenResponseToJSON( + getMetadataChildrenResponse: GetMetadataChildrenResponse, +): string { + return JSON.stringify( + GetMetadataChildrenResponse$outboundSchema.parse( + getMetadataChildrenResponse, + ), + ); +} + +export function getMetadataChildrenResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMetadataChildrenResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMetadataChildrenResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getmyplexaccount.ts b/src/sdk/models/operations/getmyplexaccount.ts index 798cd606..318acb30 100644 --- a/src/sdk/models/operations/getmyplexaccount.ts +++ b/src/sdk/models/operations/getmyplexaccount.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type MyPlex = { authToken?: string | undefined; @@ -112,6 +115,20 @@ export namespace MyPlex$ { export type Outbound = MyPlex$Outbound; } +export function myPlexToJSON(myPlex: MyPlex): string { + return JSON.stringify(MyPlex$outboundSchema.parse(myPlex)); +} + +export function myPlexFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MyPlex$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MyPlex' from JSON`, + ); +} + /** @internal */ export const GetMyPlexAccountResponseBody$inboundSchema: z.ZodType< GetMyPlexAccountResponseBody, @@ -156,6 +173,26 @@ export namespace GetMyPlexAccountResponseBody$ { export type Outbound = GetMyPlexAccountResponseBody$Outbound; } +export function getMyPlexAccountResponseBodyToJSON( + getMyPlexAccountResponseBody: GetMyPlexAccountResponseBody, +): string { + return JSON.stringify( + GetMyPlexAccountResponseBody$outboundSchema.parse( + getMyPlexAccountResponseBody, + ), + ); +} + +export function getMyPlexAccountResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMyPlexAccountResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMyPlexAccountResponseBody' from JSON`, + ); +} + /** @internal */ export const GetMyPlexAccountResponse$inboundSchema: z.ZodType< GetMyPlexAccountResponse, @@ -214,3 +251,21 @@ export namespace GetMyPlexAccountResponse$ { /** @deprecated use `GetMyPlexAccountResponse$Outbound` instead. */ export type Outbound = GetMyPlexAccountResponse$Outbound; } + +export function getMyPlexAccountResponseToJSON( + getMyPlexAccountResponse: GetMyPlexAccountResponse, +): string { + return JSON.stringify( + GetMyPlexAccountResponse$outboundSchema.parse(getMyPlexAccountResponse), + ); +} + +export function getMyPlexAccountResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetMyPlexAccountResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetMyPlexAccountResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getondeck.ts b/src/sdk/models/operations/getondeck.ts index 1f5cc553..91c59037 100644 --- a/src/sdk/models/operations/getondeck.ts +++ b/src/sdk/models/operations/getondeck.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetOnDeckStream = { id?: number | undefined; @@ -242,6 +245,22 @@ export namespace GetOnDeckStream$ { export type Outbound = GetOnDeckStream$Outbound; } +export function getOnDeckStreamToJSON( + getOnDeckStream: GetOnDeckStream, +): string { + return JSON.stringify(GetOnDeckStream$outboundSchema.parse(getOnDeckStream)); +} + +export function getOnDeckStreamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckStream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckStream' from JSON`, + ); +} + /** @internal */ export const GetOnDeckPart$inboundSchema: z.ZodType< GetOnDeckPart, @@ -310,6 +329,20 @@ export namespace GetOnDeckPart$ { export type Outbound = GetOnDeckPart$Outbound; } +export function getOnDeckPartToJSON(getOnDeckPart: GetOnDeckPart): string { + return JSON.stringify(GetOnDeckPart$outboundSchema.parse(getOnDeckPart)); +} + +export function getOnDeckPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckPart' from JSON`, + ); +} + /** @internal */ export const GetOnDeckMedia$inboundSchema: z.ZodType< GetOnDeckMedia, @@ -396,6 +429,20 @@ export namespace GetOnDeckMedia$ { export type Outbound = GetOnDeckMedia$Outbound; } +export function getOnDeckMediaToJSON(getOnDeckMedia: GetOnDeckMedia): string { + return JSON.stringify(GetOnDeckMedia$outboundSchema.parse(getOnDeckMedia)); +} + +export function getOnDeckMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckMedia' from JSON`, + ); +} + /** @internal */ export const GetOnDeckGuids$inboundSchema: z.ZodType< GetOnDeckGuids, @@ -432,6 +479,20 @@ export namespace GetOnDeckGuids$ { export type Outbound = GetOnDeckGuids$Outbound; } +export function getOnDeckGuidsToJSON(getOnDeckGuids: GetOnDeckGuids): string { + return JSON.stringify(GetOnDeckGuids$outboundSchema.parse(getOnDeckGuids)); +} + +export function getOnDeckGuidsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckGuids$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckGuids' from JSON`, + ); +} + /** @internal */ export const GetOnDeckMetadata$inboundSchema: z.ZodType< GetOnDeckMetadata, @@ -585,6 +646,24 @@ export namespace GetOnDeckMetadata$ { export type Outbound = GetOnDeckMetadata$Outbound; } +export function getOnDeckMetadataToJSON( + getOnDeckMetadata: GetOnDeckMetadata, +): string { + return JSON.stringify( + GetOnDeckMetadata$outboundSchema.parse(getOnDeckMetadata), + ); +} + +export function getOnDeckMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckMetadata' from JSON`, + ); +} + /** @internal */ export const GetOnDeckMediaContainer$inboundSchema: z.ZodType< GetOnDeckMediaContainer, @@ -647,6 +726,24 @@ export namespace GetOnDeckMediaContainer$ { export type Outbound = GetOnDeckMediaContainer$Outbound; } +export function getOnDeckMediaContainerToJSON( + getOnDeckMediaContainer: GetOnDeckMediaContainer, +): string { + return JSON.stringify( + GetOnDeckMediaContainer$outboundSchema.parse(getOnDeckMediaContainer), + ); +} + +export function getOnDeckMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetOnDeckResponseBody$inboundSchema: z.ZodType< GetOnDeckResponseBody, @@ -693,6 +790,24 @@ export namespace GetOnDeckResponseBody$ { export type Outbound = GetOnDeckResponseBody$Outbound; } +export function getOnDeckResponseBodyToJSON( + getOnDeckResponseBody: GetOnDeckResponseBody, +): string { + return JSON.stringify( + GetOnDeckResponseBody$outboundSchema.parse(getOnDeckResponseBody), + ); +} + +export function getOnDeckResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckResponseBody' from JSON`, + ); +} + /** @internal */ export const GetOnDeckResponse$inboundSchema: z.ZodType< GetOnDeckResponse, @@ -751,3 +866,21 @@ export namespace GetOnDeckResponse$ { /** @deprecated use `GetOnDeckResponse$Outbound` instead. */ export type Outbound = GetOnDeckResponse$Outbound; } + +export function getOnDeckResponseToJSON( + getOnDeckResponse: GetOnDeckResponse, +): string { + return JSON.stringify( + GetOnDeckResponse$outboundSchema.parse(getOnDeckResponse), + ); +} + +export function getOnDeckResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetOnDeckResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetOnDeckResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getpin.ts b/src/sdk/models/operations/getpin.ts index ad5aa14a..c0ae9404 100644 --- a/src/sdk/models/operations/getpin.ts +++ b/src/sdk/models/operations/getpin.ts @@ -4,34 +4,14 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetPinServerList = [ "https://plex.tv/api/v2", ] as const; -export type GetPinGlobals = { - /** - * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - */ - clientID?: string | undefined; - /** - * The name of the client application. (Plex Web, Plex Media Server, etc.) - */ - clientName?: string | undefined; - /** - * A relatively friendly name for the client device - */ - deviceNickname?: string | undefined; - /** - * The version of the client application. - */ - clientVersion?: string | undefined; - /** - * The platform of the client application. - */ - platform?: string | undefined; -}; - export type GetPinRequest = { /** * Determines the kind of code returned by the API call @@ -44,7 +24,7 @@ export type GetPinRequest = { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - clientID?: string | undefined; + clientID: string; /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -159,70 +139,6 @@ export type GetPinResponse = { authPinContainer?: GetPinAuthPinContainer | undefined; }; -/** @internal */ -export const GetPinGlobals$inboundSchema: z.ZodType< - GetPinGlobals, - z.ZodTypeDef, - unknown -> = z.object({ - ClientID: z.string().optional(), - ClientName: z.string().optional(), - DeviceNickname: z.string().optional(), - ClientVersion: z.string().optional(), - Platform: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "ClientID": "clientID", - "ClientName": "clientName", - "DeviceNickname": "deviceNickname", - "ClientVersion": "clientVersion", - "Platform": "platform", - }); -}); - -/** @internal */ -export type GetPinGlobals$Outbound = { - ClientID?: string | undefined; - ClientName?: string | undefined; - DeviceNickname?: string | undefined; - ClientVersion?: string | undefined; - Platform?: string | undefined; -}; - -/** @internal */ -export const GetPinGlobals$outboundSchema: z.ZodType< - GetPinGlobals$Outbound, - z.ZodTypeDef, - GetPinGlobals -> = z.object({ - clientID: z.string().optional(), - clientName: z.string().optional(), - deviceNickname: z.string().optional(), - clientVersion: z.string().optional(), - platform: z.string().optional(), -}).transform((v) => { - return remap$(v, { - clientID: "ClientID", - clientName: "ClientName", - deviceNickname: "DeviceNickname", - clientVersion: "ClientVersion", - platform: "Platform", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetPinGlobals$ { - /** @deprecated use `GetPinGlobals$inboundSchema` instead. */ - export const inboundSchema = GetPinGlobals$inboundSchema; - /** @deprecated use `GetPinGlobals$outboundSchema` instead. */ - export const outboundSchema = GetPinGlobals$outboundSchema; - /** @deprecated use `GetPinGlobals$Outbound` instead. */ - export type Outbound = GetPinGlobals$Outbound; -} - /** @internal */ export const GetPinRequest$inboundSchema: z.ZodType< GetPinRequest, @@ -230,7 +146,7 @@ export const GetPinRequest$inboundSchema: z.ZodType< unknown > = z.object({ strong: z.boolean().default(false), - ClientID: z.string().optional(), + ClientID: z.string(), ClientName: z.string().optional(), DeviceNickname: z.string().optional(), ClientVersion: z.string().optional(), @@ -248,7 +164,7 @@ export const GetPinRequest$inboundSchema: z.ZodType< /** @internal */ export type GetPinRequest$Outbound = { strong: boolean; - ClientID?: string | undefined; + ClientID: string; ClientName?: string | undefined; DeviceNickname?: string | undefined; ClientVersion?: string | undefined; @@ -262,7 +178,7 @@ export const GetPinRequest$outboundSchema: z.ZodType< GetPinRequest > = z.object({ strong: z.boolean().default(false), - clientID: z.string().optional(), + clientID: z.string(), clientName: z.string().optional(), deviceNickname: z.string().optional(), clientVersion: z.string().optional(), @@ -290,6 +206,20 @@ export namespace GetPinRequest$ { export type Outbound = GetPinRequest$Outbound; } +export function getPinRequestToJSON(getPinRequest: GetPinRequest): string { + return JSON.stringify(GetPinRequest$outboundSchema.parse(getPinRequest)); +} + +export function getPinRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPinRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPinRequest' from JSON`, + ); +} + /** @internal */ export const GeoData$inboundSchema: z.ZodType = z.object({ @@ -371,6 +301,20 @@ export namespace GeoData$ { export type Outbound = GeoData$Outbound; } +export function geoDataToJSON(geoData: GeoData): string { + return JSON.stringify(GeoData$outboundSchema.parse(geoData)); +} + +export function geoDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GeoData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GeoData' from JSON`, + ); +} + /** @internal */ export const GetPinAuthPinContainer$inboundSchema: z.ZodType< GetPinAuthPinContainer, @@ -440,6 +384,24 @@ export namespace GetPinAuthPinContainer$ { export type Outbound = GetPinAuthPinContainer$Outbound; } +export function getPinAuthPinContainerToJSON( + getPinAuthPinContainer: GetPinAuthPinContainer, +): string { + return JSON.stringify( + GetPinAuthPinContainer$outboundSchema.parse(getPinAuthPinContainer), + ); +} + +export function getPinAuthPinContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPinAuthPinContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPinAuthPinContainer' from JSON`, + ); +} + /** @internal */ export const GetPinResponse$inboundSchema: z.ZodType< GetPinResponse, @@ -502,3 +464,17 @@ export namespace GetPinResponse$ { /** @deprecated use `GetPinResponse$Outbound` instead. */ export type Outbound = GetPinResponse$Outbound; } + +export function getPinResponseToJSON(getPinResponse: GetPinResponse): string { + return JSON.stringify(GetPinResponse$outboundSchema.parse(getPinResponse)); +} + +export function getPinResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPinResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPinResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getplaylist.ts b/src/sdk/models/operations/getplaylist.ts index c2898873..7bbd48f6 100644 --- a/src/sdk/models/operations/getplaylist.ts +++ b/src/sdk/models/operations/getplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetPlaylistRequest = { /** @@ -97,6 +100,24 @@ export namespace GetPlaylistRequest$ { export type Outbound = GetPlaylistRequest$Outbound; } +export function getPlaylistRequestToJSON( + getPlaylistRequest: GetPlaylistRequest, +): string { + return JSON.stringify( + GetPlaylistRequest$outboundSchema.parse(getPlaylistRequest), + ); +} + +export function getPlaylistRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistRequest' from JSON`, + ); +} + /** @internal */ export const GetPlaylistMetadata$inboundSchema: z.ZodType< GetPlaylistMetadata, @@ -175,6 +196,24 @@ export namespace GetPlaylistMetadata$ { export type Outbound = GetPlaylistMetadata$Outbound; } +export function getPlaylistMetadataToJSON( + getPlaylistMetadata: GetPlaylistMetadata, +): string { + return JSON.stringify( + GetPlaylistMetadata$outboundSchema.parse(getPlaylistMetadata), + ); +} + +export function getPlaylistMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistMetadata' from JSON`, + ); +} + /** @internal */ export const GetPlaylistMediaContainer$inboundSchema: z.ZodType< GetPlaylistMediaContainer, @@ -223,6 +262,24 @@ export namespace GetPlaylistMediaContainer$ { export type Outbound = GetPlaylistMediaContainer$Outbound; } +export function getPlaylistMediaContainerToJSON( + getPlaylistMediaContainer: GetPlaylistMediaContainer, +): string { + return JSON.stringify( + GetPlaylistMediaContainer$outboundSchema.parse(getPlaylistMediaContainer), + ); +} + +export function getPlaylistMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetPlaylistResponseBody$inboundSchema: z.ZodType< GetPlaylistResponseBody, @@ -269,6 +326,24 @@ export namespace GetPlaylistResponseBody$ { export type Outbound = GetPlaylistResponseBody$Outbound; } +export function getPlaylistResponseBodyToJSON( + getPlaylistResponseBody: GetPlaylistResponseBody, +): string { + return JSON.stringify( + GetPlaylistResponseBody$outboundSchema.parse(getPlaylistResponseBody), + ); +} + +export function getPlaylistResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistResponseBody' from JSON`, + ); +} + /** @internal */ export const GetPlaylistResponse$inboundSchema: z.ZodType< GetPlaylistResponse, @@ -327,3 +402,21 @@ export namespace GetPlaylistResponse$ { /** @deprecated use `GetPlaylistResponse$Outbound` instead. */ export type Outbound = GetPlaylistResponse$Outbound; } + +export function getPlaylistResponseToJSON( + getPlaylistResponse: GetPlaylistResponse, +): string { + return JSON.stringify( + GetPlaylistResponse$outboundSchema.parse(getPlaylistResponse), + ); +} + +export function getPlaylistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getplaylistcontents.ts b/src/sdk/models/operations/getplaylistcontents.ts index dfd37347..050aa798 100644 --- a/src/sdk/models/operations/getplaylistcontents.ts +++ b/src/sdk/models/operations/getplaylistcontents.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of media to retrieve. @@ -22,6 +25,8 @@ export enum GetPlaylistContentsQueryParamType { Season = 3, Episode = 4, Audio = 8, + Album = 9, + Track = 10, } export type GetPlaylistContentsRequest = { @@ -229,6 +234,24 @@ export namespace GetPlaylistContentsRequest$ { export type Outbound = GetPlaylistContentsRequest$Outbound; } +export function getPlaylistContentsRequestToJSON( + getPlaylistContentsRequest: GetPlaylistContentsRequest, +): string { + return JSON.stringify( + GetPlaylistContentsRequest$outboundSchema.parse(getPlaylistContentsRequest), + ); +} + +export function getPlaylistContentsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsRequest' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsPart$inboundSchema: z.ZodType< GetPlaylistContentsPart, @@ -292,6 +315,24 @@ export namespace GetPlaylistContentsPart$ { export type Outbound = GetPlaylistContentsPart$Outbound; } +export function getPlaylistContentsPartToJSON( + getPlaylistContentsPart: GetPlaylistContentsPart, +): string { + return JSON.stringify( + GetPlaylistContentsPart$outboundSchema.parse(getPlaylistContentsPart), + ); +} + +export function getPlaylistContentsPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsPart' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsMedia$inboundSchema: z.ZodType< GetPlaylistContentsMedia, @@ -385,6 +426,24 @@ export namespace GetPlaylistContentsMedia$ { export type Outbound = GetPlaylistContentsMedia$Outbound; } +export function getPlaylistContentsMediaToJSON( + getPlaylistContentsMedia: GetPlaylistContentsMedia, +): string { + return JSON.stringify( + GetPlaylistContentsMedia$outboundSchema.parse(getPlaylistContentsMedia), + ); +} + +export function getPlaylistContentsMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsMedia' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsGenre$inboundSchema: z.ZodType< GetPlaylistContentsGenre, @@ -421,6 +480,24 @@ export namespace GetPlaylistContentsGenre$ { export type Outbound = GetPlaylistContentsGenre$Outbound; } +export function getPlaylistContentsGenreToJSON( + getPlaylistContentsGenre: GetPlaylistContentsGenre, +): string { + return JSON.stringify( + GetPlaylistContentsGenre$outboundSchema.parse(getPlaylistContentsGenre), + ); +} + +export function getPlaylistContentsGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsGenre' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsCountry$inboundSchema: z.ZodType< GetPlaylistContentsCountry, @@ -457,6 +534,24 @@ export namespace GetPlaylistContentsCountry$ { export type Outbound = GetPlaylistContentsCountry$Outbound; } +export function getPlaylistContentsCountryToJSON( + getPlaylistContentsCountry: GetPlaylistContentsCountry, +): string { + return JSON.stringify( + GetPlaylistContentsCountry$outboundSchema.parse(getPlaylistContentsCountry), + ); +} + +export function getPlaylistContentsCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsCountry' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsDirector$inboundSchema: z.ZodType< GetPlaylistContentsDirector, @@ -493,6 +588,26 @@ export namespace GetPlaylistContentsDirector$ { export type Outbound = GetPlaylistContentsDirector$Outbound; } +export function getPlaylistContentsDirectorToJSON( + getPlaylistContentsDirector: GetPlaylistContentsDirector, +): string { + return JSON.stringify( + GetPlaylistContentsDirector$outboundSchema.parse( + getPlaylistContentsDirector, + ), + ); +} + +export function getPlaylistContentsDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsDirector' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsWriter$inboundSchema: z.ZodType< GetPlaylistContentsWriter, @@ -529,6 +644,24 @@ export namespace GetPlaylistContentsWriter$ { export type Outbound = GetPlaylistContentsWriter$Outbound; } +export function getPlaylistContentsWriterToJSON( + getPlaylistContentsWriter: GetPlaylistContentsWriter, +): string { + return JSON.stringify( + GetPlaylistContentsWriter$outboundSchema.parse(getPlaylistContentsWriter), + ); +} + +export function getPlaylistContentsWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsWriter' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsRole$inboundSchema: z.ZodType< GetPlaylistContentsRole, @@ -565,6 +698,24 @@ export namespace GetPlaylistContentsRole$ { export type Outbound = GetPlaylistContentsRole$Outbound; } +export function getPlaylistContentsRoleToJSON( + getPlaylistContentsRole: GetPlaylistContentsRole, +): string { + return JSON.stringify( + GetPlaylistContentsRole$outboundSchema.parse(getPlaylistContentsRole), + ); +} + +export function getPlaylistContentsRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsRole' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsMetadata$inboundSchema: z.ZodType< GetPlaylistContentsMetadata, @@ -724,6 +875,26 @@ export namespace GetPlaylistContentsMetadata$ { export type Outbound = GetPlaylistContentsMetadata$Outbound; } +export function getPlaylistContentsMetadataToJSON( + getPlaylistContentsMetadata: GetPlaylistContentsMetadata, +): string { + return JSON.stringify( + GetPlaylistContentsMetadata$outboundSchema.parse( + getPlaylistContentsMetadata, + ), + ); +} + +export function getPlaylistContentsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsMetadata' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsMediaContainer$inboundSchema: z.ZodType< GetPlaylistContentsMediaContainer, @@ -795,6 +966,26 @@ export namespace GetPlaylistContentsMediaContainer$ { export type Outbound = GetPlaylistContentsMediaContainer$Outbound; } +export function getPlaylistContentsMediaContainerToJSON( + getPlaylistContentsMediaContainer: GetPlaylistContentsMediaContainer, +): string { + return JSON.stringify( + GetPlaylistContentsMediaContainer$outboundSchema.parse( + getPlaylistContentsMediaContainer, + ), + ); +} + +export function getPlaylistContentsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsResponseBody$inboundSchema: z.ZodType< GetPlaylistContentsResponseBody, @@ -841,6 +1032,26 @@ export namespace GetPlaylistContentsResponseBody$ { export type Outbound = GetPlaylistContentsResponseBody$Outbound; } +export function getPlaylistContentsResponseBodyToJSON( + getPlaylistContentsResponseBody: GetPlaylistContentsResponseBody, +): string { + return JSON.stringify( + GetPlaylistContentsResponseBody$outboundSchema.parse( + getPlaylistContentsResponseBody, + ), + ); +} + +export function getPlaylistContentsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetPlaylistContentsResponse$inboundSchema: z.ZodType< GetPlaylistContentsResponse, @@ -901,3 +1112,23 @@ export namespace GetPlaylistContentsResponse$ { /** @deprecated use `GetPlaylistContentsResponse$Outbound` instead. */ export type Outbound = GetPlaylistContentsResponse$Outbound; } + +export function getPlaylistContentsResponseToJSON( + getPlaylistContentsResponse: GetPlaylistContentsResponse, +): string { + return JSON.stringify( + GetPlaylistContentsResponse$outboundSchema.parse( + getPlaylistContentsResponse, + ), + ); +} + +export function getPlaylistContentsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistContentsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistContentsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getplaylists.ts b/src/sdk/models/operations/getplaylists.ts index dc12a76e..af2dee7f 100644 --- a/src/sdk/models/operations/getplaylists.ts +++ b/src/sdk/models/operations/getplaylists.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * limit to a type of playlist. @@ -162,6 +165,24 @@ export namespace GetPlaylistsRequest$ { export type Outbound = GetPlaylistsRequest$Outbound; } +export function getPlaylistsRequestToJSON( + getPlaylistsRequest: GetPlaylistsRequest, +): string { + return JSON.stringify( + GetPlaylistsRequest$outboundSchema.parse(getPlaylistsRequest), + ); +} + +export function getPlaylistsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsRequest' from JSON`, + ); +} + /** @internal */ export const GetPlaylistsMetadata$inboundSchema: z.ZodType< GetPlaylistsMetadata, @@ -243,6 +264,24 @@ export namespace GetPlaylistsMetadata$ { export type Outbound = GetPlaylistsMetadata$Outbound; } +export function getPlaylistsMetadataToJSON( + getPlaylistsMetadata: GetPlaylistsMetadata, +): string { + return JSON.stringify( + GetPlaylistsMetadata$outboundSchema.parse(getPlaylistsMetadata), + ); +} + +export function getPlaylistsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsMetadata' from JSON`, + ); +} + /** @internal */ export const GetPlaylistsMediaContainer$inboundSchema: z.ZodType< GetPlaylistsMediaContainer, @@ -292,6 +331,24 @@ export namespace GetPlaylistsMediaContainer$ { export type Outbound = GetPlaylistsMediaContainer$Outbound; } +export function getPlaylistsMediaContainerToJSON( + getPlaylistsMediaContainer: GetPlaylistsMediaContainer, +): string { + return JSON.stringify( + GetPlaylistsMediaContainer$outboundSchema.parse(getPlaylistsMediaContainer), + ); +} + +export function getPlaylistsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetPlaylistsResponseBody$inboundSchema: z.ZodType< GetPlaylistsResponseBody, @@ -338,6 +395,24 @@ export namespace GetPlaylistsResponseBody$ { export type Outbound = GetPlaylistsResponseBody$Outbound; } +export function getPlaylistsResponseBodyToJSON( + getPlaylistsResponseBody: GetPlaylistsResponseBody, +): string { + return JSON.stringify( + GetPlaylistsResponseBody$outboundSchema.parse(getPlaylistsResponseBody), + ); +} + +export function getPlaylistsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetPlaylistsResponse$inboundSchema: z.ZodType< GetPlaylistsResponse, @@ -396,3 +471,21 @@ export namespace GetPlaylistsResponse$ { /** @deprecated use `GetPlaylistsResponse$Outbound` instead. */ export type Outbound = GetPlaylistsResponse$Outbound; } + +export function getPlaylistsResponseToJSON( + getPlaylistsResponse: GetPlaylistsResponse, +): string { + return JSON.stringify( + GetPlaylistsResponse$outboundSchema.parse(getPlaylistsResponse), + ); +} + +export function getPlaylistsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetPlaylistsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetPlaylistsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getrecentlyadded.ts b/src/sdk/models/operations/getrecentlyadded.ts index 013024b6..f67116c9 100644 --- a/src/sdk/models/operations/getrecentlyadded.ts +++ b/src/sdk/models/operations/getrecentlyadded.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of media to retrieve. @@ -22,6 +25,8 @@ export enum Type { Season = 3, Episode = 4, Audio = 8, + Album = 9, + Track = 10, } /** @@ -191,16 +196,16 @@ export enum FlattenSeasons { * @remarks * None = Library default, * tmdbAiring = The Movie Database (Aired), - * aired = TheTVDB (Aired), - * dvd = TheTVDB (DVD), - * absolute = TheTVDB (Absolute)). + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). */ export enum ShowOrdering { None = "None", TmdbAiring = "tmdbAiring", - Aired = "aired", - Dvd = "dvd", - Absolute = "absolute", + TvdbAiring = "tvdbAiring", + TvdbDvd = "tvdbDvd", + TvdbAbsolute = "tvdbAbsolute", } export enum OptimizedForStreaming { @@ -531,9 +536,9 @@ export type GetRecentlyAddedMetadata = { * @remarks * None = Library default, * tmdbAiring = The Movie Database (Aired), - * aired = TheTVDB (Aired), - * dvd = TheTVDB (DVD), - * absolute = TheTVDB (Absolute)). + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). */ showOrdering?: ShowOrdering | undefined; thumb?: string | undefined; @@ -757,6 +762,24 @@ export namespace GetRecentlyAddedRequest$ { export type Outbound = GetRecentlyAddedRequest$Outbound; } +export function getRecentlyAddedRequestToJSON( + getRecentlyAddedRequest: GetRecentlyAddedRequest, +): string { + return JSON.stringify( + GetRecentlyAddedRequest$outboundSchema.parse(getRecentlyAddedRequest), + ); +} + +export function getRecentlyAddedRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedRequest' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedFilter$inboundSchema: z.ZodType< GetRecentlyAddedFilter, @@ -805,6 +828,24 @@ export namespace GetRecentlyAddedFilter$ { export type Outbound = GetRecentlyAddedFilter$Outbound; } +export function getRecentlyAddedFilterToJSON( + getRecentlyAddedFilter: GetRecentlyAddedFilter, +): string { + return JSON.stringify( + GetRecentlyAddedFilter$outboundSchema.parse(getRecentlyAddedFilter), + ); +} + +export function getRecentlyAddedFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedFilter' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedActiveDirection$inboundSchema: z.ZodNativeEnum< typeof GetRecentlyAddedActiveDirection @@ -912,6 +953,24 @@ export namespace GetRecentlyAddedSort$ { export type Outbound = GetRecentlyAddedSort$Outbound; } +export function getRecentlyAddedSortToJSON( + getRecentlyAddedSort: GetRecentlyAddedSort, +): string { + return JSON.stringify( + GetRecentlyAddedSort$outboundSchema.parse(getRecentlyAddedSort), + ); +} + +export function getRecentlyAddedSortFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedSort$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedSort' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedField$inboundSchema: z.ZodType< GetRecentlyAddedField, @@ -957,6 +1016,24 @@ export namespace GetRecentlyAddedField$ { export type Outbound = GetRecentlyAddedField$Outbound; } +export function getRecentlyAddedFieldToJSON( + getRecentlyAddedField: GetRecentlyAddedField, +): string { + return JSON.stringify( + GetRecentlyAddedField$outboundSchema.parse(getRecentlyAddedField), + ); +} + +export function getRecentlyAddedFieldFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedField$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedField' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedType$inboundSchema: z.ZodType< GetRecentlyAddedType, @@ -1025,6 +1102,24 @@ export namespace GetRecentlyAddedType$ { export type Outbound = GetRecentlyAddedType$Outbound; } +export function getRecentlyAddedTypeToJSON( + getRecentlyAddedType: GetRecentlyAddedType, +): string { + return JSON.stringify( + GetRecentlyAddedType$outboundSchema.parse(getRecentlyAddedType), + ); +} + +export function getRecentlyAddedTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedType' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedOperator$inboundSchema: z.ZodType< GetRecentlyAddedOperator, @@ -1064,6 +1159,24 @@ export namespace GetRecentlyAddedOperator$ { export type Outbound = GetRecentlyAddedOperator$Outbound; } +export function getRecentlyAddedOperatorToJSON( + getRecentlyAddedOperator: GetRecentlyAddedOperator, +): string { + return JSON.stringify( + GetRecentlyAddedOperator$outboundSchema.parse(getRecentlyAddedOperator), + ); +} + +export function getRecentlyAddedOperatorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedOperator$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedOperator' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedFieldType$inboundSchema: z.ZodType< GetRecentlyAddedFieldType, @@ -1111,6 +1224,24 @@ export namespace GetRecentlyAddedFieldType$ { export type Outbound = GetRecentlyAddedFieldType$Outbound; } +export function getRecentlyAddedFieldTypeToJSON( + getRecentlyAddedFieldType: GetRecentlyAddedFieldType, +): string { + return JSON.stringify( + GetRecentlyAddedFieldType$outboundSchema.parse(getRecentlyAddedFieldType), + ); +} + +export function getRecentlyAddedFieldTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedFieldType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedFieldType' from JSON`, + ); +} + /** @internal */ export const Meta$inboundSchema: z.ZodType = z .object({ @@ -1156,6 +1287,20 @@ export namespace Meta$ { export type Outbound = Meta$Outbound; } +export function metaToJSON(meta: Meta): string { + return JSON.stringify(Meta$outboundSchema.parse(meta)); +} + +export function metaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Meta$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Meta' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedHubsType$inboundSchema: z.ZodNativeEnum< typeof GetRecentlyAddedHubsType @@ -1401,6 +1546,20 @@ export namespace Stream$ { export type Outbound = Stream$Outbound; } +export function streamToJSON(stream: Stream): string { + return JSON.stringify(Stream$outboundSchema.parse(stream)); +} + +export function streamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Stream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Stream' from JSON`, + ); +} + /** @internal */ export const Part$inboundSchema: z.ZodType = z .object({ @@ -1475,6 +1634,20 @@ export namespace Part$ { export type Outbound = Part$Outbound; } +export function partToJSON(part: Part): string { + return JSON.stringify(Part$outboundSchema.parse(part)); +} + +export function partFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Part$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Part' from JSON`, + ); +} + /** @internal */ export const Media$inboundSchema: z.ZodType = z .object({ @@ -1569,6 +1742,20 @@ export namespace Media$ { export type Outbound = Media$Outbound; } +export function mediaToJSON(media: Media): string { + return JSON.stringify(Media$outboundSchema.parse(media)); +} + +export function mediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Media$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Media' from JSON`, + ); +} + /** @internal */ export const Genre$inboundSchema: z.ZodType = z .object({ @@ -1602,6 +1789,20 @@ export namespace Genre$ { export type Outbound = Genre$Outbound; } +export function genreToJSON(genre: Genre): string { + return JSON.stringify(Genre$outboundSchema.parse(genre)); +} + +export function genreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Genre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Genre' from JSON`, + ); +} + /** @internal */ export const Country$inboundSchema: z.ZodType = z.object({ @@ -1635,6 +1836,20 @@ export namespace Country$ { export type Outbound = Country$Outbound; } +export function countryToJSON(country: Country): string { + return JSON.stringify(Country$outboundSchema.parse(country)); +} + +export function countryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Country$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Country' from JSON`, + ); +} + /** @internal */ export const Director$inboundSchema: z.ZodType< Director, @@ -1671,6 +1886,20 @@ export namespace Director$ { export type Outbound = Director$Outbound; } +export function directorToJSON(director: Director): string { + return JSON.stringify(Director$outboundSchema.parse(director)); +} + +export function directorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Director$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Director' from JSON`, + ); +} + /** @internal */ export const Writer$inboundSchema: z.ZodType = z .object({ @@ -1704,6 +1933,20 @@ export namespace Writer$ { export type Outbound = Writer$Outbound; } +export function writerToJSON(writer: Writer): string { + return JSON.stringify(Writer$outboundSchema.parse(writer)); +} + +export function writerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Writer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Writer' from JSON`, + ); +} + /** @internal */ export const Collection$inboundSchema: z.ZodType< Collection, @@ -1740,6 +1983,20 @@ export namespace Collection$ { export type Outbound = Collection$Outbound; } +export function collectionToJSON(collection: Collection): string { + return JSON.stringify(Collection$outboundSchema.parse(collection)); +} + +export function collectionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Collection$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Collection' from JSON`, + ); +} + /** @internal */ export const Role$inboundSchema: z.ZodType = z .object({ @@ -1785,6 +2042,20 @@ export namespace Role$ { export type Outbound = Role$Outbound; } +export function roleToJSON(role: Role): string { + return JSON.stringify(Role$outboundSchema.parse(role)); +} + +export function roleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Role$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Role' from JSON`, + ); +} + /** @internal */ export const Location$inboundSchema: z.ZodType< Location, @@ -1821,6 +2092,20 @@ export namespace Location$ { export type Outbound = Location$Outbound; } +export function locationToJSON(location: Location): string { + return JSON.stringify(Location$outboundSchema.parse(location)); +} + +export function locationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Location$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Location' from JSON`, + ); +} + /** @internal */ export const MediaGuid$inboundSchema: z.ZodType< MediaGuid, @@ -1857,6 +2142,20 @@ export namespace MediaGuid$ { export type Outbound = MediaGuid$Outbound; } +export function mediaGuidToJSON(mediaGuid: MediaGuid): string { + return JSON.stringify(MediaGuid$outboundSchema.parse(mediaGuid)); +} + +export function mediaGuidFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MediaGuid$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MediaGuid' from JSON`, + ); +} + /** @internal */ export const UltraBlurColors$inboundSchema: z.ZodType< UltraBlurColors, @@ -1902,6 +2201,22 @@ export namespace UltraBlurColors$ { export type Outbound = UltraBlurColors$Outbound; } +export function ultraBlurColorsToJSON( + ultraBlurColors: UltraBlurColors, +): string { + return JSON.stringify(UltraBlurColors$outboundSchema.parse(ultraBlurColors)); +} + +export function ultraBlurColorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UltraBlurColors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UltraBlurColors' from JSON`, + ); +} + /** @internal */ export const MetaDataRating$inboundSchema: z.ZodType< MetaDataRating, @@ -1944,6 +2259,20 @@ export namespace MetaDataRating$ { export type Outbound = MetaDataRating$Outbound; } +export function metaDataRatingToJSON(metaDataRating: MetaDataRating): string { + return JSON.stringify(MetaDataRating$outboundSchema.parse(metaDataRating)); +} + +export function metaDataRatingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MetaDataRating$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MetaDataRating' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedHubsResponseType$inboundSchema: z.ZodNativeEnum< typeof GetRecentlyAddedHubsResponseType @@ -2007,6 +2336,24 @@ export namespace GetRecentlyAddedImage$ { export type Outbound = GetRecentlyAddedImage$Outbound; } +export function getRecentlyAddedImageToJSON( + getRecentlyAddedImage: GetRecentlyAddedImage, +): string { + return JSON.stringify( + GetRecentlyAddedImage$outboundSchema.parse(getRecentlyAddedImage), + ); +} + +export function getRecentlyAddedImageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedImage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedImage' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedMetadata$inboundSchema: z.ZodType< GetRecentlyAddedMetadata, @@ -2294,6 +2641,24 @@ export namespace GetRecentlyAddedMetadata$ { export type Outbound = GetRecentlyAddedMetadata$Outbound; } +export function getRecentlyAddedMetadataToJSON( + getRecentlyAddedMetadata: GetRecentlyAddedMetadata, +): string { + return JSON.stringify( + GetRecentlyAddedMetadata$outboundSchema.parse(getRecentlyAddedMetadata), + ); +} + +export function getRecentlyAddedMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedMetadata' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedMediaContainer$inboundSchema: z.ZodType< GetRecentlyAddedMediaContainer, @@ -2360,6 +2725,26 @@ export namespace GetRecentlyAddedMediaContainer$ { export type Outbound = GetRecentlyAddedMediaContainer$Outbound; } +export function getRecentlyAddedMediaContainerToJSON( + getRecentlyAddedMediaContainer: GetRecentlyAddedMediaContainer, +): string { + return JSON.stringify( + GetRecentlyAddedMediaContainer$outboundSchema.parse( + getRecentlyAddedMediaContainer, + ), + ); +} + +export function getRecentlyAddedMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedResponseBody$inboundSchema: z.ZodType< GetRecentlyAddedResponseBody, @@ -2406,6 +2791,26 @@ export namespace GetRecentlyAddedResponseBody$ { export type Outbound = GetRecentlyAddedResponseBody$Outbound; } +export function getRecentlyAddedResponseBodyToJSON( + getRecentlyAddedResponseBody: GetRecentlyAddedResponseBody, +): string { + return JSON.stringify( + GetRecentlyAddedResponseBody$outboundSchema.parse( + getRecentlyAddedResponseBody, + ), + ); +} + +export function getRecentlyAddedResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedResponseBody' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedResponse$inboundSchema: z.ZodType< GetRecentlyAddedResponse, @@ -2464,3 +2869,21 @@ export namespace GetRecentlyAddedResponse$ { /** @deprecated use `GetRecentlyAddedResponse$Outbound` instead. */ export type Outbound = GetRecentlyAddedResponse$Outbound; } + +export function getRecentlyAddedResponseToJSON( + getRecentlyAddedResponse: GetRecentlyAddedResponse, +): string { + return JSON.stringify( + GetRecentlyAddedResponse$outboundSchema.parse(getRecentlyAddedResponse), + ); +} + +export function getRecentlyAddedResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getrecentlyaddedlibrary.ts b/src/sdk/models/operations/getrecentlyaddedlibrary.ts index 5df9d5ba..2102abfc 100644 --- a/src/sdk/models/operations/getrecentlyaddedlibrary.ts +++ b/src/sdk/models/operations/getrecentlyaddedlibrary.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of media to retrieve. @@ -21,6 +24,8 @@ export enum QueryParamType { Season = 3, Episode = 4, Audio = 8, + Album = 9, + Track = 10, } /** @@ -389,6 +394,26 @@ export namespace GetRecentlyAddedLibraryRequest$ { export type Outbound = GetRecentlyAddedLibraryRequest$Outbound; } +export function getRecentlyAddedLibraryRequestToJSON( + getRecentlyAddedLibraryRequest: GetRecentlyAddedLibraryRequest, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryRequest$outboundSchema.parse( + getRecentlyAddedLibraryRequest, + ), + ); +} + +export function getRecentlyAddedLibraryRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryRequest' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryFilter$inboundSchema: z.ZodType< GetRecentlyAddedLibraryFilter, @@ -437,6 +462,26 @@ export namespace GetRecentlyAddedLibraryFilter$ { export type Outbound = GetRecentlyAddedLibraryFilter$Outbound; } +export function getRecentlyAddedLibraryFilterToJSON( + getRecentlyAddedLibraryFilter: GetRecentlyAddedLibraryFilter, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryFilter$outboundSchema.parse( + getRecentlyAddedLibraryFilter, + ), + ); +} + +export function getRecentlyAddedLibraryFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryFilter' from JSON`, + ); +} + /** @internal */ export const ActiveDirection$inboundSchema: z.ZodNativeEnum< typeof ActiveDirection @@ -538,6 +583,20 @@ export namespace Sort$ { export type Outbound = Sort$Outbound; } +export function sortToJSON(sort: Sort): string { + return JSON.stringify(Sort$outboundSchema.parse(sort)); +} + +export function sortFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Sort$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Sort' from JSON`, + ); +} + /** @internal */ export const Field$inboundSchema: z.ZodType = z .object({ @@ -580,6 +639,20 @@ export namespace Field$ { export type Outbound = Field$Outbound; } +export function fieldToJSON(field: Field): string { + return JSON.stringify(Field$outboundSchema.parse(field)); +} + +export function fieldFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Field$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Field' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryType$inboundSchema: z.ZodType< GetRecentlyAddedLibraryType, @@ -648,6 +721,26 @@ export namespace GetRecentlyAddedLibraryType$ { export type Outbound = GetRecentlyAddedLibraryType$Outbound; } +export function getRecentlyAddedLibraryTypeToJSON( + getRecentlyAddedLibraryType: GetRecentlyAddedLibraryType, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryType$outboundSchema.parse( + getRecentlyAddedLibraryType, + ), + ); +} + +export function getRecentlyAddedLibraryTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryType' from JSON`, + ); +} + /** @internal */ export const Operator$inboundSchema: z.ZodType< Operator, @@ -687,6 +780,20 @@ export namespace Operator$ { export type Outbound = Operator$Outbound; } +export function operatorToJSON(operator: Operator): string { + return JSON.stringify(Operator$outboundSchema.parse(operator)); +} + +export function operatorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Operator$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Operator' from JSON`, + ); +} + /** @internal */ export const FieldType$inboundSchema: z.ZodType< FieldType, @@ -734,6 +841,20 @@ export namespace FieldType$ { export type Outbound = FieldType$Outbound; } +export function fieldTypeToJSON(fieldType: FieldType): string { + return JSON.stringify(FieldType$outboundSchema.parse(fieldType)); +} + +export function fieldTypeFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => FieldType$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FieldType' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryPart$inboundSchema: z.ZodType< GetRecentlyAddedLibraryPart, @@ -797,6 +918,26 @@ export namespace GetRecentlyAddedLibraryPart$ { export type Outbound = GetRecentlyAddedLibraryPart$Outbound; } +export function getRecentlyAddedLibraryPartToJSON( + getRecentlyAddedLibraryPart: GetRecentlyAddedLibraryPart, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryPart$outboundSchema.parse( + getRecentlyAddedLibraryPart, + ), + ); +} + +export function getRecentlyAddedLibraryPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryPart' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryMedia$inboundSchema: z.ZodType< GetRecentlyAddedLibraryMedia, @@ -888,6 +1029,26 @@ export namespace GetRecentlyAddedLibraryMedia$ { export type Outbound = GetRecentlyAddedLibraryMedia$Outbound; } +export function getRecentlyAddedLibraryMediaToJSON( + getRecentlyAddedLibraryMedia: GetRecentlyAddedLibraryMedia, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryMedia$outboundSchema.parse( + getRecentlyAddedLibraryMedia, + ), + ); +} + +export function getRecentlyAddedLibraryMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryMedia' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryGenre$inboundSchema: z.ZodType< GetRecentlyAddedLibraryGenre, @@ -924,6 +1085,26 @@ export namespace GetRecentlyAddedLibraryGenre$ { export type Outbound = GetRecentlyAddedLibraryGenre$Outbound; } +export function getRecentlyAddedLibraryGenreToJSON( + getRecentlyAddedLibraryGenre: GetRecentlyAddedLibraryGenre, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryGenre$outboundSchema.parse( + getRecentlyAddedLibraryGenre, + ), + ); +} + +export function getRecentlyAddedLibraryGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryGenre' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryDirector$inboundSchema: z.ZodType< GetRecentlyAddedLibraryDirector, @@ -960,6 +1141,26 @@ export namespace GetRecentlyAddedLibraryDirector$ { export type Outbound = GetRecentlyAddedLibraryDirector$Outbound; } +export function getRecentlyAddedLibraryDirectorToJSON( + getRecentlyAddedLibraryDirector: GetRecentlyAddedLibraryDirector, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryDirector$outboundSchema.parse( + getRecentlyAddedLibraryDirector, + ), + ); +} + +export function getRecentlyAddedLibraryDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryDirector' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryWriter$inboundSchema: z.ZodType< GetRecentlyAddedLibraryWriter, @@ -996,6 +1197,26 @@ export namespace GetRecentlyAddedLibraryWriter$ { export type Outbound = GetRecentlyAddedLibraryWriter$Outbound; } +export function getRecentlyAddedLibraryWriterToJSON( + getRecentlyAddedLibraryWriter: GetRecentlyAddedLibraryWriter, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryWriter$outboundSchema.parse( + getRecentlyAddedLibraryWriter, + ), + ); +} + +export function getRecentlyAddedLibraryWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryWriter' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryCountry$inboundSchema: z.ZodType< GetRecentlyAddedLibraryCountry, @@ -1032,6 +1253,26 @@ export namespace GetRecentlyAddedLibraryCountry$ { export type Outbound = GetRecentlyAddedLibraryCountry$Outbound; } +export function getRecentlyAddedLibraryCountryToJSON( + getRecentlyAddedLibraryCountry: GetRecentlyAddedLibraryCountry, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryCountry$outboundSchema.parse( + getRecentlyAddedLibraryCountry, + ), + ); +} + +export function getRecentlyAddedLibraryCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryCountry' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryRole$inboundSchema: z.ZodType< GetRecentlyAddedLibraryRole, @@ -1068,6 +1309,26 @@ export namespace GetRecentlyAddedLibraryRole$ { export type Outbound = GetRecentlyAddedLibraryRole$Outbound; } +export function getRecentlyAddedLibraryRoleToJSON( + getRecentlyAddedLibraryRole: GetRecentlyAddedLibraryRole, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryRole$outboundSchema.parse( + getRecentlyAddedLibraryRole, + ), + ); +} + +export function getRecentlyAddedLibraryRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryRole' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryMetadata$inboundSchema: z.ZodType< GetRecentlyAddedLibraryMetadata, @@ -1230,6 +1491,26 @@ export namespace GetRecentlyAddedLibraryMetadata$ { export type Outbound = GetRecentlyAddedLibraryMetadata$Outbound; } +export function getRecentlyAddedLibraryMetadataToJSON( + getRecentlyAddedLibraryMetadata: GetRecentlyAddedLibraryMetadata, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryMetadata$outboundSchema.parse( + getRecentlyAddedLibraryMetadata, + ), + ); +} + +export function getRecentlyAddedLibraryMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryMetadata' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryMediaContainer$inboundSchema: z.ZodType< GetRecentlyAddedLibraryMediaContainer, @@ -1309,6 +1590,27 @@ export namespace GetRecentlyAddedLibraryMediaContainer$ { export type Outbound = GetRecentlyAddedLibraryMediaContainer$Outbound; } +export function getRecentlyAddedLibraryMediaContainerToJSON( + getRecentlyAddedLibraryMediaContainer: GetRecentlyAddedLibraryMediaContainer, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryMediaContainer$outboundSchema.parse( + getRecentlyAddedLibraryMediaContainer, + ), + ); +} + +export function getRecentlyAddedLibraryMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetRecentlyAddedLibraryMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryResponseBody$inboundSchema: z.ZodType< GetRecentlyAddedLibraryResponseBody, @@ -1359,6 +1661,27 @@ export namespace GetRecentlyAddedLibraryResponseBody$ { export type Outbound = GetRecentlyAddedLibraryResponseBody$Outbound; } +export function getRecentlyAddedLibraryResponseBodyToJSON( + getRecentlyAddedLibraryResponseBody: GetRecentlyAddedLibraryResponseBody, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryResponseBody$outboundSchema.parse( + getRecentlyAddedLibraryResponseBody, + ), + ); +} + +export function getRecentlyAddedLibraryResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetRecentlyAddedLibraryResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryResponseBody' from JSON`, + ); +} + /** @internal */ export const GetRecentlyAddedLibraryResponse$inboundSchema: z.ZodType< GetRecentlyAddedLibraryResponse, @@ -1419,3 +1742,23 @@ export namespace GetRecentlyAddedLibraryResponse$ { /** @deprecated use `GetRecentlyAddedLibraryResponse$Outbound` instead. */ export type Outbound = GetRecentlyAddedLibraryResponse$Outbound; } + +export function getRecentlyAddedLibraryResponseToJSON( + getRecentlyAddedLibraryResponse: GetRecentlyAddedLibraryResponse, +): string { + return JSON.stringify( + GetRecentlyAddedLibraryResponse$outboundSchema.parse( + getRecentlyAddedLibraryResponse, + ), + ); +} + +export function getRecentlyAddedLibraryResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRecentlyAddedLibraryResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRecentlyAddedLibraryResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getrefreshlibrarymetadata.ts b/src/sdk/models/operations/getrefreshlibrarymetadata.ts index 3c1a289a..19044a06 100644 --- a/src/sdk/models/operations/getrefreshlibrarymetadata.ts +++ b/src/sdk/models/operations/getrefreshlibrarymetadata.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Force the refresh even if the library is already being refreshed. @@ -101,6 +104,26 @@ export namespace GetRefreshLibraryMetadataRequest$ { export type Outbound = GetRefreshLibraryMetadataRequest$Outbound; } +export function getRefreshLibraryMetadataRequestToJSON( + getRefreshLibraryMetadataRequest: GetRefreshLibraryMetadataRequest, +): string { + return JSON.stringify( + GetRefreshLibraryMetadataRequest$outboundSchema.parse( + getRefreshLibraryMetadataRequest, + ), + ); +} + +export function getRefreshLibraryMetadataRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRefreshLibraryMetadataRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRefreshLibraryMetadataRequest' from JSON`, + ); +} + /** @internal */ export const GetRefreshLibraryMetadataResponse$inboundSchema: z.ZodType< GetRefreshLibraryMetadataResponse, @@ -157,3 +180,23 @@ export namespace GetRefreshLibraryMetadataResponse$ { /** @deprecated use `GetRefreshLibraryMetadataResponse$Outbound` instead. */ export type Outbound = GetRefreshLibraryMetadataResponse$Outbound; } + +export function getRefreshLibraryMetadataResponseToJSON( + getRefreshLibraryMetadataResponse: GetRefreshLibraryMetadataResponse, +): string { + return JSON.stringify( + GetRefreshLibraryMetadataResponse$outboundSchema.parse( + getRefreshLibraryMetadataResponse, + ), + ); +} + +export function getRefreshLibraryMetadataResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRefreshLibraryMetadataResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRefreshLibraryMetadataResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getresizedphoto.ts b/src/sdk/models/operations/getresizedphoto.ts index a64a01fc..5d301e58 100644 --- a/src/sdk/models/operations/getresizedphoto.ts +++ b/src/sdk/models/operations/getresizedphoto.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. @@ -159,6 +162,24 @@ export namespace GetResizedPhotoRequest$ { export type Outbound = GetResizedPhotoRequest$Outbound; } +export function getResizedPhotoRequestToJSON( + getResizedPhotoRequest: GetResizedPhotoRequest, +): string { + return JSON.stringify( + GetResizedPhotoRequest$outboundSchema.parse(getResizedPhotoRequest), + ); +} + +export function getResizedPhotoRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResizedPhotoRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResizedPhotoRequest' from JSON`, + ); +} + /** @internal */ export const GetResizedPhotoResponse$inboundSchema: z.ZodType< GetResizedPhotoResponse, @@ -214,3 +235,21 @@ export namespace GetResizedPhotoResponse$ { /** @deprecated use `GetResizedPhotoResponse$Outbound` instead. */ export type Outbound = GetResizedPhotoResponse$Outbound; } + +export function getResizedPhotoResponseToJSON( + getResizedPhotoResponse: GetResizedPhotoResponse, +): string { + return JSON.stringify( + GetResizedPhotoResponse$outboundSchema.parse(getResizedPhotoResponse), + ); +} + +export function getResizedPhotoResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResizedPhotoResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResizedPhotoResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getresourcesstatistics.ts b/src/sdk/models/operations/getresourcesstatistics.ts index cf7b70a5..1469b973 100644 --- a/src/sdk/models/operations/getresourcesstatistics.ts +++ b/src/sdk/models/operations/getresourcesstatistics.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetResourcesStatisticsRequest = { /** @@ -91,6 +94,26 @@ export namespace GetResourcesStatisticsRequest$ { export type Outbound = GetResourcesStatisticsRequest$Outbound; } +export function getResourcesStatisticsRequestToJSON( + getResourcesStatisticsRequest: GetResourcesStatisticsRequest, +): string { + return JSON.stringify( + GetResourcesStatisticsRequest$outboundSchema.parse( + getResourcesStatisticsRequest, + ), + ); +} + +export function getResourcesStatisticsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResourcesStatisticsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResourcesStatisticsRequest' from JSON`, + ); +} + /** @internal */ export const StatisticsResources$inboundSchema: z.ZodType< StatisticsResources, @@ -142,6 +165,24 @@ export namespace StatisticsResources$ { export type Outbound = StatisticsResources$Outbound; } +export function statisticsResourcesToJSON( + statisticsResources: StatisticsResources, +): string { + return JSON.stringify( + StatisticsResources$outboundSchema.parse(statisticsResources), + ); +} + +export function statisticsResourcesFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StatisticsResources$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StatisticsResources' from JSON`, + ); +} + /** @internal */ export const GetResourcesStatisticsMediaContainer$inboundSchema: z.ZodType< GetResourcesStatisticsMediaContainer, @@ -193,6 +234,27 @@ export namespace GetResourcesStatisticsMediaContainer$ { export type Outbound = GetResourcesStatisticsMediaContainer$Outbound; } +export function getResourcesStatisticsMediaContainerToJSON( + getResourcesStatisticsMediaContainer: GetResourcesStatisticsMediaContainer, +): string { + return JSON.stringify( + GetResourcesStatisticsMediaContainer$outboundSchema.parse( + getResourcesStatisticsMediaContainer, + ), + ); +} + +export function getResourcesStatisticsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetResourcesStatisticsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResourcesStatisticsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetResourcesStatisticsResponseBody$inboundSchema: z.ZodType< GetResourcesStatisticsResponseBody, @@ -242,6 +304,27 @@ export namespace GetResourcesStatisticsResponseBody$ { export type Outbound = GetResourcesStatisticsResponseBody$Outbound; } +export function getResourcesStatisticsResponseBodyToJSON( + getResourcesStatisticsResponseBody: GetResourcesStatisticsResponseBody, +): string { + return JSON.stringify( + GetResourcesStatisticsResponseBody$outboundSchema.parse( + getResourcesStatisticsResponseBody, + ), + ); +} + +export function getResourcesStatisticsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetResourcesStatisticsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResourcesStatisticsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetResourcesStatisticsResponse$inboundSchema: z.ZodType< GetResourcesStatisticsResponse, @@ -302,3 +385,23 @@ export namespace GetResourcesStatisticsResponse$ { /** @deprecated use `GetResourcesStatisticsResponse$Outbound` instead. */ export type Outbound = GetResourcesStatisticsResponse$Outbound; } + +export function getResourcesStatisticsResponseToJSON( + getResourcesStatisticsResponse: GetResourcesStatisticsResponse, +): string { + return JSON.stringify( + GetResourcesStatisticsResponse$outboundSchema.parse( + getResourcesStatisticsResponse, + ), + ); +} + +export function getResourcesStatisticsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetResourcesStatisticsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetResourcesStatisticsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getsearchalllibraries.ts b/src/sdk/models/operations/getsearchalllibraries.ts index ff813872..70303ab3 100644 --- a/src/sdk/models/operations/getsearchalllibraries.ts +++ b/src/sdk/models/operations/getsearchalllibraries.ts @@ -4,14 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; - -export type GetSearchAllLibrariesGlobals = { - /** - * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - */ - clientID?: string | undefined; -}; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export enum SearchTypes { Movies = "movies", @@ -45,7 +41,7 @@ export type GetSearchAllLibrariesRequest = { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - clientID?: string | undefined; + clientID: string; /** * Limit the number of results returned. */ @@ -89,16 +85,16 @@ export enum GetSearchAllLibrariesFlattenSeasons { * @remarks * None = Library default, * tmdbAiring = The Movie Database (Aired), - * aired = TheTVDB (Aired), - * dvd = TheTVDB (DVD), - * absolute = TheTVDB (Absolute)). + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). */ export enum GetSearchAllLibrariesShowOrdering { None = "None", TmdbAiring = "tmdbAiring", - Aired = "aired", - Dvd = "dvd", - Absolute = "absolute", + TvdbAiring = "tvdbAiring", + TvdbDvd = "tvdbDvd", + TvdbAbsolute = "tvdbAbsolute", } export enum GetSearchAllLibrariesOptimizedForStreaming { @@ -431,9 +427,9 @@ export type GetSearchAllLibrariesMetadata = { * @remarks * None = Library default, * tmdbAiring = The Movie Database (Aired), - * aired = TheTVDB (Aired), - * dvd = TheTVDB (DVD), - * absolute = TheTVDB (Absolute)). + * tvdbAiring = TheTVDB (Aired), + * tvdbDvd = TheTVDB (DVD), + * tvdbAbsolute = TheTVDB (Absolute)). */ showOrdering?: GetSearchAllLibrariesShowOrdering | undefined; thumb?: string | undefined; @@ -549,50 +545,6 @@ export type GetSearchAllLibrariesResponse = { object?: GetSearchAllLibrariesResponseBody | undefined; }; -/** @internal */ -export const GetSearchAllLibrariesGlobals$inboundSchema: z.ZodType< - GetSearchAllLibrariesGlobals, - z.ZodTypeDef, - unknown -> = z.object({ - ClientID: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "ClientID": "clientID", - }); -}); - -/** @internal */ -export type GetSearchAllLibrariesGlobals$Outbound = { - ClientID?: string | undefined; -}; - -/** @internal */ -export const GetSearchAllLibrariesGlobals$outboundSchema: z.ZodType< - GetSearchAllLibrariesGlobals$Outbound, - z.ZodTypeDef, - GetSearchAllLibrariesGlobals -> = z.object({ - clientID: z.string().optional(), -}).transform((v) => { - return remap$(v, { - clientID: "ClientID", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetSearchAllLibrariesGlobals$ { - /** @deprecated use `GetSearchAllLibrariesGlobals$inboundSchema` instead. */ - export const inboundSchema = GetSearchAllLibrariesGlobals$inboundSchema; - /** @deprecated use `GetSearchAllLibrariesGlobals$outboundSchema` instead. */ - export const outboundSchema = GetSearchAllLibrariesGlobals$outboundSchema; - /** @deprecated use `GetSearchAllLibrariesGlobals$Outbound` instead. */ - export type Outbound = GetSearchAllLibrariesGlobals$Outbound; -} - /** @internal */ export const SearchTypes$inboundSchema: z.ZodNativeEnum = z .nativeEnum(SearchTypes); @@ -661,7 +613,7 @@ export const GetSearchAllLibrariesRequest$inboundSchema: z.ZodType< unknown > = z.object({ query: z.string(), - ClientID: z.string().optional(), + ClientID: z.string(), limit: z.number().int().optional(), searchTypes: z.array(SearchTypes$inboundSchema).optional(), includeCollections: QueryParamIncludeCollections$inboundSchema, @@ -675,7 +627,7 @@ export const GetSearchAllLibrariesRequest$inboundSchema: z.ZodType< /** @internal */ export type GetSearchAllLibrariesRequest$Outbound = { query: string; - ClientID?: string | undefined; + ClientID: string; limit?: number | undefined; searchTypes?: Array | undefined; includeCollections: number; @@ -689,7 +641,7 @@ export const GetSearchAllLibrariesRequest$outboundSchema: z.ZodType< GetSearchAllLibrariesRequest > = z.object({ query: z.string(), - clientID: z.string().optional(), + clientID: z.string(), limit: z.number().int().optional(), searchTypes: z.array(SearchTypes$outboundSchema).optional(), includeCollections: QueryParamIncludeCollections$outboundSchema.default( @@ -717,6 +669,26 @@ export namespace GetSearchAllLibrariesRequest$ { export type Outbound = GetSearchAllLibrariesRequest$Outbound; } +export function getSearchAllLibrariesRequestToJSON( + getSearchAllLibrariesRequest: GetSearchAllLibrariesRequest, +): string { + return JSON.stringify( + GetSearchAllLibrariesRequest$outboundSchema.parse( + getSearchAllLibrariesRequest, + ), + ); +} + +export function getSearchAllLibrariesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesRequest' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesType$inboundSchema: z.ZodNativeEnum< typeof GetSearchAllLibrariesType @@ -975,6 +947,26 @@ export namespace GetSearchAllLibrariesStream$ { export type Outbound = GetSearchAllLibrariesStream$Outbound; } +export function getSearchAllLibrariesStreamToJSON( + getSearchAllLibrariesStream: GetSearchAllLibrariesStream, +): string { + return JSON.stringify( + GetSearchAllLibrariesStream$outboundSchema.parse( + getSearchAllLibrariesStream, + ), + ); +} + +export function getSearchAllLibrariesStreamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesStream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesStream' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesPart$inboundSchema: z.ZodType< GetSearchAllLibrariesPart, @@ -1061,6 +1053,24 @@ export namespace GetSearchAllLibrariesPart$ { export type Outbound = GetSearchAllLibrariesPart$Outbound; } +export function getSearchAllLibrariesPartToJSON( + getSearchAllLibrariesPart: GetSearchAllLibrariesPart, +): string { + return JSON.stringify( + GetSearchAllLibrariesPart$outboundSchema.parse(getSearchAllLibrariesPart), + ); +} + +export function getSearchAllLibrariesPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesPart' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesMedia$inboundSchema: z.ZodType< GetSearchAllLibrariesMedia, @@ -1160,6 +1170,24 @@ export namespace GetSearchAllLibrariesMedia$ { export type Outbound = GetSearchAllLibrariesMedia$Outbound; } +export function getSearchAllLibrariesMediaToJSON( + getSearchAllLibrariesMedia: GetSearchAllLibrariesMedia, +): string { + return JSON.stringify( + GetSearchAllLibrariesMedia$outboundSchema.parse(getSearchAllLibrariesMedia), + ); +} + +export function getSearchAllLibrariesMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesMedia' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesGenre$inboundSchema: z.ZodType< GetSearchAllLibrariesGenre, @@ -1196,6 +1224,24 @@ export namespace GetSearchAllLibrariesGenre$ { export type Outbound = GetSearchAllLibrariesGenre$Outbound; } +export function getSearchAllLibrariesGenreToJSON( + getSearchAllLibrariesGenre: GetSearchAllLibrariesGenre, +): string { + return JSON.stringify( + GetSearchAllLibrariesGenre$outboundSchema.parse(getSearchAllLibrariesGenre), + ); +} + +export function getSearchAllLibrariesGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesGenre' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesCountry$inboundSchema: z.ZodType< GetSearchAllLibrariesCountry, @@ -1232,6 +1278,26 @@ export namespace GetSearchAllLibrariesCountry$ { export type Outbound = GetSearchAllLibrariesCountry$Outbound; } +export function getSearchAllLibrariesCountryToJSON( + getSearchAllLibrariesCountry: GetSearchAllLibrariesCountry, +): string { + return JSON.stringify( + GetSearchAllLibrariesCountry$outboundSchema.parse( + getSearchAllLibrariesCountry, + ), + ); +} + +export function getSearchAllLibrariesCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesCountry' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesDirector$inboundSchema: z.ZodType< GetSearchAllLibrariesDirector, @@ -1268,6 +1334,26 @@ export namespace GetSearchAllLibrariesDirector$ { export type Outbound = GetSearchAllLibrariesDirector$Outbound; } +export function getSearchAllLibrariesDirectorToJSON( + getSearchAllLibrariesDirector: GetSearchAllLibrariesDirector, +): string { + return JSON.stringify( + GetSearchAllLibrariesDirector$outboundSchema.parse( + getSearchAllLibrariesDirector, + ), + ); +} + +export function getSearchAllLibrariesDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesDirector' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesWriter$inboundSchema: z.ZodType< GetSearchAllLibrariesWriter, @@ -1304,6 +1390,26 @@ export namespace GetSearchAllLibrariesWriter$ { export type Outbound = GetSearchAllLibrariesWriter$Outbound; } +export function getSearchAllLibrariesWriterToJSON( + getSearchAllLibrariesWriter: GetSearchAllLibrariesWriter, +): string { + return JSON.stringify( + GetSearchAllLibrariesWriter$outboundSchema.parse( + getSearchAllLibrariesWriter, + ), + ); +} + +export function getSearchAllLibrariesWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesWriter' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesCollection$inboundSchema: z.ZodType< GetSearchAllLibrariesCollection, @@ -1340,6 +1446,26 @@ export namespace GetSearchAllLibrariesCollection$ { export type Outbound = GetSearchAllLibrariesCollection$Outbound; } +export function getSearchAllLibrariesCollectionToJSON( + getSearchAllLibrariesCollection: GetSearchAllLibrariesCollection, +): string { + return JSON.stringify( + GetSearchAllLibrariesCollection$outboundSchema.parse( + getSearchAllLibrariesCollection, + ), + ); +} + +export function getSearchAllLibrariesCollectionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesCollection$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesCollection' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesRole$inboundSchema: z.ZodType< GetSearchAllLibrariesRole, @@ -1391,6 +1517,24 @@ export namespace GetSearchAllLibrariesRole$ { export type Outbound = GetSearchAllLibrariesRole$Outbound; } +export function getSearchAllLibrariesRoleToJSON( + getSearchAllLibrariesRole: GetSearchAllLibrariesRole, +): string { + return JSON.stringify( + GetSearchAllLibrariesRole$outboundSchema.parse(getSearchAllLibrariesRole), + ); +} + +export function getSearchAllLibrariesRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesRole' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesLocation$inboundSchema: z.ZodType< GetSearchAllLibrariesLocation, @@ -1427,6 +1571,26 @@ export namespace GetSearchAllLibrariesLocation$ { export type Outbound = GetSearchAllLibrariesLocation$Outbound; } +export function getSearchAllLibrariesLocationToJSON( + getSearchAllLibrariesLocation: GetSearchAllLibrariesLocation, +): string { + return JSON.stringify( + GetSearchAllLibrariesLocation$outboundSchema.parse( + getSearchAllLibrariesLocation, + ), + ); +} + +export function getSearchAllLibrariesLocationFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesLocation$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesLocation' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesMediaGuid$inboundSchema: z.ZodType< GetSearchAllLibrariesMediaGuid, @@ -1463,6 +1627,26 @@ export namespace GetSearchAllLibrariesMediaGuid$ { export type Outbound = GetSearchAllLibrariesMediaGuid$Outbound; } +export function getSearchAllLibrariesMediaGuidToJSON( + getSearchAllLibrariesMediaGuid: GetSearchAllLibrariesMediaGuid, +): string { + return JSON.stringify( + GetSearchAllLibrariesMediaGuid$outboundSchema.parse( + getSearchAllLibrariesMediaGuid, + ), + ); +} + +export function getSearchAllLibrariesMediaGuidFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesMediaGuid$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesMediaGuid' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesUltraBlurColors$inboundSchema: z.ZodType< GetSearchAllLibrariesUltraBlurColors, @@ -1510,6 +1694,27 @@ export namespace GetSearchAllLibrariesUltraBlurColors$ { export type Outbound = GetSearchAllLibrariesUltraBlurColors$Outbound; } +export function getSearchAllLibrariesUltraBlurColorsToJSON( + getSearchAllLibrariesUltraBlurColors: GetSearchAllLibrariesUltraBlurColors, +): string { + return JSON.stringify( + GetSearchAllLibrariesUltraBlurColors$outboundSchema.parse( + getSearchAllLibrariesUltraBlurColors, + ), + ); +} + +export function getSearchAllLibrariesUltraBlurColorsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSearchAllLibrariesUltraBlurColors$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesUltraBlurColors' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesMetaDataRating$inboundSchema: z.ZodType< GetSearchAllLibrariesMetaDataRating, @@ -1554,6 +1759,27 @@ export namespace GetSearchAllLibrariesMetaDataRating$ { export type Outbound = GetSearchAllLibrariesMetaDataRating$Outbound; } +export function getSearchAllLibrariesMetaDataRatingToJSON( + getSearchAllLibrariesMetaDataRating: GetSearchAllLibrariesMetaDataRating, +): string { + return JSON.stringify( + GetSearchAllLibrariesMetaDataRating$outboundSchema.parse( + getSearchAllLibrariesMetaDataRating, + ), + ); +} + +export function getSearchAllLibrariesMetaDataRatingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSearchAllLibrariesMetaDataRating$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesMetaDataRating' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesLibraryType$inboundSchema: z.ZodNativeEnum< typeof GetSearchAllLibrariesLibraryType @@ -1617,6 +1843,24 @@ export namespace GetSearchAllLibrariesImage$ { export type Outbound = GetSearchAllLibrariesImage$Outbound; } +export function getSearchAllLibrariesImageToJSON( + getSearchAllLibrariesImage: GetSearchAllLibrariesImage, +): string { + return JSON.stringify( + GetSearchAllLibrariesImage$outboundSchema.parse(getSearchAllLibrariesImage), + ); +} + +export function getSearchAllLibrariesImageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesImage$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesImage' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesMetadata$inboundSchema: z.ZodType< GetSearchAllLibrariesMetadata, @@ -1938,6 +2182,26 @@ export namespace GetSearchAllLibrariesMetadata$ { export type Outbound = GetSearchAllLibrariesMetadata$Outbound; } +export function getSearchAllLibrariesMetadataToJSON( + getSearchAllLibrariesMetadata: GetSearchAllLibrariesMetadata, +): string { + return JSON.stringify( + GetSearchAllLibrariesMetadata$outboundSchema.parse( + getSearchAllLibrariesMetadata, + ), + ); +} + +export function getSearchAllLibrariesMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesMetadata' from JSON`, + ); +} + /** @internal */ export const SearchResult$inboundSchema: z.ZodType< SearchResult, @@ -1985,6 +2249,20 @@ export namespace SearchResult$ { export type Outbound = SearchResult$Outbound; } +export function searchResultToJSON(searchResult: SearchResult): string { + return JSON.stringify(SearchResult$outboundSchema.parse(searchResult)); +} + +export function searchResultFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SearchResult$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SearchResult' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesMediaContainer$inboundSchema: z.ZodType< GetSearchAllLibrariesMediaContainer, @@ -2034,6 +2312,27 @@ export namespace GetSearchAllLibrariesMediaContainer$ { export type Outbound = GetSearchAllLibrariesMediaContainer$Outbound; } +export function getSearchAllLibrariesMediaContainerToJSON( + getSearchAllLibrariesMediaContainer: GetSearchAllLibrariesMediaContainer, +): string { + return JSON.stringify( + GetSearchAllLibrariesMediaContainer$outboundSchema.parse( + getSearchAllLibrariesMediaContainer, + ), + ); +} + +export function getSearchAllLibrariesMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSearchAllLibrariesMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesResponseBody$inboundSchema: z.ZodType< GetSearchAllLibrariesResponseBody, @@ -2083,6 +2382,26 @@ export namespace GetSearchAllLibrariesResponseBody$ { export type Outbound = GetSearchAllLibrariesResponseBody$Outbound; } +export function getSearchAllLibrariesResponseBodyToJSON( + getSearchAllLibrariesResponseBody: GetSearchAllLibrariesResponseBody, +): string { + return JSON.stringify( + GetSearchAllLibrariesResponseBody$outboundSchema.parse( + getSearchAllLibrariesResponseBody, + ), + ); +} + +export function getSearchAllLibrariesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesResponseBody' from JSON`, + ); +} + /** @internal */ export const GetSearchAllLibrariesResponse$inboundSchema: z.ZodType< GetSearchAllLibrariesResponse, @@ -2143,3 +2462,23 @@ export namespace GetSearchAllLibrariesResponse$ { /** @deprecated use `GetSearchAllLibrariesResponse$Outbound` instead. */ export type Outbound = GetSearchAllLibrariesResponse$Outbound; } + +export function getSearchAllLibrariesResponseToJSON( + getSearchAllLibrariesResponse: GetSearchAllLibrariesResponse, +): string { + return JSON.stringify( + GetSearchAllLibrariesResponse$outboundSchema.parse( + getSearchAllLibrariesResponse, + ), + ); +} + +export function getSearchAllLibrariesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchAllLibrariesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchAllLibrariesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getsearchlibrary.ts b/src/sdk/models/operations/getsearchlibrary.ts index 3e8848e5..3156a6c0 100644 --- a/src/sdk/models/operations/getsearchlibrary.ts +++ b/src/sdk/models/operations/getsearchlibrary.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of media to retrieve. @@ -21,6 +24,8 @@ export enum GetSearchLibraryQueryParamType { Season = 3, Episode = 4, Audio = 8, + Album = 9, + Track = 10, } export type GetSearchLibraryRequest = { @@ -169,6 +174,24 @@ export namespace GetSearchLibraryRequest$ { export type Outbound = GetSearchLibraryRequest$Outbound; } +export function getSearchLibraryRequestToJSON( + getSearchLibraryRequest: GetSearchLibraryRequest, +): string { + return JSON.stringify( + GetSearchLibraryRequest$outboundSchema.parse(getSearchLibraryRequest), + ); +} + +export function getSearchLibraryRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryRequest' from JSON`, + ); +} + /** @internal */ export const GetSearchLibraryMetadata$inboundSchema: z.ZodType< GetSearchLibraryMetadata, @@ -262,6 +285,24 @@ export namespace GetSearchLibraryMetadata$ { export type Outbound = GetSearchLibraryMetadata$Outbound; } +export function getSearchLibraryMetadataToJSON( + getSearchLibraryMetadata: GetSearchLibraryMetadata, +): string { + return JSON.stringify( + GetSearchLibraryMetadata$outboundSchema.parse(getSearchLibraryMetadata), + ); +} + +export function getSearchLibraryMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryMetadata' from JSON`, + ); +} + /** @internal */ export const GetSearchLibraryMediaContainer$inboundSchema: z.ZodType< GetSearchLibraryMediaContainer, @@ -344,6 +385,26 @@ export namespace GetSearchLibraryMediaContainer$ { export type Outbound = GetSearchLibraryMediaContainer$Outbound; } +export function getSearchLibraryMediaContainerToJSON( + getSearchLibraryMediaContainer: GetSearchLibraryMediaContainer, +): string { + return JSON.stringify( + GetSearchLibraryMediaContainer$outboundSchema.parse( + getSearchLibraryMediaContainer, + ), + ); +} + +export function getSearchLibraryMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetSearchLibraryResponseBody$inboundSchema: z.ZodType< GetSearchLibraryResponseBody, @@ -390,6 +451,26 @@ export namespace GetSearchLibraryResponseBody$ { export type Outbound = GetSearchLibraryResponseBody$Outbound; } +export function getSearchLibraryResponseBodyToJSON( + getSearchLibraryResponseBody: GetSearchLibraryResponseBody, +): string { + return JSON.stringify( + GetSearchLibraryResponseBody$outboundSchema.parse( + getSearchLibraryResponseBody, + ), + ); +} + +export function getSearchLibraryResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryResponseBody' from JSON`, + ); +} + /** @internal */ export const GetSearchLibraryResponse$inboundSchema: z.ZodType< GetSearchLibraryResponse, @@ -448,3 +529,21 @@ export namespace GetSearchLibraryResponse$ { /** @deprecated use `GetSearchLibraryResponse$Outbound` instead. */ export type Outbound = GetSearchLibraryResponse$Outbound; } + +export function getSearchLibraryResponseToJSON( + getSearchLibraryResponse: GetSearchLibraryResponse, +): string { + return JSON.stringify( + GetSearchLibraryResponse$outboundSchema.parse(getSearchLibraryResponse), + ); +} + +export function getSearchLibraryResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchLibraryResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchLibraryResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getsearchresults.ts b/src/sdk/models/operations/getsearchresults.ts index c5aa3b9c..63ec0925 100644 --- a/src/sdk/models/operations/getsearchresults.ts +++ b/src/sdk/models/operations/getsearchresults.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetSearchResultsRequest = { /** @@ -175,6 +178,24 @@ export namespace GetSearchResultsRequest$ { export type Outbound = GetSearchResultsRequest$Outbound; } +export function getSearchResultsRequestToJSON( + getSearchResultsRequest: GetSearchResultsRequest, +): string { + return JSON.stringify( + GetSearchResultsRequest$outboundSchema.parse(getSearchResultsRequest), + ); +} + +export function getSearchResultsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsRequest' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsPart$inboundSchema: z.ZodType< GetSearchResultsPart, @@ -232,6 +253,24 @@ export namespace GetSearchResultsPart$ { export type Outbound = GetSearchResultsPart$Outbound; } +export function getSearchResultsPartToJSON( + getSearchResultsPart: GetSearchResultsPart, +): string { + return JSON.stringify( + GetSearchResultsPart$outboundSchema.parse(getSearchResultsPart), + ); +} + +export function getSearchResultsPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsPart' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsMedia$inboundSchema: z.ZodType< GetSearchResultsMedia, @@ -318,6 +357,24 @@ export namespace GetSearchResultsMedia$ { export type Outbound = GetSearchResultsMedia$Outbound; } +export function getSearchResultsMediaToJSON( + getSearchResultsMedia: GetSearchResultsMedia, +): string { + return JSON.stringify( + GetSearchResultsMedia$outboundSchema.parse(getSearchResultsMedia), + ); +} + +export function getSearchResultsMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsMedia' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsGenre$inboundSchema: z.ZodType< GetSearchResultsGenre, @@ -354,6 +411,24 @@ export namespace GetSearchResultsGenre$ { export type Outbound = GetSearchResultsGenre$Outbound; } +export function getSearchResultsGenreToJSON( + getSearchResultsGenre: GetSearchResultsGenre, +): string { + return JSON.stringify( + GetSearchResultsGenre$outboundSchema.parse(getSearchResultsGenre), + ); +} + +export function getSearchResultsGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsGenre' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsDirector$inboundSchema: z.ZodType< GetSearchResultsDirector, @@ -390,6 +465,24 @@ export namespace GetSearchResultsDirector$ { export type Outbound = GetSearchResultsDirector$Outbound; } +export function getSearchResultsDirectorToJSON( + getSearchResultsDirector: GetSearchResultsDirector, +): string { + return JSON.stringify( + GetSearchResultsDirector$outboundSchema.parse(getSearchResultsDirector), + ); +} + +export function getSearchResultsDirectorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsDirector$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsDirector' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsWriter$inboundSchema: z.ZodType< GetSearchResultsWriter, @@ -426,6 +519,24 @@ export namespace GetSearchResultsWriter$ { export type Outbound = GetSearchResultsWriter$Outbound; } +export function getSearchResultsWriterToJSON( + getSearchResultsWriter: GetSearchResultsWriter, +): string { + return JSON.stringify( + GetSearchResultsWriter$outboundSchema.parse(getSearchResultsWriter), + ); +} + +export function getSearchResultsWriterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsWriter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsWriter' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsCountry$inboundSchema: z.ZodType< GetSearchResultsCountry, @@ -462,6 +573,24 @@ export namespace GetSearchResultsCountry$ { export type Outbound = GetSearchResultsCountry$Outbound; } +export function getSearchResultsCountryToJSON( + getSearchResultsCountry: GetSearchResultsCountry, +): string { + return JSON.stringify( + GetSearchResultsCountry$outboundSchema.parse(getSearchResultsCountry), + ); +} + +export function getSearchResultsCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsCountry' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsRole$inboundSchema: z.ZodType< GetSearchResultsRole, @@ -498,6 +627,24 @@ export namespace GetSearchResultsRole$ { export type Outbound = GetSearchResultsRole$Outbound; } +export function getSearchResultsRoleToJSON( + getSearchResultsRole: GetSearchResultsRole, +): string { + return JSON.stringify( + GetSearchResultsRole$outboundSchema.parse(getSearchResultsRole), + ); +} + +export function getSearchResultsRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsRole' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsMetadata$inboundSchema: z.ZodType< GetSearchResultsMetadata, @@ -659,6 +806,24 @@ export namespace GetSearchResultsMetadata$ { export type Outbound = GetSearchResultsMetadata$Outbound; } +export function getSearchResultsMetadataToJSON( + getSearchResultsMetadata: GetSearchResultsMetadata, +): string { + return JSON.stringify( + GetSearchResultsMetadata$outboundSchema.parse(getSearchResultsMetadata), + ); +} + +export function getSearchResultsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsMetadata' from JSON`, + ); +} + /** @internal */ export const Provider$inboundSchema: z.ZodType< Provider, @@ -701,6 +866,20 @@ export namespace Provider$ { export type Outbound = Provider$Outbound; } +export function providerToJSON(provider: Provider): string { + return JSON.stringify(Provider$outboundSchema.parse(provider)); +} + +export function providerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Provider$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Provider' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsMediaContainer$inboundSchema: z.ZodType< GetSearchResultsMediaContainer, @@ -764,6 +943,26 @@ export namespace GetSearchResultsMediaContainer$ { export type Outbound = GetSearchResultsMediaContainer$Outbound; } +export function getSearchResultsMediaContainerToJSON( + getSearchResultsMediaContainer: GetSearchResultsMediaContainer, +): string { + return JSON.stringify( + GetSearchResultsMediaContainer$outboundSchema.parse( + getSearchResultsMediaContainer, + ), + ); +} + +export function getSearchResultsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsResponseBody$inboundSchema: z.ZodType< GetSearchResultsResponseBody, @@ -810,6 +1009,26 @@ export namespace GetSearchResultsResponseBody$ { export type Outbound = GetSearchResultsResponseBody$Outbound; } +export function getSearchResultsResponseBodyToJSON( + getSearchResultsResponseBody: GetSearchResultsResponseBody, +): string { + return JSON.stringify( + GetSearchResultsResponseBody$outboundSchema.parse( + getSearchResultsResponseBody, + ), + ); +} + +export function getSearchResultsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetSearchResultsResponse$inboundSchema: z.ZodType< GetSearchResultsResponse, @@ -868,3 +1087,21 @@ export namespace GetSearchResultsResponse$ { /** @deprecated use `GetSearchResultsResponse$Outbound` instead. */ export type Outbound = GetSearchResultsResponse$Outbound; } + +export function getSearchResultsResponseToJSON( + getSearchResultsResponse: GetSearchResultsResponse, +): string { + return JSON.stringify( + GetSearchResultsResponse$outboundSchema.parse(getSearchResultsResponse), + ); +} + +export function getSearchResultsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSearchResultsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSearchResultsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getserveractivities.ts b/src/sdk/models/operations/getserveractivities.ts index c8adcd11..031c9142 100644 --- a/src/sdk/models/operations/getserveractivities.ts +++ b/src/sdk/models/operations/getserveractivities.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Context = { librarySectionID?: string | undefined; @@ -84,6 +87,20 @@ export namespace Context$ { export type Outbound = Context$Outbound; } +export function contextToJSON(context: Context): string { + return JSON.stringify(Context$outboundSchema.parse(context)); +} + +export function contextFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Context$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Context' from JSON`, + ); +} + /** @internal */ export const Activity$inboundSchema: z.ZodType< Activity, @@ -149,6 +166,20 @@ export namespace Activity$ { export type Outbound = Activity$Outbound; } +export function activityToJSON(activity: Activity): string { + return JSON.stringify(Activity$outboundSchema.parse(activity)); +} + +export function activityFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Activity$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Activity' from JSON`, + ); +} + /** @internal */ export const GetServerActivitiesMediaContainer$inboundSchema: z.ZodType< GetServerActivitiesMediaContainer, @@ -197,6 +228,26 @@ export namespace GetServerActivitiesMediaContainer$ { export type Outbound = GetServerActivitiesMediaContainer$Outbound; } +export function getServerActivitiesMediaContainerToJSON( + getServerActivitiesMediaContainer: GetServerActivitiesMediaContainer, +): string { + return JSON.stringify( + GetServerActivitiesMediaContainer$outboundSchema.parse( + getServerActivitiesMediaContainer, + ), + ); +} + +export function getServerActivitiesMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerActivitiesMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerActivitiesMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetServerActivitiesResponseBody$inboundSchema: z.ZodType< GetServerActivitiesResponseBody, @@ -243,6 +294,26 @@ export namespace GetServerActivitiesResponseBody$ { export type Outbound = GetServerActivitiesResponseBody$Outbound; } +export function getServerActivitiesResponseBodyToJSON( + getServerActivitiesResponseBody: GetServerActivitiesResponseBody, +): string { + return JSON.stringify( + GetServerActivitiesResponseBody$outboundSchema.parse( + getServerActivitiesResponseBody, + ), + ); +} + +export function getServerActivitiesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerActivitiesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerActivitiesResponseBody' from JSON`, + ); +} + /** @internal */ export const GetServerActivitiesResponse$inboundSchema: z.ZodType< GetServerActivitiesResponse, @@ -303,3 +374,23 @@ export namespace GetServerActivitiesResponse$ { /** @deprecated use `GetServerActivitiesResponse$Outbound` instead. */ export type Outbound = GetServerActivitiesResponse$Outbound; } + +export function getServerActivitiesResponseToJSON( + getServerActivitiesResponse: GetServerActivitiesResponse, +): string { + return JSON.stringify( + GetServerActivitiesResponse$outboundSchema.parse( + getServerActivitiesResponse, + ), + ); +} + +export function getServerActivitiesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerActivitiesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerActivitiesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getservercapabilities.ts b/src/sdk/models/operations/getservercapabilities.ts index e3f836f2..844108c4 100644 --- a/src/sdk/models/operations/getservercapabilities.ts +++ b/src/sdk/models/operations/getservercapabilities.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Directory = { count?: number | undefined; @@ -133,6 +136,20 @@ export namespace Directory$ { export type Outbound = Directory$Outbound; } +export function directoryToJSON(directory: Directory): string { + return JSON.stringify(Directory$outboundSchema.parse(directory)); +} + +export function directoryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Directory$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Directory' from JSON`, + ); +} + /** @internal */ export const MediaContainer$inboundSchema: z.ZodType< MediaContainer, @@ -327,6 +344,20 @@ export namespace MediaContainer$ { export type Outbound = MediaContainer$Outbound; } +export function mediaContainerToJSON(mediaContainer: MediaContainer): string { + return JSON.stringify(MediaContainer$outboundSchema.parse(mediaContainer)); +} + +export function mediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MediaContainer' from JSON`, + ); +} + /** @internal */ export const GetServerCapabilitiesResponseBody$inboundSchema: z.ZodType< GetServerCapabilitiesResponseBody, @@ -372,6 +403,26 @@ export namespace GetServerCapabilitiesResponseBody$ { export type Outbound = GetServerCapabilitiesResponseBody$Outbound; } +export function getServerCapabilitiesResponseBodyToJSON( + getServerCapabilitiesResponseBody: GetServerCapabilitiesResponseBody, +): string { + return JSON.stringify( + GetServerCapabilitiesResponseBody$outboundSchema.parse( + getServerCapabilitiesResponseBody, + ), + ); +} + +export function getServerCapabilitiesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerCapabilitiesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerCapabilitiesResponseBody' from JSON`, + ); +} + /** @internal */ export const GetServerCapabilitiesResponse$inboundSchema: z.ZodType< GetServerCapabilitiesResponse, @@ -432,3 +483,23 @@ export namespace GetServerCapabilitiesResponse$ { /** @deprecated use `GetServerCapabilitiesResponse$Outbound` instead. */ export type Outbound = GetServerCapabilitiesResponse$Outbound; } + +export function getServerCapabilitiesResponseToJSON( + getServerCapabilitiesResponse: GetServerCapabilitiesResponse, +): string { + return JSON.stringify( + GetServerCapabilitiesResponse$outboundSchema.parse( + getServerCapabilitiesResponse, + ), + ); +} + +export function getServerCapabilitiesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerCapabilitiesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerCapabilitiesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getserveridentity.ts b/src/sdk/models/operations/getserveridentity.ts index bf7e069d..3d700e70 100644 --- a/src/sdk/models/operations/getserveridentity.ts +++ b/src/sdk/models/operations/getserveridentity.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetServerIdentityMediaContainer = { size?: number | undefined; @@ -83,6 +86,26 @@ export namespace GetServerIdentityMediaContainer$ { export type Outbound = GetServerIdentityMediaContainer$Outbound; } +export function getServerIdentityMediaContainerToJSON( + getServerIdentityMediaContainer: GetServerIdentityMediaContainer, +): string { + return JSON.stringify( + GetServerIdentityMediaContainer$outboundSchema.parse( + getServerIdentityMediaContainer, + ), + ); +} + +export function getServerIdentityMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerIdentityMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerIdentityMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetServerIdentityResponseBody$inboundSchema: z.ZodType< GetServerIdentityResponseBody, @@ -129,6 +152,26 @@ export namespace GetServerIdentityResponseBody$ { export type Outbound = GetServerIdentityResponseBody$Outbound; } +export function getServerIdentityResponseBodyToJSON( + getServerIdentityResponseBody: GetServerIdentityResponseBody, +): string { + return JSON.stringify( + GetServerIdentityResponseBody$outboundSchema.parse( + getServerIdentityResponseBody, + ), + ); +} + +export function getServerIdentityResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerIdentityResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerIdentityResponseBody' from JSON`, + ); +} + /** @internal */ export const GetServerIdentityResponse$inboundSchema: z.ZodType< GetServerIdentityResponse, @@ -187,3 +230,21 @@ export namespace GetServerIdentityResponse$ { /** @deprecated use `GetServerIdentityResponse$Outbound` instead. */ export type Outbound = GetServerIdentityResponse$Outbound; } + +export function getServerIdentityResponseToJSON( + getServerIdentityResponse: GetServerIdentityResponse, +): string { + return JSON.stringify( + GetServerIdentityResponse$outboundSchema.parse(getServerIdentityResponse), + ); +} + +export function getServerIdentityResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerIdentityResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerIdentityResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getserverlist.ts b/src/sdk/models/operations/getserverlist.ts index 1aba864b..3bb3c010 100644 --- a/src/sdk/models/operations/getserverlist.ts +++ b/src/sdk/models/operations/getserverlist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetServerListServer = { name?: string | undefined; @@ -96,6 +99,24 @@ export namespace GetServerListServer$ { export type Outbound = GetServerListServer$Outbound; } +export function getServerListServerToJSON( + getServerListServer: GetServerListServer, +): string { + return JSON.stringify( + GetServerListServer$outboundSchema.parse(getServerListServer), + ); +} + +export function getServerListServerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerListServer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerListServer' from JSON`, + ); +} + /** @internal */ export const GetServerListMediaContainer$inboundSchema: z.ZodType< GetServerListMediaContainer, @@ -143,6 +164,26 @@ export namespace GetServerListMediaContainer$ { export type Outbound = GetServerListMediaContainer$Outbound; } +export function getServerListMediaContainerToJSON( + getServerListMediaContainer: GetServerListMediaContainer, +): string { + return JSON.stringify( + GetServerListMediaContainer$outboundSchema.parse( + getServerListMediaContainer, + ), + ); +} + +export function getServerListMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerListMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerListMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetServerListResponseBody$inboundSchema: z.ZodType< GetServerListResponseBody, @@ -189,6 +230,24 @@ export namespace GetServerListResponseBody$ { export type Outbound = GetServerListResponseBody$Outbound; } +export function getServerListResponseBodyToJSON( + getServerListResponseBody: GetServerListResponseBody, +): string { + return JSON.stringify( + GetServerListResponseBody$outboundSchema.parse(getServerListResponseBody), + ); +} + +export function getServerListResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerListResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerListResponseBody' from JSON`, + ); +} + /** @internal */ export const GetServerListResponse$inboundSchema: z.ZodType< GetServerListResponse, @@ -247,3 +306,21 @@ export namespace GetServerListResponse$ { /** @deprecated use `GetServerListResponse$Outbound` instead. */ export type Outbound = GetServerListResponse$Outbound; } + +export function getServerListResponseToJSON( + getServerListResponse: GetServerListResponse, +): string { + return JSON.stringify( + GetServerListResponse$outboundSchema.parse(getServerListResponse), + ); +} + +export function getServerListResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerListResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerListResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getserverpreferences.ts b/src/sdk/models/operations/getserverpreferences.ts index abcc27b6..56c91d49 100644 --- a/src/sdk/models/operations/getserverpreferences.ts +++ b/src/sdk/models/operations/getserverpreferences.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Setting = { id?: string | undefined; @@ -109,6 +112,20 @@ export namespace Setting$ { export type Outbound = Setting$Outbound; } +export function settingToJSON(setting: Setting): string { + return JSON.stringify(Setting$outboundSchema.parse(setting)); +} + +export function settingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Setting$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Setting' from JSON`, + ); +} + /** @internal */ export const GetServerPreferencesMediaContainer$inboundSchema: z.ZodType< GetServerPreferencesMediaContainer, @@ -157,6 +174,27 @@ export namespace GetServerPreferencesMediaContainer$ { export type Outbound = GetServerPreferencesMediaContainer$Outbound; } +export function getServerPreferencesMediaContainerToJSON( + getServerPreferencesMediaContainer: GetServerPreferencesMediaContainer, +): string { + return JSON.stringify( + GetServerPreferencesMediaContainer$outboundSchema.parse( + getServerPreferencesMediaContainer, + ), + ); +} + +export function getServerPreferencesMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetServerPreferencesMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerPreferencesMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetServerPreferencesResponseBody$inboundSchema: z.ZodType< GetServerPreferencesResponseBody, @@ -204,6 +242,26 @@ export namespace GetServerPreferencesResponseBody$ { export type Outbound = GetServerPreferencesResponseBody$Outbound; } +export function getServerPreferencesResponseBodyToJSON( + getServerPreferencesResponseBody: GetServerPreferencesResponseBody, +): string { + return JSON.stringify( + GetServerPreferencesResponseBody$outboundSchema.parse( + getServerPreferencesResponseBody, + ), + ); +} + +export function getServerPreferencesResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerPreferencesResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerPreferencesResponseBody' from JSON`, + ); +} + /** @internal */ export const GetServerPreferencesResponse$inboundSchema: z.ZodType< GetServerPreferencesResponse, @@ -264,3 +322,23 @@ export namespace GetServerPreferencesResponse$ { /** @deprecated use `GetServerPreferencesResponse$Outbound` instead. */ export type Outbound = GetServerPreferencesResponse$Outbound; } + +export function getServerPreferencesResponseToJSON( + getServerPreferencesResponse: GetServerPreferencesResponse, +): string { + return JSON.stringify( + GetServerPreferencesResponse$outboundSchema.parse( + getServerPreferencesResponse, + ), + ); +} + +export function getServerPreferencesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerPreferencesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerPreferencesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getserverresources.ts b/src/sdk/models/operations/getserverresources.ts index 7677f321..9f71fa79 100644 --- a/src/sdk/models/operations/getserverresources.ts +++ b/src/sdk/models/operations/getserverresources.ts @@ -4,18 +4,14 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetServerResourcesServerList = [ "https://plex.tv/api/v2", ] as const; -export type GetServerResourcesGlobals = { - /** - * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - */ - clientID?: string | undefined; -}; - /** * Include Https entries in the results */ @@ -62,7 +58,7 @@ export type GetServerResourcesRequest = { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - clientID?: string | undefined; + clientID: string; }; /** @@ -153,50 +149,6 @@ export type GetServerResourcesResponse = { plexDevices?: Array | undefined; }; -/** @internal */ -export const GetServerResourcesGlobals$inboundSchema: z.ZodType< - GetServerResourcesGlobals, - z.ZodTypeDef, - unknown -> = z.object({ - ClientID: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "ClientID": "clientID", - }); -}); - -/** @internal */ -export type GetServerResourcesGlobals$Outbound = { - ClientID?: string | undefined; -}; - -/** @internal */ -export const GetServerResourcesGlobals$outboundSchema: z.ZodType< - GetServerResourcesGlobals$Outbound, - z.ZodTypeDef, - GetServerResourcesGlobals -> = z.object({ - clientID: z.string().optional(), -}).transform((v) => { - return remap$(v, { - clientID: "ClientID", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetServerResourcesGlobals$ { - /** @deprecated use `GetServerResourcesGlobals$inboundSchema` instead. */ - export const inboundSchema = GetServerResourcesGlobals$inboundSchema; - /** @deprecated use `GetServerResourcesGlobals$outboundSchema` instead. */ - export const outboundSchema = GetServerResourcesGlobals$outboundSchema; - /** @deprecated use `GetServerResourcesGlobals$Outbound` instead. */ - export type Outbound = GetServerResourcesGlobals$Outbound; -} - /** @internal */ export const IncludeHttps$inboundSchema: z.ZodNativeEnum = z.nativeEnum(IncludeHttps); @@ -263,7 +215,7 @@ export const GetServerResourcesRequest$inboundSchema: z.ZodType< includeHttps: IncludeHttps$inboundSchema, includeRelay: IncludeRelay$inboundSchema, includeIPv6: IncludeIPv6$inboundSchema, - ClientID: z.string().optional(), + ClientID: z.string(), }).transform((v) => { return remap$(v, { "ClientID": "clientID", @@ -275,7 +227,7 @@ export type GetServerResourcesRequest$Outbound = { includeHttps: number; includeRelay: number; includeIPv6: number; - ClientID?: string | undefined; + ClientID: string; }; /** @internal */ @@ -287,7 +239,7 @@ export const GetServerResourcesRequest$outboundSchema: z.ZodType< includeHttps: IncludeHttps$outboundSchema.default(IncludeHttps.Disable), includeRelay: IncludeRelay$outboundSchema.default(IncludeRelay.Disable), includeIPv6: IncludeIPv6$outboundSchema.default(IncludeIPv6.Disable), - clientID: z.string().optional(), + clientID: z.string(), }).transform((v) => { return remap$(v, { clientID: "ClientID", @@ -307,6 +259,24 @@ export namespace GetServerResourcesRequest$ { export type Outbound = GetServerResourcesRequest$Outbound; } +export function getServerResourcesRequestToJSON( + getServerResourcesRequest: GetServerResourcesRequest, +): string { + return JSON.stringify( + GetServerResourcesRequest$outboundSchema.parse(getServerResourcesRequest), + ); +} + +export function getServerResourcesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerResourcesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerResourcesRequest' from JSON`, + ); +} + /** @internal */ export const Protocol$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Protocol); @@ -388,6 +358,20 @@ export namespace Connections$ { export type Outbound = Connections$Outbound; } +export function connectionsToJSON(connections: Connections): string { + return JSON.stringify(Connections$outboundSchema.parse(connections)); +} + +export function connectionsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Connections$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Connections' from JSON`, + ); +} + /** @internal */ export const PlexDevice$inboundSchema: z.ZodType< PlexDevice, @@ -493,6 +477,20 @@ export namespace PlexDevice$ { export type Outbound = PlexDevice$Outbound; } +export function plexDeviceToJSON(plexDevice: PlexDevice): string { + return JSON.stringify(PlexDevice$outboundSchema.parse(plexDevice)); +} + +export function plexDeviceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PlexDevice$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PlexDevice' from JSON`, + ); +} + /** @internal */ export const GetServerResourcesResponse$inboundSchema: z.ZodType< GetServerResourcesResponse, @@ -553,3 +551,21 @@ export namespace GetServerResourcesResponse$ { /** @deprecated use `GetServerResourcesResponse$Outbound` instead. */ export type Outbound = GetServerResourcesResponse$Outbound; } + +export function getServerResourcesResponseToJSON( + getServerResourcesResponse: GetServerResourcesResponse, +): string { + return JSON.stringify( + GetServerResourcesResponse$outboundSchema.parse(getServerResourcesResponse), + ); +} + +export function getServerResourcesResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetServerResourcesResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetServerResourcesResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getsessionhistory.ts b/src/sdk/models/operations/getsessionhistory.ts index b53ed08e..417bb6f0 100644 --- a/src/sdk/models/operations/getsessionhistory.ts +++ b/src/sdk/models/operations/getsessionhistory.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Filters content by field and direction/equality @@ -125,6 +128,24 @@ export namespace QueryParamFilter$ { export type Outbound = QueryParamFilter$Outbound; } +export function queryParamFilterToJSON( + queryParamFilter: QueryParamFilter, +): string { + return JSON.stringify( + QueryParamFilter$outboundSchema.parse(queryParamFilter), + ); +} + +export function queryParamFilterFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => QueryParamFilter$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'QueryParamFilter' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryRequest$inboundSchema: z.ZodType< GetSessionHistoryRequest, @@ -170,6 +191,24 @@ export namespace GetSessionHistoryRequest$ { export type Outbound = GetSessionHistoryRequest$Outbound; } +export function getSessionHistoryRequestToJSON( + getSessionHistoryRequest: GetSessionHistoryRequest, +): string { + return JSON.stringify( + GetSessionHistoryRequest$outboundSchema.parse(getSessionHistoryRequest), + ); +} + +export function getSessionHistoryRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistoryRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistoryRequest' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryMetadata$inboundSchema: z.ZodType< GetSessionHistoryMetadata, @@ -261,6 +300,24 @@ export namespace GetSessionHistoryMetadata$ { export type Outbound = GetSessionHistoryMetadata$Outbound; } +export function getSessionHistoryMetadataToJSON( + getSessionHistoryMetadata: GetSessionHistoryMetadata, +): string { + return JSON.stringify( + GetSessionHistoryMetadata$outboundSchema.parse(getSessionHistoryMetadata), + ); +} + +export function getSessionHistoryMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistoryMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistoryMetadata' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryMediaContainer$inboundSchema: z.ZodType< GetSessionHistoryMediaContainer, @@ -310,6 +367,26 @@ export namespace GetSessionHistoryMediaContainer$ { export type Outbound = GetSessionHistoryMediaContainer$Outbound; } +export function getSessionHistoryMediaContainerToJSON( + getSessionHistoryMediaContainer: GetSessionHistoryMediaContainer, +): string { + return JSON.stringify( + GetSessionHistoryMediaContainer$outboundSchema.parse( + getSessionHistoryMediaContainer, + ), + ); +} + +export function getSessionHistoryMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistoryMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistoryMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryResponseBody$inboundSchema: z.ZodType< GetSessionHistoryResponseBody, @@ -356,6 +433,26 @@ export namespace GetSessionHistoryResponseBody$ { export type Outbound = GetSessionHistoryResponseBody$Outbound; } +export function getSessionHistoryResponseBodyToJSON( + getSessionHistoryResponseBody: GetSessionHistoryResponseBody, +): string { + return JSON.stringify( + GetSessionHistoryResponseBody$outboundSchema.parse( + getSessionHistoryResponseBody, + ), + ); +} + +export function getSessionHistoryResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistoryResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistoryResponseBody' from JSON`, + ); +} + /** @internal */ export const GetSessionHistoryResponse$inboundSchema: z.ZodType< GetSessionHistoryResponse, @@ -414,3 +511,21 @@ export namespace GetSessionHistoryResponse$ { /** @deprecated use `GetSessionHistoryResponse$Outbound` instead. */ export type Outbound = GetSessionHistoryResponse$Outbound; } + +export function getSessionHistoryResponseToJSON( + getSessionHistoryResponse: GetSessionHistoryResponse, +): string { + return JSON.stringify( + GetSessionHistoryResponse$outboundSchema.parse(getSessionHistoryResponse), + ); +} + +export function getSessionHistoryResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionHistoryResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionHistoryResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getsessions.ts b/src/sdk/models/operations/getsessions.ts index 31dfec1d..f1ef2159 100644 --- a/src/sdk/models/operations/getsessions.ts +++ b/src/sdk/models/operations/getsessions.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetSessionsStream = { albumGain?: string | undefined; @@ -246,6 +249,24 @@ export namespace GetSessionsStream$ { export type Outbound = GetSessionsStream$Outbound; } +export function getSessionsStreamToJSON( + getSessionsStream: GetSessionsStream, +): string { + return JSON.stringify( + GetSessionsStream$outboundSchema.parse(getSessionsStream), + ); +} + +export function getSessionsStreamFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsStream$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsStream' from JSON`, + ); +} + /** @internal */ export const GetSessionsPart$inboundSchema: z.ZodType< GetSessionsPart, @@ -317,6 +338,22 @@ export namespace GetSessionsPart$ { export type Outbound = GetSessionsPart$Outbound; } +export function getSessionsPartToJSON( + getSessionsPart: GetSessionsPart, +): string { + return JSON.stringify(GetSessionsPart$outboundSchema.parse(getSessionsPart)); +} + +export function getSessionsPartFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsPart$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsPart' from JSON`, + ); +} + /** @internal */ export const GetSessionsMedia$inboundSchema: z.ZodType< GetSessionsMedia, @@ -382,6 +419,24 @@ export namespace GetSessionsMedia$ { export type Outbound = GetSessionsMedia$Outbound; } +export function getSessionsMediaToJSON( + getSessionsMedia: GetSessionsMedia, +): string { + return JSON.stringify( + GetSessionsMedia$outboundSchema.parse(getSessionsMedia), + ); +} + +export function getSessionsMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsMedia' from JSON`, + ); +} + /** @internal */ export const GetSessionsUser$inboundSchema: z.ZodType< GetSessionsUser, @@ -424,6 +479,22 @@ export namespace GetSessionsUser$ { export type Outbound = GetSessionsUser$Outbound; } +export function getSessionsUserToJSON( + getSessionsUser: GetSessionsUser, +): string { + return JSON.stringify(GetSessionsUser$outboundSchema.parse(getSessionsUser)); +} + +export function getSessionsUserFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsUser$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsUser' from JSON`, + ); +} + /** @internal */ export const Player$inboundSchema: z.ZodType = z .object({ @@ -499,6 +570,20 @@ export namespace Player$ { export type Outbound = Player$Outbound; } +export function playerToJSON(player: Player): string { + return JSON.stringify(Player$outboundSchema.parse(player)); +} + +export function playerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Player$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Player' from JSON`, + ); +} + /** @internal */ export const Session$inboundSchema: z.ZodType = z.object({ @@ -538,6 +623,20 @@ export namespace Session$ { export type Outbound = Session$Outbound; } +export function sessionToJSON(session: Session): string { + return JSON.stringify(Session$outboundSchema.parse(session)); +} + +export function sessionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Session$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Session' from JSON`, + ); +} + /** @internal */ export const GetSessionsMetadata$inboundSchema: z.ZodType< GetSessionsMetadata, @@ -696,6 +795,24 @@ export namespace GetSessionsMetadata$ { export type Outbound = GetSessionsMetadata$Outbound; } +export function getSessionsMetadataToJSON( + getSessionsMetadata: GetSessionsMetadata, +): string { + return JSON.stringify( + GetSessionsMetadata$outboundSchema.parse(getSessionsMetadata), + ); +} + +export function getSessionsMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsMetadata' from JSON`, + ); +} + /** @internal */ export const GetSessionsMediaContainer$inboundSchema: z.ZodType< GetSessionsMediaContainer, @@ -744,6 +861,24 @@ export namespace GetSessionsMediaContainer$ { export type Outbound = GetSessionsMediaContainer$Outbound; } +export function getSessionsMediaContainerToJSON( + getSessionsMediaContainer: GetSessionsMediaContainer, +): string { + return JSON.stringify( + GetSessionsMediaContainer$outboundSchema.parse(getSessionsMediaContainer), + ); +} + +export function getSessionsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetSessionsResponseBody$inboundSchema: z.ZodType< GetSessionsResponseBody, @@ -790,6 +925,24 @@ export namespace GetSessionsResponseBody$ { export type Outbound = GetSessionsResponseBody$Outbound; } +export function getSessionsResponseBodyToJSON( + getSessionsResponseBody: GetSessionsResponseBody, +): string { + return JSON.stringify( + GetSessionsResponseBody$outboundSchema.parse(getSessionsResponseBody), + ); +} + +export function getSessionsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetSessionsResponse$inboundSchema: z.ZodType< GetSessionsResponse, @@ -848,3 +1001,21 @@ export namespace GetSessionsResponse$ { /** @deprecated use `GetSessionsResponse$Outbound` instead. */ export type Outbound = GetSessionsResponse$Outbound; } + +export function getSessionsResponseToJSON( + getSessionsResponse: GetSessionsResponse, +): string { + return JSON.stringify( + GetSessionsResponse$outboundSchema.parse(getSessionsResponse), + ); +} + +export function getSessionsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetSessionsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSessionsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getsourceconnectioninformation.ts b/src/sdk/models/operations/getsourceconnectioninformation.ts index 8782f508..e418abd3 100644 --- a/src/sdk/models/operations/getsourceconnectioninformation.ts +++ b/src/sdk/models/operations/getsourceconnectioninformation.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetSourceConnectionInformationRequest = { /** @@ -65,6 +68,27 @@ export namespace GetSourceConnectionInformationRequest$ { export type Outbound = GetSourceConnectionInformationRequest$Outbound; } +export function getSourceConnectionInformationRequestToJSON( + getSourceConnectionInformationRequest: GetSourceConnectionInformationRequest, +): string { + return JSON.stringify( + GetSourceConnectionInformationRequest$outboundSchema.parse( + getSourceConnectionInformationRequest, + ), + ); +} + +export function getSourceConnectionInformationRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSourceConnectionInformationRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSourceConnectionInformationRequest' from JSON`, + ); +} + /** @internal */ export const GetSourceConnectionInformationResponse$inboundSchema: z.ZodType< GetSourceConnectionInformationResponse, @@ -122,3 +146,25 @@ export namespace GetSourceConnectionInformationResponse$ { /** @deprecated use `GetSourceConnectionInformationResponse$Outbound` instead. */ export type Outbound = GetSourceConnectionInformationResponse$Outbound; } + +export function getSourceConnectionInformationResponseToJSON( + getSourceConnectionInformationResponse: + GetSourceConnectionInformationResponse, +): string { + return JSON.stringify( + GetSourceConnectionInformationResponse$outboundSchema.parse( + getSourceConnectionInformationResponse, + ), + ); +} + +export function getSourceConnectionInformationResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetSourceConnectionInformationResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetSourceConnectionInformationResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getstatistics.ts b/src/sdk/models/operations/getstatistics.ts index 46e43edf..60481f52 100644 --- a/src/sdk/models/operations/getstatistics.ts +++ b/src/sdk/models/operations/getstatistics.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetStatisticsRequest = { /** @@ -113,6 +116,24 @@ export namespace GetStatisticsRequest$ { export type Outbound = GetStatisticsRequest$Outbound; } +export function getStatisticsRequestToJSON( + getStatisticsRequest: GetStatisticsRequest, +): string { + return JSON.stringify( + GetStatisticsRequest$outboundSchema.parse(getStatisticsRequest), + ); +} + +export function getStatisticsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsRequest' from JSON`, + ); +} + /** @internal */ export const GetStatisticsDevice$inboundSchema: z.ZodType< GetStatisticsDevice, @@ -161,6 +182,24 @@ export namespace GetStatisticsDevice$ { export type Outbound = GetStatisticsDevice$Outbound; } +export function getStatisticsDeviceToJSON( + getStatisticsDevice: GetStatisticsDevice, +): string { + return JSON.stringify( + GetStatisticsDevice$outboundSchema.parse(getStatisticsDevice), + ); +} + +export function getStatisticsDeviceFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsDevice$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsDevice' from JSON`, + ); +} + /** @internal */ export const Account$inboundSchema: z.ZodType = z.object({ @@ -215,6 +254,20 @@ export namespace Account$ { export type Outbound = Account$Outbound; } +export function accountToJSON(account: Account): string { + return JSON.stringify(Account$outboundSchema.parse(account)); +} + +export function accountFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Account$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Account' from JSON`, + ); +} + /** @internal */ export const StatisticsMedia$inboundSchema: z.ZodType< StatisticsMedia, @@ -269,6 +322,22 @@ export namespace StatisticsMedia$ { export type Outbound = StatisticsMedia$Outbound; } +export function statisticsMediaToJSON( + statisticsMedia: StatisticsMedia, +): string { + return JSON.stringify(StatisticsMedia$outboundSchema.parse(statisticsMedia)); +} + +export function statisticsMediaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StatisticsMedia$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StatisticsMedia' from JSON`, + ); +} + /** @internal */ export const GetStatisticsMediaContainer$inboundSchema: z.ZodType< GetStatisticsMediaContainer, @@ -328,6 +397,26 @@ export namespace GetStatisticsMediaContainer$ { export type Outbound = GetStatisticsMediaContainer$Outbound; } +export function getStatisticsMediaContainerToJSON( + getStatisticsMediaContainer: GetStatisticsMediaContainer, +): string { + return JSON.stringify( + GetStatisticsMediaContainer$outboundSchema.parse( + getStatisticsMediaContainer, + ), + ); +} + +export function getStatisticsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetStatisticsResponseBody$inboundSchema: z.ZodType< GetStatisticsResponseBody, @@ -374,6 +463,24 @@ export namespace GetStatisticsResponseBody$ { export type Outbound = GetStatisticsResponseBody$Outbound; } +export function getStatisticsResponseBodyToJSON( + getStatisticsResponseBody: GetStatisticsResponseBody, +): string { + return JSON.stringify( + GetStatisticsResponseBody$outboundSchema.parse(getStatisticsResponseBody), + ); +} + +export function getStatisticsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetStatisticsResponse$inboundSchema: z.ZodType< GetStatisticsResponse, @@ -432,3 +539,21 @@ export namespace GetStatisticsResponse$ { /** @deprecated use `GetStatisticsResponse$Outbound` instead. */ export type Outbound = GetStatisticsResponse$Outbound; } + +export function getStatisticsResponseToJSON( + getStatisticsResponse: GetStatisticsResponse, +): string { + return JSON.stringify( + GetStatisticsResponse$outboundSchema.parse(getStatisticsResponse), + ); +} + +export function getStatisticsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetStatisticsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetStatisticsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getthumbimage.ts b/src/sdk/models/operations/getthumbimage.ts index 3a806e11..c22187ad 100644 --- a/src/sdk/models/operations/getthumbimage.ts +++ b/src/sdk/models/operations/getthumbimage.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type GetThumbImageRequest = { /** @@ -99,6 +102,24 @@ export namespace GetThumbImageRequest$ { export type Outbound = GetThumbImageRequest$Outbound; } +export function getThumbImageRequestToJSON( + getThumbImageRequest: GetThumbImageRequest, +): string { + return JSON.stringify( + GetThumbImageRequest$outboundSchema.parse(getThumbImageRequest), + ); +} + +export function getThumbImageRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetThumbImageRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetThumbImageRequest' from JSON`, + ); +} + /** @internal */ export const GetThumbImageResponse$inboundSchema: z.ZodType< GetThumbImageResponse, @@ -164,3 +185,21 @@ export namespace GetThumbImageResponse$ { /** @deprecated use `GetThumbImageResponse$Outbound` instead. */ export type Outbound = GetThumbImageResponse$Outbound; } + +export function getThumbImageResponseToJSON( + getThumbImageResponse: GetThumbImageResponse, +): string { + return JSON.stringify( + GetThumbImageResponse$outboundSchema.parse(getThumbImageResponse), + ); +} + +export function getThumbImageResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetThumbImageResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetThumbImageResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gettimeline.ts b/src/sdk/models/operations/gettimeline.ts index 61797dc4..4479062a 100644 --- a/src/sdk/models/operations/gettimeline.ts +++ b/src/sdk/models/operations/gettimeline.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The state of the media item @@ -155,6 +158,24 @@ export namespace GetTimelineRequest$ { export type Outbound = GetTimelineRequest$Outbound; } +export function getTimelineRequestToJSON( + getTimelineRequest: GetTimelineRequest, +): string { + return JSON.stringify( + GetTimelineRequest$outboundSchema.parse(getTimelineRequest), + ); +} + +export function getTimelineRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTimelineRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTimelineRequest' from JSON`, + ); +} + /** @internal */ export const GetTimelineResponse$inboundSchema: z.ZodType< GetTimelineResponse, @@ -210,3 +231,21 @@ export namespace GetTimelineResponse$ { /** @deprecated use `GetTimelineResponse$Outbound` instead. */ export type Outbound = GetTimelineResponse$Outbound; } + +export function getTimelineResponseToJSON( + getTimelineResponse: GetTimelineResponse, +): string { + return JSON.stringify( + GetTimelineResponse$outboundSchema.parse(getTimelineResponse), + ); +} + +export function getTimelineResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTimelineResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTimelineResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gettokenbypinid.ts b/src/sdk/models/operations/gettokenbypinid.ts index 24ebf1c8..ddeb0231 100644 --- a/src/sdk/models/operations/gettokenbypinid.ts +++ b/src/sdk/models/operations/gettokenbypinid.ts @@ -4,34 +4,14 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetTokenByPinIdServerList = [ "https://plex.tv/api/v2", ] as const; -export type GetTokenByPinIdGlobals = { - /** - * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - */ - clientID?: string | undefined; - /** - * The name of the client application. (Plex Web, Plex Media Server, etc.) - */ - clientName?: string | undefined; - /** - * A relatively friendly name for the client device - */ - deviceNickname?: string | undefined; - /** - * The version of the client application. - */ - clientVersion?: string | undefined; - /** - * The platform of the client application. - */ - platform?: string | undefined; -}; - export type GetTokenByPinIdRequest = { /** * The PinID to retrieve an access token for @@ -40,7 +20,7 @@ export type GetTokenByPinIdRequest = { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - clientID?: string | undefined; + clientID: string; /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -155,70 +135,6 @@ export type GetTokenByPinIdResponse = { authPinContainer?: GetTokenByPinIdAuthPinContainer | undefined; }; -/** @internal */ -export const GetTokenByPinIdGlobals$inboundSchema: z.ZodType< - GetTokenByPinIdGlobals, - z.ZodTypeDef, - unknown -> = z.object({ - ClientID: z.string().optional(), - ClientName: z.string().optional(), - DeviceNickname: z.string().optional(), - ClientVersion: z.string().optional(), - Platform: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "ClientID": "clientID", - "ClientName": "clientName", - "DeviceNickname": "deviceNickname", - "ClientVersion": "clientVersion", - "Platform": "platform", - }); -}); - -/** @internal */ -export type GetTokenByPinIdGlobals$Outbound = { - ClientID?: string | undefined; - ClientName?: string | undefined; - DeviceNickname?: string | undefined; - ClientVersion?: string | undefined; - Platform?: string | undefined; -}; - -/** @internal */ -export const GetTokenByPinIdGlobals$outboundSchema: z.ZodType< - GetTokenByPinIdGlobals$Outbound, - z.ZodTypeDef, - GetTokenByPinIdGlobals -> = z.object({ - clientID: z.string().optional(), - clientName: z.string().optional(), - deviceNickname: z.string().optional(), - clientVersion: z.string().optional(), - platform: z.string().optional(), -}).transform((v) => { - return remap$(v, { - clientID: "ClientID", - clientName: "ClientName", - deviceNickname: "DeviceNickname", - clientVersion: "ClientVersion", - platform: "Platform", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace GetTokenByPinIdGlobals$ { - /** @deprecated use `GetTokenByPinIdGlobals$inboundSchema` instead. */ - export const inboundSchema = GetTokenByPinIdGlobals$inboundSchema; - /** @deprecated use `GetTokenByPinIdGlobals$outboundSchema` instead. */ - export const outboundSchema = GetTokenByPinIdGlobals$outboundSchema; - /** @deprecated use `GetTokenByPinIdGlobals$Outbound` instead. */ - export type Outbound = GetTokenByPinIdGlobals$Outbound; -} - /** @internal */ export const GetTokenByPinIdRequest$inboundSchema: z.ZodType< GetTokenByPinIdRequest, @@ -226,7 +142,7 @@ export const GetTokenByPinIdRequest$inboundSchema: z.ZodType< unknown > = z.object({ pinID: z.number().int(), - ClientID: z.string().optional(), + ClientID: z.string(), ClientName: z.string().optional(), DeviceNickname: z.string().optional(), ClientVersion: z.string().optional(), @@ -244,7 +160,7 @@ export const GetTokenByPinIdRequest$inboundSchema: z.ZodType< /** @internal */ export type GetTokenByPinIdRequest$Outbound = { pinID: number; - ClientID?: string | undefined; + ClientID: string; ClientName?: string | undefined; DeviceNickname?: string | undefined; ClientVersion?: string | undefined; @@ -258,7 +174,7 @@ export const GetTokenByPinIdRequest$outboundSchema: z.ZodType< GetTokenByPinIdRequest > = z.object({ pinID: z.number().int(), - clientID: z.string().optional(), + clientID: z.string(), clientName: z.string().optional(), deviceNickname: z.string().optional(), clientVersion: z.string().optional(), @@ -286,6 +202,24 @@ export namespace GetTokenByPinIdRequest$ { export type Outbound = GetTokenByPinIdRequest$Outbound; } +export function getTokenByPinIdRequestToJSON( + getTokenByPinIdRequest: GetTokenByPinIdRequest, +): string { + return JSON.stringify( + GetTokenByPinIdRequest$outboundSchema.parse(getTokenByPinIdRequest), + ); +} + +export function getTokenByPinIdRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenByPinIdRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenByPinIdRequest' from JSON`, + ); +} + /** @internal */ export const GetTokenByPinIdGeoData$inboundSchema: z.ZodType< GetTokenByPinIdGeoData, @@ -370,6 +304,24 @@ export namespace GetTokenByPinIdGeoData$ { export type Outbound = GetTokenByPinIdGeoData$Outbound; } +export function getTokenByPinIdGeoDataToJSON( + getTokenByPinIdGeoData: GetTokenByPinIdGeoData, +): string { + return JSON.stringify( + GetTokenByPinIdGeoData$outboundSchema.parse(getTokenByPinIdGeoData), + ); +} + +export function getTokenByPinIdGeoDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenByPinIdGeoData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenByPinIdGeoData' from JSON`, + ); +} + /** @internal */ export const GetTokenByPinIdAuthPinContainer$inboundSchema: z.ZodType< GetTokenByPinIdAuthPinContainer, @@ -439,6 +391,26 @@ export namespace GetTokenByPinIdAuthPinContainer$ { export type Outbound = GetTokenByPinIdAuthPinContainer$Outbound; } +export function getTokenByPinIdAuthPinContainerToJSON( + getTokenByPinIdAuthPinContainer: GetTokenByPinIdAuthPinContainer, +): string { + return JSON.stringify( + GetTokenByPinIdAuthPinContainer$outboundSchema.parse( + getTokenByPinIdAuthPinContainer, + ), + ); +} + +export function getTokenByPinIdAuthPinContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenByPinIdAuthPinContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenByPinIdAuthPinContainer' from JSON`, + ); +} + /** @internal */ export const GetTokenByPinIdResponse$inboundSchema: z.ZodType< GetTokenByPinIdResponse, @@ -501,3 +473,21 @@ export namespace GetTokenByPinIdResponse$ { /** @deprecated use `GetTokenByPinIdResponse$Outbound` instead. */ export type Outbound = GetTokenByPinIdResponse$Outbound; } + +export function getTokenByPinIdResponseToJSON( + getTokenByPinIdResponse: GetTokenByPinIdResponse, +): string { + return JSON.stringify( + GetTokenByPinIdResponse$outboundSchema.parse(getTokenByPinIdResponse), + ); +} + +export function getTokenByPinIdResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenByPinIdResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenByPinIdResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gettokendetails.ts b/src/sdk/models/operations/gettokendetails.ts index 54a2059a..77383672 100644 --- a/src/sdk/models/operations/gettokendetails.ts +++ b/src/sdk/models/operations/gettokendetails.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetTokenDetailsServerList = [ "https://plex.tv/api/v2", @@ -528,6 +531,20 @@ export namespace UserProfile$ { export type Outbound = UserProfile$Outbound; } +export function userProfileToJSON(userProfile: UserProfile): string { + return JSON.stringify(UserProfile$outboundSchema.parse(userProfile)); +} + +export function userProfileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UserProfile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UserProfile' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsStatus$inboundSchema: z.ZodNativeEnum< typeof GetTokenDetailsStatus @@ -597,6 +614,20 @@ export namespace Services$ { export type Outbound = Services$Outbound; } +export function servicesToJSON(services: Services): string { + return JSON.stringify(Services$outboundSchema.parse(services)); +} + +export function servicesFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Services$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Services' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsAuthenticationStatus$inboundSchema: z.ZodNativeEnum< typeof GetTokenDetailsAuthenticationStatus @@ -671,6 +702,20 @@ export namespace Subscription$ { export type Outbound = Subscription$Outbound; } +export function subscriptionToJSON(subscription: Subscription): string { + return JSON.stringify(Subscription$outboundSchema.parse(subscription)); +} + +export function subscriptionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Subscription$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Subscription' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsAuthenticationResponseStatus$inboundSchema: z.ZodNativeEnum = z @@ -745,6 +790,26 @@ export namespace GetTokenDetailsSubscription$ { export type Outbound = GetTokenDetailsSubscription$Outbound; } +export function getTokenDetailsSubscriptionToJSON( + getTokenDetailsSubscription: GetTokenDetailsSubscription, +): string { + return JSON.stringify( + GetTokenDetailsSubscription$outboundSchema.parse( + getTokenDetailsSubscription, + ), + ); +} + +export function getTokenDetailsSubscriptionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenDetailsSubscription$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenDetailsSubscription' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsUserPlexAccount$inboundSchema: z.ZodType< GetTokenDetailsUserPlexAccount, @@ -905,6 +970,26 @@ export namespace GetTokenDetailsUserPlexAccount$ { export type Outbound = GetTokenDetailsUserPlexAccount$Outbound; } +export function getTokenDetailsUserPlexAccountToJSON( + getTokenDetailsUserPlexAccount: GetTokenDetailsUserPlexAccount, +): string { + return JSON.stringify( + GetTokenDetailsUserPlexAccount$outboundSchema.parse( + getTokenDetailsUserPlexAccount, + ), + ); +} + +export function getTokenDetailsUserPlexAccountFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenDetailsUserPlexAccount$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenDetailsUserPlexAccount' from JSON`, + ); +} + /** @internal */ export const GetTokenDetailsResponse$inboundSchema: z.ZodType< GetTokenDetailsResponse, @@ -967,3 +1052,21 @@ export namespace GetTokenDetailsResponse$ { /** @deprecated use `GetTokenDetailsResponse$Outbound` instead. */ export type Outbound = GetTokenDetailsResponse$Outbound; } + +export function getTokenDetailsResponseToJSON( + getTokenDetailsResponse: GetTokenDetailsResponse, +): string { + return JSON.stringify( + GetTokenDetailsResponse$outboundSchema.parse(getTokenDetailsResponse), + ); +} + +export function getTokenDetailsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTokenDetailsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTokenDetailsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gettopwatchedcontent.ts b/src/sdk/models/operations/gettopwatchedcontent.ts index d049d49a..83b5302b 100644 --- a/src/sdk/models/operations/gettopwatchedcontent.ts +++ b/src/sdk/models/operations/gettopwatchedcontent.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The type of media to retrieve. @@ -22,6 +25,8 @@ export enum GetTopWatchedContentQueryParamType { Season = 3, Episode = 4, Audio = 8, + Album = 9, + Track = 10, } export type GetTopWatchedContentRequest = { @@ -204,6 +209,26 @@ export namespace GetTopWatchedContentRequest$ { export type Outbound = GetTopWatchedContentRequest$Outbound; } +export function getTopWatchedContentRequestToJSON( + getTopWatchedContentRequest: GetTopWatchedContentRequest, +): string { + return JSON.stringify( + GetTopWatchedContentRequest$outboundSchema.parse( + getTopWatchedContentRequest, + ), + ); +} + +export function getTopWatchedContentRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentRequest' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentGenre$inboundSchema: z.ZodType< GetTopWatchedContentGenre, @@ -246,6 +271,24 @@ export namespace GetTopWatchedContentGenre$ { export type Outbound = GetTopWatchedContentGenre$Outbound; } +export function getTopWatchedContentGenreToJSON( + getTopWatchedContentGenre: GetTopWatchedContentGenre, +): string { + return JSON.stringify( + GetTopWatchedContentGenre$outboundSchema.parse(getTopWatchedContentGenre), + ); +} + +export function getTopWatchedContentGenreFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentGenre$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentGenre' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentCountry$inboundSchema: z.ZodType< GetTopWatchedContentCountry, @@ -288,6 +331,26 @@ export namespace GetTopWatchedContentCountry$ { export type Outbound = GetTopWatchedContentCountry$Outbound; } +export function getTopWatchedContentCountryToJSON( + getTopWatchedContentCountry: GetTopWatchedContentCountry, +): string { + return JSON.stringify( + GetTopWatchedContentCountry$outboundSchema.parse( + getTopWatchedContentCountry, + ), + ); +} + +export function getTopWatchedContentCountryFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentCountry$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentCountry' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentGuids$inboundSchema: z.ZodType< GetTopWatchedContentGuids, @@ -324,6 +387,24 @@ export namespace GetTopWatchedContentGuids$ { export type Outbound = GetTopWatchedContentGuids$Outbound; } +export function getTopWatchedContentGuidsToJSON( + getTopWatchedContentGuids: GetTopWatchedContentGuids, +): string { + return JSON.stringify( + GetTopWatchedContentGuids$outboundSchema.parse(getTopWatchedContentGuids), + ); +} + +export function getTopWatchedContentGuidsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentGuids$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentGuids' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentRole$inboundSchema: z.ZodType< GetTopWatchedContentRole, @@ -375,6 +456,24 @@ export namespace GetTopWatchedContentRole$ { export type Outbound = GetTopWatchedContentRole$Outbound; } +export function getTopWatchedContentRoleToJSON( + getTopWatchedContentRole: GetTopWatchedContentRole, +): string { + return JSON.stringify( + GetTopWatchedContentRole$outboundSchema.parse(getTopWatchedContentRole), + ); +} + +export function getTopWatchedContentRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentRole' from JSON`, + ); +} + /** @internal */ export const User$inboundSchema: z.ZodType = z .object({ @@ -405,6 +504,20 @@ export namespace User$ { export type Outbound = User$Outbound; } +export function userToJSON(user: User): string { + return JSON.stringify(User$outboundSchema.parse(user)); +} + +export function userFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => User$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'User' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentMetadata$inboundSchema: z.ZodType< GetTopWatchedContentMetadata, @@ -559,6 +672,26 @@ export namespace GetTopWatchedContentMetadata$ { export type Outbound = GetTopWatchedContentMetadata$Outbound; } +export function getTopWatchedContentMetadataToJSON( + getTopWatchedContentMetadata: GetTopWatchedContentMetadata, +): string { + return JSON.stringify( + GetTopWatchedContentMetadata$outboundSchema.parse( + getTopWatchedContentMetadata, + ), + ); +} + +export function getTopWatchedContentMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentMetadata' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentMediaContainer$inboundSchema: z.ZodType< GetTopWatchedContentMediaContainer, @@ -621,6 +754,27 @@ export namespace GetTopWatchedContentMediaContainer$ { export type Outbound = GetTopWatchedContentMediaContainer$Outbound; } +export function getTopWatchedContentMediaContainerToJSON( + getTopWatchedContentMediaContainer: GetTopWatchedContentMediaContainer, +): string { + return JSON.stringify( + GetTopWatchedContentMediaContainer$outboundSchema.parse( + getTopWatchedContentMediaContainer, + ), + ); +} + +export function getTopWatchedContentMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetTopWatchedContentMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentResponseBody$inboundSchema: z.ZodType< GetTopWatchedContentResponseBody, @@ -668,6 +822,26 @@ export namespace GetTopWatchedContentResponseBody$ { export type Outbound = GetTopWatchedContentResponseBody$Outbound; } +export function getTopWatchedContentResponseBodyToJSON( + getTopWatchedContentResponseBody: GetTopWatchedContentResponseBody, +): string { + return JSON.stringify( + GetTopWatchedContentResponseBody$outboundSchema.parse( + getTopWatchedContentResponseBody, + ), + ); +} + +export function getTopWatchedContentResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentResponseBody' from JSON`, + ); +} + /** @internal */ export const GetTopWatchedContentResponse$inboundSchema: z.ZodType< GetTopWatchedContentResponse, @@ -728,3 +902,23 @@ export namespace GetTopWatchedContentResponse$ { /** @deprecated use `GetTopWatchedContentResponse$Outbound` instead. */ export type Outbound = GetTopWatchedContentResponse$Outbound; } + +export function getTopWatchedContentResponseToJSON( + getTopWatchedContentResponse: GetTopWatchedContentResponse, +): string { + return JSON.stringify( + GetTopWatchedContentResponse$outboundSchema.parse( + getTopWatchedContentResponse, + ), + ); +} + +export function getTopWatchedContentResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTopWatchedContentResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTopWatchedContentResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gettranscodesessions.ts b/src/sdk/models/operations/gettranscodesessions.ts index 99cce9d5..c06cfeec 100644 --- a/src/sdk/models/operations/gettranscodesessions.ts +++ b/src/sdk/models/operations/gettranscodesessions.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type TranscodeSession = { key?: string | undefined; @@ -168,6 +171,24 @@ export namespace TranscodeSession$ { export type Outbound = TranscodeSession$Outbound; } +export function transcodeSessionToJSON( + transcodeSession: TranscodeSession, +): string { + return JSON.stringify( + TranscodeSession$outboundSchema.parse(transcodeSession), + ); +} + +export function transcodeSessionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => TranscodeSession$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TranscodeSession' from JSON`, + ); +} + /** @internal */ export const GetTranscodeSessionsMediaContainer$inboundSchema: z.ZodType< GetTranscodeSessionsMediaContainer, @@ -218,6 +239,27 @@ export namespace GetTranscodeSessionsMediaContainer$ { export type Outbound = GetTranscodeSessionsMediaContainer$Outbound; } +export function getTranscodeSessionsMediaContainerToJSON( + getTranscodeSessionsMediaContainer: GetTranscodeSessionsMediaContainer, +): string { + return JSON.stringify( + GetTranscodeSessionsMediaContainer$outboundSchema.parse( + getTranscodeSessionsMediaContainer, + ), + ); +} + +export function getTranscodeSessionsMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + GetTranscodeSessionsMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTranscodeSessionsMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetTranscodeSessionsResponseBody$inboundSchema: z.ZodType< GetTranscodeSessionsResponseBody, @@ -265,6 +307,26 @@ export namespace GetTranscodeSessionsResponseBody$ { export type Outbound = GetTranscodeSessionsResponseBody$Outbound; } +export function getTranscodeSessionsResponseBodyToJSON( + getTranscodeSessionsResponseBody: GetTranscodeSessionsResponseBody, +): string { + return JSON.stringify( + GetTranscodeSessionsResponseBody$outboundSchema.parse( + getTranscodeSessionsResponseBody, + ), + ); +} + +export function getTranscodeSessionsResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTranscodeSessionsResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTranscodeSessionsResponseBody' from JSON`, + ); +} + /** @internal */ export const GetTranscodeSessionsResponse$inboundSchema: z.ZodType< GetTranscodeSessionsResponse, @@ -325,3 +387,23 @@ export namespace GetTranscodeSessionsResponse$ { /** @deprecated use `GetTranscodeSessionsResponse$Outbound` instead. */ export type Outbound = GetTranscodeSessionsResponse$Outbound; } + +export function getTranscodeSessionsResponseToJSON( + getTranscodeSessionsResponse: GetTranscodeSessionsResponse, +): string { + return JSON.stringify( + GetTranscodeSessionsResponse$outboundSchema.parse( + getTranscodeSessionsResponse, + ), + ); +} + +export function getTranscodeSessionsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTranscodeSessionsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTranscodeSessionsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/gettransienttoken.ts b/src/sdk/models/operations/gettransienttoken.ts index 6ed3d57c..dc5820bb 100644 --- a/src/sdk/models/operations/gettransienttoken.ts +++ b/src/sdk/models/operations/gettransienttoken.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * `delegation` - This is the only supported `type` parameter. @@ -125,6 +128,24 @@ export namespace GetTransientTokenRequest$ { export type Outbound = GetTransientTokenRequest$Outbound; } +export function getTransientTokenRequestToJSON( + getTransientTokenRequest: GetTransientTokenRequest, +): string { + return JSON.stringify( + GetTransientTokenRequest$outboundSchema.parse(getTransientTokenRequest), + ); +} + +export function getTransientTokenRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTransientTokenRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTransientTokenRequest' from JSON`, + ); +} + /** @internal */ export const GetTransientTokenResponse$inboundSchema: z.ZodType< GetTransientTokenResponse, @@ -180,3 +201,21 @@ export namespace GetTransientTokenResponse$ { /** @deprecated use `GetTransientTokenResponse$Outbound` instead. */ export type Outbound = GetTransientTokenResponse$Outbound; } + +export function getTransientTokenResponseToJSON( + getTransientTokenResponse: GetTransientTokenResponse, +): string { + return JSON.stringify( + GetTransientTokenResponse$outboundSchema.parse(getTransientTokenResponse), + ); +} + +export function getTransientTokenResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetTransientTokenResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetTransientTokenResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getupdatestatus.ts b/src/sdk/models/operations/getupdatestatus.ts index e121e0a0..4a4706ad 100644 --- a/src/sdk/models/operations/getupdatestatus.ts +++ b/src/sdk/models/operations/getupdatestatus.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Release = { key?: string | undefined; @@ -97,6 +100,20 @@ export namespace Release$ { export type Outbound = Release$Outbound; } +export function releaseToJSON(release: Release): string { + return JSON.stringify(Release$outboundSchema.parse(release)); +} + +export function releaseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Release$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Release' from JSON`, + ); +} + /** @internal */ export const GetUpdateStatusMediaContainer$inboundSchema: z.ZodType< GetUpdateStatusMediaContainer, @@ -156,6 +173,26 @@ export namespace GetUpdateStatusMediaContainer$ { export type Outbound = GetUpdateStatusMediaContainer$Outbound; } +export function getUpdateStatusMediaContainerToJSON( + getUpdateStatusMediaContainer: GetUpdateStatusMediaContainer, +): string { + return JSON.stringify( + GetUpdateStatusMediaContainer$outboundSchema.parse( + getUpdateStatusMediaContainer, + ), + ); +} + +export function getUpdateStatusMediaContainerFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUpdateStatusMediaContainer$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUpdateStatusMediaContainer' from JSON`, + ); +} + /** @internal */ export const GetUpdateStatusResponseBody$inboundSchema: z.ZodType< GetUpdateStatusResponseBody, @@ -202,6 +239,26 @@ export namespace GetUpdateStatusResponseBody$ { export type Outbound = GetUpdateStatusResponseBody$Outbound; } +export function getUpdateStatusResponseBodyToJSON( + getUpdateStatusResponseBody: GetUpdateStatusResponseBody, +): string { + return JSON.stringify( + GetUpdateStatusResponseBody$outboundSchema.parse( + getUpdateStatusResponseBody, + ), + ); +} + +export function getUpdateStatusResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUpdateStatusResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUpdateStatusResponseBody' from JSON`, + ); +} + /** @internal */ export const GetUpdateStatusResponse$inboundSchema: z.ZodType< GetUpdateStatusResponse, @@ -260,3 +317,21 @@ export namespace GetUpdateStatusResponse$ { /** @deprecated use `GetUpdateStatusResponse$Outbound` instead. */ export type Outbound = GetUpdateStatusResponse$Outbound; } + +export function getUpdateStatusResponseToJSON( + getUpdateStatusResponse: GetUpdateStatusResponse, +): string { + return JSON.stringify( + GetUpdateStatusResponse$outboundSchema.parse(getUpdateStatusResponse), + ); +} + +export function getUpdateStatusResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUpdateStatusResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUpdateStatusResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getuserfriends.ts b/src/sdk/models/operations/getuserfriends.ts index 0a7ee301..fd99b5d3 100644 --- a/src/sdk/models/operations/getuserfriends.ts +++ b/src/sdk/models/operations/getuserfriends.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetUserFriendsServerList = [ "https://plex.tv/api/v2", @@ -114,6 +117,20 @@ export namespace SharedServers$ { export type Outbound = SharedServers$Outbound; } +export function sharedServersToJSON(sharedServers: SharedServers): string { + return JSON.stringify(SharedServers$outboundSchema.parse(sharedServers)); +} + +export function sharedServersFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SharedServers$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SharedServers' from JSON`, + ); +} + /** @internal */ export const SharedSources$inboundSchema: z.ZodType< SharedSources, @@ -144,6 +161,20 @@ export namespace SharedSources$ { export type Outbound = SharedSources$Outbound; } +export function sharedSourcesToJSON(sharedSources: SharedSources): string { + return JSON.stringify(SharedSources$outboundSchema.parse(sharedSources)); +} + +export function sharedSourcesFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SharedSources$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SharedSources' from JSON`, + ); +} + /** @internal */ export const Status$inboundSchema: z.ZodNativeEnum = z .nativeEnum(Status); @@ -229,6 +260,20 @@ export namespace Friend$ { export type Outbound = Friend$Outbound; } +export function friendToJSON(friend: Friend): string { + return JSON.stringify(Friend$outboundSchema.parse(friend)); +} + +export function friendFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Friend$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Friend' from JSON`, + ); +} + /** @internal */ export const GetUserFriendsResponse$inboundSchema: z.ZodType< GetUserFriendsResponse, @@ -289,3 +334,21 @@ export namespace GetUserFriendsResponse$ { /** @deprecated use `GetUserFriendsResponse$Outbound` instead. */ export type Outbound = GetUserFriendsResponse$Outbound; } + +export function getUserFriendsResponseToJSON( + getUserFriendsResponse: GetUserFriendsResponse, +): string { + return JSON.stringify( + GetUserFriendsResponse$outboundSchema.parse(getUserFriendsResponse), + ); +} + +export function getUserFriendsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetUserFriendsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetUserFriendsResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/getwatchlist.ts b/src/sdk/models/operations/getwatchlist.ts index 0eaffa4a..ac129ae7 100644 --- a/src/sdk/models/operations/getwatchlist.ts +++ b/src/sdk/models/operations/getwatchlist.ts @@ -4,7 +4,10 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; import { RFCDate } from "../../types/rfcdate.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const GetWatchListServerList = [ /** @@ -340,6 +343,24 @@ export namespace GetWatchListRequest$ { export type Outbound = GetWatchListRequest$Outbound; } +export function getWatchListRequestToJSON( + getWatchListRequest: GetWatchListRequest, +): string { + return JSON.stringify( + GetWatchListRequest$outboundSchema.parse(getWatchListRequest), + ); +} + +export function getWatchListRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWatchListRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWatchListRequest' from JSON`, + ); +} + /** @internal */ export const Image$inboundSchema: z.ZodType = z .object({ @@ -379,6 +400,20 @@ export namespace Image$ { export type Outbound = Image$Outbound; } +export function imageToJSON(image: Image): string { + return JSON.stringify(Image$outboundSchema.parse(image)); +} + +export function imageFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Image$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Image' from JSON`, + ); +} + /** @internal */ export const Metadata$inboundSchema: z.ZodType< Metadata, @@ -526,6 +561,20 @@ export namespace Metadata$ { export type Outbound = Metadata$Outbound; } +export function metadataToJSON(metadata: Metadata): string { + return JSON.stringify(Metadata$outboundSchema.parse(metadata)); +} + +export function metadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Metadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Metadata' from JSON`, + ); +} + /** @internal */ export const GetWatchListResponseBody$inboundSchema: z.ZodType< GetWatchListResponseBody, @@ -588,6 +637,24 @@ export namespace GetWatchListResponseBody$ { export type Outbound = GetWatchListResponseBody$Outbound; } +export function getWatchListResponseBodyToJSON( + getWatchListResponseBody: GetWatchListResponseBody, +): string { + return JSON.stringify( + GetWatchListResponseBody$outboundSchema.parse(getWatchListResponseBody), + ); +} + +export function getWatchListResponseBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWatchListResponseBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWatchListResponseBody' from JSON`, + ); +} + /** @internal */ export const GetWatchListResponse$inboundSchema: z.ZodType< GetWatchListResponse, @@ -646,3 +713,21 @@ export namespace GetWatchListResponse$ { /** @deprecated use `GetWatchListResponse$Outbound` instead. */ export type Outbound = GetWatchListResponse$Outbound; } + +export function getWatchListResponseToJSON( + getWatchListResponse: GetWatchListResponse, +): string { + return JSON.stringify( + GetWatchListResponse$outboundSchema.parse(getWatchListResponse), + ); +} + +export function getWatchListResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetWatchListResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetWatchListResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/logline.ts b/src/sdk/models/operations/logline.ts index c84fe09d..c3aa8638 100644 --- a/src/sdk/models/operations/logline.ts +++ b/src/sdk/models/operations/logline.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * An integer log level to write to the PMS log with. @@ -122,6 +125,20 @@ export namespace LogLineRequest$ { export type Outbound = LogLineRequest$Outbound; } +export function logLineRequestToJSON(logLineRequest: LogLineRequest): string { + return JSON.stringify(LogLineRequest$outboundSchema.parse(logLineRequest)); +} + +export function logLineRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogLineRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogLineRequest' from JSON`, + ); +} + /** @internal */ export const LogLineResponse$inboundSchema: z.ZodType< LogLineResponse, @@ -177,3 +194,19 @@ export namespace LogLineResponse$ { /** @deprecated use `LogLineResponse$Outbound` instead. */ export type Outbound = LogLineResponse$Outbound; } + +export function logLineResponseToJSON( + logLineResponse: LogLineResponse, +): string { + return JSON.stringify(LogLineResponse$outboundSchema.parse(logLineResponse)); +} + +export function logLineResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogLineResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogLineResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/logmultiline.ts b/src/sdk/models/operations/logmultiline.ts index c6c7ba2e..5b43de65 100644 --- a/src/sdk/models/operations/logmultiline.ts +++ b/src/sdk/models/operations/logmultiline.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type LogMultiLineResponse = { /** @@ -75,3 +78,21 @@ export namespace LogMultiLineResponse$ { /** @deprecated use `LogMultiLineResponse$Outbound` instead. */ export type Outbound = LogMultiLineResponse$Outbound; } + +export function logMultiLineResponseToJSON( + logMultiLineResponse: LogMultiLineResponse, +): string { + return JSON.stringify( + LogMultiLineResponse$outboundSchema.parse(logMultiLineResponse), + ); +} + +export function logMultiLineResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => LogMultiLineResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'LogMultiLineResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/markplayed.ts b/src/sdk/models/operations/markplayed.ts index 579f14aa..8e2addab 100644 --- a/src/sdk/models/operations/markplayed.ts +++ b/src/sdk/models/operations/markplayed.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type MarkPlayedRequest = { /** @@ -63,6 +66,24 @@ export namespace MarkPlayedRequest$ { export type Outbound = MarkPlayedRequest$Outbound; } +export function markPlayedRequestToJSON( + markPlayedRequest: MarkPlayedRequest, +): string { + return JSON.stringify( + MarkPlayedRequest$outboundSchema.parse(markPlayedRequest), + ); +} + +export function markPlayedRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkPlayedRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkPlayedRequest' from JSON`, + ); +} + /** @internal */ export const MarkPlayedResponse$inboundSchema: z.ZodType< MarkPlayedResponse, @@ -118,3 +139,21 @@ export namespace MarkPlayedResponse$ { /** @deprecated use `MarkPlayedResponse$Outbound` instead. */ export type Outbound = MarkPlayedResponse$Outbound; } + +export function markPlayedResponseToJSON( + markPlayedResponse: MarkPlayedResponse, +): string { + return JSON.stringify( + MarkPlayedResponse$outboundSchema.parse(markPlayedResponse), + ); +} + +export function markPlayedResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkPlayedResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkPlayedResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/markunplayed.ts b/src/sdk/models/operations/markunplayed.ts index 11ffe354..9cba7c0e 100644 --- a/src/sdk/models/operations/markunplayed.ts +++ b/src/sdk/models/operations/markunplayed.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type MarkUnplayedRequest = { /** @@ -63,6 +66,24 @@ export namespace MarkUnplayedRequest$ { export type Outbound = MarkUnplayedRequest$Outbound; } +export function markUnplayedRequestToJSON( + markUnplayedRequest: MarkUnplayedRequest, +): string { + return JSON.stringify( + MarkUnplayedRequest$outboundSchema.parse(markUnplayedRequest), + ); +} + +export function markUnplayedRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkUnplayedRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkUnplayedRequest' from JSON`, + ); +} + /** @internal */ export const MarkUnplayedResponse$inboundSchema: z.ZodType< MarkUnplayedResponse, @@ -118,3 +139,21 @@ export namespace MarkUnplayedResponse$ { /** @deprecated use `MarkUnplayedResponse$Outbound` instead. */ export type Outbound = MarkUnplayedResponse$Outbound; } + +export function markUnplayedResponseToJSON( + markUnplayedResponse: MarkUnplayedResponse, +): string { + return JSON.stringify( + MarkUnplayedResponse$outboundSchema.parse(markUnplayedResponse), + ); +} + +export function markUnplayedResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => MarkUnplayedResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkUnplayedResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/performsearch.ts b/src/sdk/models/operations/performsearch.ts index 37f4899e..e7646a35 100644 --- a/src/sdk/models/operations/performsearch.ts +++ b/src/sdk/models/operations/performsearch.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PerformSearchRequest = { /** @@ -77,6 +80,24 @@ export namespace PerformSearchRequest$ { export type Outbound = PerformSearchRequest$Outbound; } +export function performSearchRequestToJSON( + performSearchRequest: PerformSearchRequest, +): string { + return JSON.stringify( + PerformSearchRequest$outboundSchema.parse(performSearchRequest), + ); +} + +export function performSearchRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformSearchRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformSearchRequest' from JSON`, + ); +} + /** @internal */ export const PerformSearchResponse$inboundSchema: z.ZodType< PerformSearchResponse, @@ -132,3 +153,21 @@ export namespace PerformSearchResponse$ { /** @deprecated use `PerformSearchResponse$Outbound` instead. */ export type Outbound = PerformSearchResponse$Outbound; } + +export function performSearchResponseToJSON( + performSearchResponse: PerformSearchResponse, +): string { + return JSON.stringify( + PerformSearchResponse$outboundSchema.parse(performSearchResponse), + ); +} + +export function performSearchResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformSearchResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformSearchResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/performvoicesearch.ts b/src/sdk/models/operations/performvoicesearch.ts index 745742bc..394a4400 100644 --- a/src/sdk/models/operations/performvoicesearch.ts +++ b/src/sdk/models/operations/performvoicesearch.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type PerformVoiceSearchRequest = { /** @@ -77,6 +80,24 @@ export namespace PerformVoiceSearchRequest$ { export type Outbound = PerformVoiceSearchRequest$Outbound; } +export function performVoiceSearchRequestToJSON( + performVoiceSearchRequest: PerformVoiceSearchRequest, +): string { + return JSON.stringify( + PerformVoiceSearchRequest$outboundSchema.parse(performVoiceSearchRequest), + ); +} + +export function performVoiceSearchRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformVoiceSearchRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformVoiceSearchRequest' from JSON`, + ); +} + /** @internal */ export const PerformVoiceSearchResponse$inboundSchema: z.ZodType< PerformVoiceSearchResponse, @@ -132,3 +153,21 @@ export namespace PerformVoiceSearchResponse$ { /** @deprecated use `PerformVoiceSearchResponse$Outbound` instead. */ export type Outbound = PerformVoiceSearchResponse$Outbound; } + +export function performVoiceSearchResponseToJSON( + performVoiceSearchResponse: PerformVoiceSearchResponse, +): string { + return JSON.stringify( + PerformVoiceSearchResponse$outboundSchema.parse(performVoiceSearchResponse), + ); +} + +export function performVoiceSearchResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PerformVoiceSearchResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PerformVoiceSearchResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/postuserssignindata.ts b/src/sdk/models/operations/postuserssignindata.ts index 38ec8b3f..a5c066ae 100644 --- a/src/sdk/models/operations/postuserssignindata.ts +++ b/src/sdk/models/operations/postuserssignindata.ts @@ -4,34 +4,14 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const PostUsersSignInDataServerList = [ "https://plex.tv/api/v2", ] as const; -export type PostUsersSignInDataGlobals = { - /** - * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) - */ - clientID?: string | undefined; - /** - * The name of the client application. (Plex Web, Plex Media Server, etc.) - */ - clientName?: string | undefined; - /** - * A relatively friendly name for the client device - */ - deviceNickname?: string | undefined; - /** - * The version of the client application. - */ - clientVersion?: string | undefined; - /** - * The platform of the client application. - */ - platform?: string | undefined; -}; - /** * Login credentials */ @@ -46,7 +26,7 @@ export type PostUsersSignInDataRequest = { /** * An opaque identifier unique to the client (UUID, serial number, or other unique device ID) */ - clientID?: string | undefined; + clientID: string; /** * The name of the client application. (Plex Web, Plex Media Server, etc.) */ @@ -433,70 +413,6 @@ export type PostUsersSignInDataResponse = { userPlexAccount?: PostUsersSignInDataUserPlexAccount | undefined; }; -/** @internal */ -export const PostUsersSignInDataGlobals$inboundSchema: z.ZodType< - PostUsersSignInDataGlobals, - z.ZodTypeDef, - unknown -> = z.object({ - ClientID: z.string().optional(), - ClientName: z.string().optional(), - DeviceNickname: z.string().optional(), - ClientVersion: z.string().optional(), - Platform: z.string().optional(), -}).transform((v) => { - return remap$(v, { - "ClientID": "clientID", - "ClientName": "clientName", - "DeviceNickname": "deviceNickname", - "ClientVersion": "clientVersion", - "Platform": "platform", - }); -}); - -/** @internal */ -export type PostUsersSignInDataGlobals$Outbound = { - ClientID?: string | undefined; - ClientName?: string | undefined; - DeviceNickname?: string | undefined; - ClientVersion?: string | undefined; - Platform?: string | undefined; -}; - -/** @internal */ -export const PostUsersSignInDataGlobals$outboundSchema: z.ZodType< - PostUsersSignInDataGlobals$Outbound, - z.ZodTypeDef, - PostUsersSignInDataGlobals -> = z.object({ - clientID: z.string().optional(), - clientName: z.string().optional(), - deviceNickname: z.string().optional(), - clientVersion: z.string().optional(), - platform: z.string().optional(), -}).transform((v) => { - return remap$(v, { - clientID: "ClientID", - clientName: "ClientName", - deviceNickname: "DeviceNickname", - clientVersion: "ClientVersion", - platform: "Platform", - }); -}); - -/** - * @internal - * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. - */ -export namespace PostUsersSignInDataGlobals$ { - /** @deprecated use `PostUsersSignInDataGlobals$inboundSchema` instead. */ - export const inboundSchema = PostUsersSignInDataGlobals$inboundSchema; - /** @deprecated use `PostUsersSignInDataGlobals$outboundSchema` instead. */ - export const outboundSchema = PostUsersSignInDataGlobals$outboundSchema; - /** @deprecated use `PostUsersSignInDataGlobals$Outbound` instead. */ - export type Outbound = PostUsersSignInDataGlobals$Outbound; -} - /** @internal */ export const PostUsersSignInDataRequestBody$inboundSchema: z.ZodType< PostUsersSignInDataRequestBody, @@ -542,13 +458,33 @@ export namespace PostUsersSignInDataRequestBody$ { export type Outbound = PostUsersSignInDataRequestBody$Outbound; } +export function postUsersSignInDataRequestBodyToJSON( + postUsersSignInDataRequestBody: PostUsersSignInDataRequestBody, +): string { + return JSON.stringify( + PostUsersSignInDataRequestBody$outboundSchema.parse( + postUsersSignInDataRequestBody, + ), + ); +} + +export function postUsersSignInDataRequestBodyFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataRequestBody$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataRequestBody' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataRequest$inboundSchema: z.ZodType< PostUsersSignInDataRequest, z.ZodTypeDef, unknown > = z.object({ - ClientID: z.string().optional(), + ClientID: z.string(), ClientName: z.string().optional(), DeviceNickname: z.string().optional(), ClientVersion: z.string().optional(), @@ -568,7 +504,7 @@ export const PostUsersSignInDataRequest$inboundSchema: z.ZodType< /** @internal */ export type PostUsersSignInDataRequest$Outbound = { - ClientID?: string | undefined; + ClientID: string; ClientName?: string | undefined; DeviceNickname?: string | undefined; ClientVersion?: string | undefined; @@ -582,7 +518,7 @@ export const PostUsersSignInDataRequest$outboundSchema: z.ZodType< z.ZodTypeDef, PostUsersSignInDataRequest > = z.object({ - clientID: z.string().optional(), + clientID: z.string(), clientName: z.string().optional(), deviceNickname: z.string().optional(), clientVersion: z.string().optional(), @@ -613,6 +549,24 @@ export namespace PostUsersSignInDataRequest$ { export type Outbound = PostUsersSignInDataRequest$Outbound; } +export function postUsersSignInDataRequestToJSON( + postUsersSignInDataRequest: PostUsersSignInDataRequest, +): string { + return JSON.stringify( + PostUsersSignInDataRequest$outboundSchema.parse(postUsersSignInDataRequest), + ); +} + +export function postUsersSignInDataRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataRequest' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataMailingListStatus$inboundSchema: z.ZodNativeEnum = z.nativeEnum( @@ -822,6 +776,26 @@ export namespace PostUsersSignInDataUserProfile$ { export type Outbound = PostUsersSignInDataUserProfile$Outbound; } +export function postUsersSignInDataUserProfileToJSON( + postUsersSignInDataUserProfile: PostUsersSignInDataUserProfile, +): string { + return JSON.stringify( + PostUsersSignInDataUserProfile$outboundSchema.parse( + postUsersSignInDataUserProfile, + ), + ); +} + +export function postUsersSignInDataUserProfileFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataUserProfile$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataUserProfile' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataStatus$inboundSchema: z.ZodNativeEnum< typeof PostUsersSignInDataStatus @@ -891,6 +865,26 @@ export namespace PostUsersSignInDataServices$ { export type Outbound = PostUsersSignInDataServices$Outbound; } +export function postUsersSignInDataServicesToJSON( + postUsersSignInDataServices: PostUsersSignInDataServices, +): string { + return JSON.stringify( + PostUsersSignInDataServices$outboundSchema.parse( + postUsersSignInDataServices, + ), + ); +} + +export function postUsersSignInDataServicesFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataServices$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataServices' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataAuthenticationStatus$inboundSchema: z.ZodNativeEnum = z @@ -965,6 +959,26 @@ export namespace PostUsersSignInDataSubscription$ { export type Outbound = PostUsersSignInDataSubscription$Outbound; } +export function postUsersSignInDataSubscriptionToJSON( + postUsersSignInDataSubscription: PostUsersSignInDataSubscription, +): string { + return JSON.stringify( + PostUsersSignInDataSubscription$outboundSchema.parse( + postUsersSignInDataSubscription, + ), + ); +} + +export function postUsersSignInDataSubscriptionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataSubscription$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataSubscription' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataAuthenticationResponseStatus$inboundSchema: z.ZodNativeEnum = z @@ -1045,6 +1059,33 @@ export namespace PostUsersSignInDataAuthenticationSubscription$ { export type Outbound = PostUsersSignInDataAuthenticationSubscription$Outbound; } +export function postUsersSignInDataAuthenticationSubscriptionToJSON( + postUsersSignInDataAuthenticationSubscription: + PostUsersSignInDataAuthenticationSubscription, +): string { + return JSON.stringify( + PostUsersSignInDataAuthenticationSubscription$outboundSchema.parse( + postUsersSignInDataAuthenticationSubscription, + ), + ); +} + +export function postUsersSignInDataAuthenticationSubscriptionFromJSON( + jsonString: string, +): SafeParseResult< + PostUsersSignInDataAuthenticationSubscription, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + PostUsersSignInDataAuthenticationSubscription$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'PostUsersSignInDataAuthenticationSubscription' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataState$inboundSchema: z.ZodNativeEnum< typeof PostUsersSignInDataState @@ -1096,6 +1137,24 @@ export namespace InternalPaymentMethod$ { export type Outbound = InternalPaymentMethod$Outbound; } +export function internalPaymentMethodToJSON( + internalPaymentMethod: InternalPaymentMethod, +): string { + return JSON.stringify( + InternalPaymentMethod$outboundSchema.parse(internalPaymentMethod), + ); +} + +export function internalPaymentMethodFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => InternalPaymentMethod$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'InternalPaymentMethod' from JSON`, + ); +} + /** @internal */ export const Billing$inboundSchema: z.ZodType = z.object({ @@ -1132,6 +1191,20 @@ export namespace Billing$ { export type Outbound = Billing$Outbound; } +export function billingToJSON(billing: Billing): string { + return JSON.stringify(Billing$outboundSchema.parse(billing)); +} + +export function billingFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Billing$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Billing' from JSON`, + ); +} + /** @internal */ export const PastSubscription$inboundSchema: z.ZodType< PastSubscription, @@ -1210,6 +1283,24 @@ export namespace PastSubscription$ { export type Outbound = PastSubscription$Outbound; } +export function pastSubscriptionToJSON( + pastSubscription: PastSubscription, +): string { + return JSON.stringify( + PastSubscription$outboundSchema.parse(pastSubscription), + ); +} + +export function pastSubscriptionFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PastSubscription$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PastSubscription' from JSON`, + ); +} + /** @internal */ export const Trials$inboundSchema: z.ZodType = z .object({}); @@ -1237,6 +1328,20 @@ export namespace Trials$ { export type Outbound = Trials$Outbound; } +export function trialsToJSON(trials: Trials): string { + return JSON.stringify(Trials$outboundSchema.parse(trials)); +} + +export function trialsFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Trials$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Trials' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataUserPlexAccount$inboundSchema: z.ZodType< PostUsersSignInDataUserPlexAccount, @@ -1404,6 +1509,27 @@ export namespace PostUsersSignInDataUserPlexAccount$ { export type Outbound = PostUsersSignInDataUserPlexAccount$Outbound; } +export function postUsersSignInDataUserPlexAccountToJSON( + postUsersSignInDataUserPlexAccount: PostUsersSignInDataUserPlexAccount, +): string { + return JSON.stringify( + PostUsersSignInDataUserPlexAccount$outboundSchema.parse( + postUsersSignInDataUserPlexAccount, + ), + ); +} + +export function postUsersSignInDataUserPlexAccountFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + PostUsersSignInDataUserPlexAccount$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataUserPlexAccount' from JSON`, + ); +} + /** @internal */ export const PostUsersSignInDataResponse$inboundSchema: z.ZodType< PostUsersSignInDataResponse, @@ -1468,3 +1594,23 @@ export namespace PostUsersSignInDataResponse$ { /** @deprecated use `PostUsersSignInDataResponse$Outbound` instead. */ export type Outbound = PostUsersSignInDataResponse$Outbound; } + +export function postUsersSignInDataResponseToJSON( + postUsersSignInDataResponse: PostUsersSignInDataResponse, +): string { + return JSON.stringify( + PostUsersSignInDataResponse$outboundSchema.parse( + postUsersSignInDataResponse, + ), + ); +} + +export function postUsersSignInDataResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostUsersSignInDataResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostUsersSignInDataResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/startalltasks.ts b/src/sdk/models/operations/startalltasks.ts index 2e22a5db..7c1176f2 100644 --- a/src/sdk/models/operations/startalltasks.ts +++ b/src/sdk/models/operations/startalltasks.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type StartAllTasksResponse = { /** @@ -75,3 +78,21 @@ export namespace StartAllTasksResponse$ { /** @deprecated use `StartAllTasksResponse$Outbound` instead. */ export type Outbound = StartAllTasksResponse$Outbound; } + +export function startAllTasksResponseToJSON( + startAllTasksResponse: StartAllTasksResponse, +): string { + return JSON.stringify( + StartAllTasksResponse$outboundSchema.parse(startAllTasksResponse), + ); +} + +export function startAllTasksResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartAllTasksResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartAllTasksResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/starttask.ts b/src/sdk/models/operations/starttask.ts index 117d0a6e..6b7ad6bf 100644 --- a/src/sdk/models/operations/starttask.ts +++ b/src/sdk/models/operations/starttask.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * the name of the task to be started. @@ -102,6 +105,24 @@ export namespace StartTaskRequest$ { export type Outbound = StartTaskRequest$Outbound; } +export function startTaskRequestToJSON( + startTaskRequest: StartTaskRequest, +): string { + return JSON.stringify( + StartTaskRequest$outboundSchema.parse(startTaskRequest), + ); +} + +export function startTaskRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartTaskRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartTaskRequest' from JSON`, + ); +} + /** @internal */ export const StartTaskResponse$inboundSchema: z.ZodType< StartTaskResponse, @@ -157,3 +178,21 @@ export namespace StartTaskResponse$ { /** @deprecated use `StartTaskResponse$Outbound` instead. */ export type Outbound = StartTaskResponse$Outbound; } + +export function startTaskResponseToJSON( + startTaskResponse: StartTaskResponse, +): string { + return JSON.stringify( + StartTaskResponse$outboundSchema.parse(startTaskResponse), + ); +} + +export function startTaskResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartTaskResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartTaskResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/startuniversaltranscode.ts b/src/sdk/models/operations/startuniversaltranscode.ts index 9695555b..24a7d2f7 100644 --- a/src/sdk/models/operations/startuniversaltranscode.ts +++ b/src/sdk/models/operations/startuniversaltranscode.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type StartUniversalTranscodeRequest = { /** @@ -168,6 +171,26 @@ export namespace StartUniversalTranscodeRequest$ { export type Outbound = StartUniversalTranscodeRequest$Outbound; } +export function startUniversalTranscodeRequestToJSON( + startUniversalTranscodeRequest: StartUniversalTranscodeRequest, +): string { + return JSON.stringify( + StartUniversalTranscodeRequest$outboundSchema.parse( + startUniversalTranscodeRequest, + ), + ); +} + +export function startUniversalTranscodeRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartUniversalTranscodeRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartUniversalTranscodeRequest' from JSON`, + ); +} + /** @internal */ export const StartUniversalTranscodeResponse$inboundSchema: z.ZodType< StartUniversalTranscodeResponse, @@ -223,3 +246,23 @@ export namespace StartUniversalTranscodeResponse$ { /** @deprecated use `StartUniversalTranscodeResponse$Outbound` instead. */ export type Outbound = StartUniversalTranscodeResponse$Outbound; } + +export function startUniversalTranscodeResponseToJSON( + startUniversalTranscodeResponse: StartUniversalTranscodeResponse, +): string { + return JSON.stringify( + StartUniversalTranscodeResponse$outboundSchema.parse( + startUniversalTranscodeResponse, + ), + ); +} + +export function startUniversalTranscodeResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StartUniversalTranscodeResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StartUniversalTranscodeResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/stopalltasks.ts b/src/sdk/models/operations/stopalltasks.ts index ae87f9ba..1af53474 100644 --- a/src/sdk/models/operations/stopalltasks.ts +++ b/src/sdk/models/operations/stopalltasks.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type StopAllTasksResponse = { /** @@ -75,3 +78,21 @@ export namespace StopAllTasksResponse$ { /** @deprecated use `StopAllTasksResponse$Outbound` instead. */ export type Outbound = StopAllTasksResponse$Outbound; } + +export function stopAllTasksResponseToJSON( + stopAllTasksResponse: StopAllTasksResponse, +): string { + return JSON.stringify( + StopAllTasksResponse$outboundSchema.parse(stopAllTasksResponse), + ); +} + +export function stopAllTasksResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopAllTasksResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopAllTasksResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/stoptask.ts b/src/sdk/models/operations/stoptask.ts index 98a9c72d..edf30433 100644 --- a/src/sdk/models/operations/stoptask.ts +++ b/src/sdk/models/operations/stoptask.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The name of the task to be started. @@ -104,6 +107,22 @@ export namespace StopTaskRequest$ { export type Outbound = StopTaskRequest$Outbound; } +export function stopTaskRequestToJSON( + stopTaskRequest: StopTaskRequest, +): string { + return JSON.stringify(StopTaskRequest$outboundSchema.parse(stopTaskRequest)); +} + +export function stopTaskRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTaskRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTaskRequest' from JSON`, + ); +} + /** @internal */ export const StopTaskResponse$inboundSchema: z.ZodType< StopTaskResponse, @@ -159,3 +178,21 @@ export namespace StopTaskResponse$ { /** @deprecated use `StopTaskResponse$Outbound` instead. */ export type Outbound = StopTaskResponse$Outbound; } + +export function stopTaskResponseToJSON( + stopTaskResponse: StopTaskResponse, +): string { + return JSON.stringify( + StopTaskResponse$outboundSchema.parse(stopTaskResponse), + ); +} + +export function stopTaskResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTaskResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTaskResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/stoptranscodesession.ts b/src/sdk/models/operations/stoptranscodesession.ts index 5c48e290..fb5fa573 100644 --- a/src/sdk/models/operations/stoptranscodesession.ts +++ b/src/sdk/models/operations/stoptranscodesession.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type StopTranscodeSessionRequest = { /** @@ -63,6 +66,26 @@ export namespace StopTranscodeSessionRequest$ { export type Outbound = StopTranscodeSessionRequest$Outbound; } +export function stopTranscodeSessionRequestToJSON( + stopTranscodeSessionRequest: StopTranscodeSessionRequest, +): string { + return JSON.stringify( + StopTranscodeSessionRequest$outboundSchema.parse( + stopTranscodeSessionRequest, + ), + ); +} + +export function stopTranscodeSessionRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTranscodeSessionRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTranscodeSessionRequest' from JSON`, + ); +} + /** @internal */ export const StopTranscodeSessionResponse$inboundSchema: z.ZodType< StopTranscodeSessionResponse, @@ -118,3 +141,23 @@ export namespace StopTranscodeSessionResponse$ { /** @deprecated use `StopTranscodeSessionResponse$Outbound` instead. */ export type Outbound = StopTranscodeSessionResponse$Outbound; } + +export function stopTranscodeSessionResponseToJSON( + stopTranscodeSessionResponse: StopTranscodeSessionResponse, +): string { + return JSON.stringify( + StopTranscodeSessionResponse$outboundSchema.parse( + stopTranscodeSessionResponse, + ), + ); +} + +export function stopTranscodeSessionResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => StopTranscodeSessionResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'StopTranscodeSessionResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/updateplaylist.ts b/src/sdk/models/operations/updateplaylist.ts index 443e389b..b345bbc7 100644 --- a/src/sdk/models/operations/updateplaylist.ts +++ b/src/sdk/models/operations/updateplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type UpdatePlaylistRequest = { /** @@ -77,6 +80,24 @@ export namespace UpdatePlaylistRequest$ { export type Outbound = UpdatePlaylistRequest$Outbound; } +export function updatePlaylistRequestToJSON( + updatePlaylistRequest: UpdatePlaylistRequest, +): string { + return JSON.stringify( + UpdatePlaylistRequest$outboundSchema.parse(updatePlaylistRequest), + ); +} + +export function updatePlaylistRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlaylistRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlaylistRequest' from JSON`, + ); +} + /** @internal */ export const UpdatePlaylistResponse$inboundSchema: z.ZodType< UpdatePlaylistResponse, @@ -132,3 +153,21 @@ export namespace UpdatePlaylistResponse$ { /** @deprecated use `UpdatePlaylistResponse$Outbound` instead. */ export type Outbound = UpdatePlaylistResponse$Outbound; } + +export function updatePlaylistResponseToJSON( + updatePlaylistResponse: UpdatePlaylistResponse, +): string { + return JSON.stringify( + UpdatePlaylistResponse$outboundSchema.parse(updatePlaylistResponse), + ); +} + +export function updatePlaylistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlaylistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlaylistResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/updateplayprogress.ts b/src/sdk/models/operations/updateplayprogress.ts index 32ecefcf..bdad69f9 100644 --- a/src/sdk/models/operations/updateplayprogress.ts +++ b/src/sdk/models/operations/updateplayprogress.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type UpdatePlayProgressRequest = { /** @@ -77,6 +80,24 @@ export namespace UpdatePlayProgressRequest$ { export type Outbound = UpdatePlayProgressRequest$Outbound; } +export function updatePlayProgressRequestToJSON( + updatePlayProgressRequest: UpdatePlayProgressRequest, +): string { + return JSON.stringify( + UpdatePlayProgressRequest$outboundSchema.parse(updatePlayProgressRequest), + ); +} + +export function updatePlayProgressRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlayProgressRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlayProgressRequest' from JSON`, + ); +} + /** @internal */ export const UpdatePlayProgressResponse$inboundSchema: z.ZodType< UpdatePlayProgressResponse, @@ -132,3 +153,21 @@ export namespace UpdatePlayProgressResponse$ { /** @deprecated use `UpdatePlayProgressResponse$Outbound` instead. */ export type Outbound = UpdatePlayProgressResponse$Outbound; } + +export function updatePlayProgressResponseToJSON( + updatePlayProgressResponse: UpdatePlayProgressResponse, +): string { + return JSON.stringify( + UpdatePlayProgressResponse$outboundSchema.parse(updatePlayProgressResponse), + ); +} + +export function updatePlayProgressResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdatePlayProgressResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdatePlayProgressResponse' from JSON`, + ); +} diff --git a/src/sdk/models/operations/uploadplaylist.ts b/src/sdk/models/operations/uploadplaylist.ts index b9ac20f9..487a8d95 100644 --- a/src/sdk/models/operations/uploadplaylist.ts +++ b/src/sdk/models/operations/uploadplaylist.ts @@ -4,6 +4,9 @@ import * as z from "zod"; import { remap as remap$ } from "../../../lib/primitives.js"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * Force overwriting of duplicate playlists. @@ -123,6 +126,24 @@ export namespace UploadPlaylistRequest$ { export type Outbound = UploadPlaylistRequest$Outbound; } +export function uploadPlaylistRequestToJSON( + uploadPlaylistRequest: UploadPlaylistRequest, +): string { + return JSON.stringify( + UploadPlaylistRequest$outboundSchema.parse(uploadPlaylistRequest), + ); +} + +export function uploadPlaylistRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UploadPlaylistRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UploadPlaylistRequest' from JSON`, + ); +} + /** @internal */ export const UploadPlaylistResponse$inboundSchema: z.ZodType< UploadPlaylistResponse, @@ -178,3 +199,21 @@ export namespace UploadPlaylistResponse$ { /** @deprecated use `UploadPlaylistResponse$Outbound` instead. */ export type Outbound = UploadPlaylistResponse$Outbound; } + +export function uploadPlaylistResponseToJSON( + uploadPlaylistResponse: UploadPlaylistResponse, +): string { + return JSON.stringify( + UploadPlaylistResponse$outboundSchema.parse(uploadPlaylistResponse), + ); +} + +export function uploadPlaylistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UploadPlaylistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UploadPlaylistResponse' from JSON`, + ); +} diff --git a/src/sdk/models/shared/security.ts b/src/sdk/models/shared/security.ts index df78a3b7..3f31eae2 100644 --- a/src/sdk/models/shared/security.ts +++ b/src/sdk/models/shared/security.ts @@ -3,6 +3,9 @@ */ import * as z from "zod"; +import { safeParse } from "../../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type Security = { accessToken?: string | undefined; @@ -43,3 +46,17 @@ export namespace Security$ { /** @deprecated use `Security$Outbound` instead. */ export type Outbound = Security$Outbound; } + +export function securityToJSON(security: Security): string { + return JSON.stringify(Security$outboundSchema.parse(security)); +} + +export function securityFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Security$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Security' from JSON`, + ); +} diff --git a/src/sdk/plex.ts b/src/sdk/plex.ts index c020538c..8c865d57 100644 --- a/src/sdk/plex.ts +++ b/src/sdk/plex.ts @@ -21,7 +21,7 @@ export class Plex extends ClientSDK { * Get Companions Data */ async getCompanionsData( - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(plexGetCompanionsData( this, @@ -36,7 +36,7 @@ export class Plex extends ClientSDK { * Get friends of provided auth token. */ async getUserFriends( - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(plexGetUserFriends( this, @@ -51,7 +51,7 @@ export class Plex extends ClientSDK { * Returns the geolocation and locale data of the caller */ async getGeoData( - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(plexGetGeoData( this, @@ -81,18 +81,18 @@ export class Plex extends ClientSDK { * Get Plex server access tokens and server connections */ async getServerResources( + clientID: string, includeHttps?: operations.IncludeHttps | undefined, includeRelay?: operations.IncludeRelay | undefined, includeIPv6?: operations.IncludeIPv6 | undefined, - clientID?: string | undefined, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(plexGetServerResources( this, + clientID, includeHttps, includeRelay, includeIPv6, - clientID, options, )); } @@ -105,7 +105,7 @@ export class Plex extends ClientSDK { */ async getPin( request: operations.GetPinRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(plexGetPin( this, @@ -122,7 +122,7 @@ export class Plex extends ClientSDK { */ async getTokenByPinId( request: operations.GetTokenByPinIdRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(plexGetTokenByPinId( this, diff --git a/src/sdk/types/operations.ts b/src/sdk/types/operations.ts index 0952f6f4..beb81e10 100644 --- a/src/sdk/types/operations.ts +++ b/src/sdk/types/operations.ts @@ -6,9 +6,10 @@ import { Result } from "./fp.js"; export type Paginator = () => Promise }> | null; -export type PageIterator = V & { +export type PageIterator = V & { next: Paginator; [Symbol.asyncIterator]: () => AsyncIterableIterator; + "~next"?: PageState | undefined; }; export function createPageIterator( @@ -40,7 +41,9 @@ export function createPageIterator( * terminates. It is useful in paginated SDK functions that have early return * paths when things go wrong. */ -export function haltIterator(v: V): PageIterator { +export function haltIterator( + v: V, +): PageIterator { return { ...v, next: () => null, @@ -54,9 +57,9 @@ export function haltIterator(v: V): PageIterator { * Converts an async iterator of `Result` into an async iterator of `V`. * When error results occur, the underlying error value is thrown. */ -export async function unwrapResultIterator( - iteratorPromise: Promise>>, -): Promise> { +export async function unwrapResultIterator( + iteratorPromise: Promise, PageState>>, +): Promise> { const resultIter = await iteratorPromise; if (!resultIter.ok) { @@ -66,6 +69,7 @@ export async function unwrapResultIterator( return { ...resultIter.value, next: unwrapPaginator(resultIter.next), + "~next": resultIter["~next"], [Symbol.asyncIterator]: async function* paginator() { for await (const page of resultIter) { if (!page.ok) { @@ -97,3 +101,5 @@ function unwrapPaginator( }); }; } + +export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/src/sdk/watchlist.ts b/src/sdk/watchlist.ts index b34544fd..162cfbd7 100644 --- a/src/sdk/watchlist.ts +++ b/src/sdk/watchlist.ts @@ -16,7 +16,7 @@ export class Watchlist extends ClientSDK { */ async getWatchList( request: operations.GetWatchListRequest, - options?: RequestOptions & { serverURL?: string }, + options?: RequestOptions, ): Promise { return unwrapAsync(watchlistGetWatchList( this, diff --git a/tsconfig.json b/tsconfig.json index 7a86d2d9..f9d286a7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,6 +4,7 @@ "tsBuildInfoFile": ".tsbuildinfo", "target": "ES2018", "lib": ["ES2022", "DOM", "DOM.Iterable"], + "jsx": "react-jsx", "module": "Node16", "moduleResolution": "Node16",