From 4171fb76592893cfc10ab939014a3187e1263ffa Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Fri, 5 Jan 2024 19:39:51 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc 0.0.3, Speakeasy CLI 1.133.1 --- .gitattributes | 2 + .gitignore | 1 + .speakeasy/gen.lock | 474 +++++++++ README.md | 385 ++++++++ RELEASES.md | 11 + USAGE.md | 29 + activities.go | 176 ++++ butler.go | 378 +++++++ docs/models/components/security.md | 8 + docs/models/operations/activity.md | 15 + .../operations/addplaylistcontentsrequest.md | 10 + .../operations/addplaylistcontentsresponse.md | 10 + docs/models/operations/applyupdatesrequest.md | 9 + .../models/operations/applyupdatesresponse.md | 10 + docs/models/operations/butlertask.md | 13 + docs/models/operations/butlertasks.md | 8 + .../cancelserveractivitiesrequest.md | 8 + .../cancelserveractivitiesresponse.md | 10 + .../operations/checkforupdatesrequest.md | 8 + .../operations/checkforupdatesresponse.md | 10 + .../clearplaylistcontentsrequest.md | 8 + .../clearplaylistcontentsresponse.md | 10 + docs/models/operations/context.md | 8 + docs/models/operations/country.md | 8 + .../operations/createplaylistrequest.md | 12 + .../operations/createplaylistresponse.md | 10 + .../models/operations/deletelibraryrequest.md | 8 + .../operations/deletelibraryresponse.md | 10 + .../operations/deleteplaylistrequest.md | 8 + .../operations/deleteplaylistresponse.md | 10 + docs/models/operations/device.md | 12 + docs/models/operations/director.md | 8 + docs/models/operations/directory.md | 10 + docs/models/operations/download.md | 11 + .../operations/enablepapertrailresponse.md | 10 + docs/models/operations/force.md | 13 + docs/models/operations/genre.md | 8 + .../getavailableclientsmediacontainer.md | 9 + .../operations/getavailableclientsresponse.md | 11 + .../operations/getbutlertasksresponse.md | 11 + .../operations/getbutlertasksresponsebody.md | 10 + .../getcommonlibraryitemsrequest.md | 10 + .../getcommonlibraryitemsresponse.md | 10 + .../operations/getdevicesmediacontainer.md | 10 + docs/models/operations/getdevicesresponse.md | 11 + .../operations/getdevicesresponsebody.md | 10 + docs/models/operations/getfilehashrequest.md | 9 + docs/models/operations/getfilehashresponse.md | 10 + .../models/operations/getglobalhubsrequest.md | 9 + .../operations/getglobalhubsresponse.md | 10 + .../getlatestlibraryitemsrequest.md | 10 + .../getlatestlibraryitemsresponse.md | 10 + .../models/operations/getlibrariesresponse.md | 10 + .../operations/getlibraryhubsrequest.md | 10 + .../operations/getlibraryhubsresponse.md | 10 + .../operations/getlibraryitemsrequest.md | 10 + .../operations/getlibraryitemsresponse.md | 10 + docs/models/operations/getlibraryrequest.md | 9 + docs/models/operations/getlibraryresponse.md | 10 + .../operations/getmetadatachildrenrequest.md | 8 + .../operations/getmetadatachildrenresponse.md | 10 + docs/models/operations/getmetadatarequest.md | 8 + docs/models/operations/getmetadataresponse.md | 10 + .../operations/getmyplexaccountresponse.md | 11 + .../getmyplexaccountresponsebody.md | 10 + docs/models/operations/getondeckmedia.md | 22 + .../operations/getondeckmediacontainer.md | 14 + docs/models/operations/getondeckmetadata.md | 43 + docs/models/operations/getondeckpart.md | 16 + docs/models/operations/getondeckresponse.md | 11 + .../operations/getondeckresponsebody.md | 10 + .../operations/getplaylistcontentsrequest.md | 9 + .../operations/getplaylistcontentsresponse.md | 10 + docs/models/operations/getplaylistrequest.md | 8 + docs/models/operations/getplaylistresponse.md | 10 + docs/models/operations/getplaylistsrequest.md | 9 + .../models/operations/getplaylistsresponse.md | 10 + .../getrecentlyaddedmediacontainer.md | 14 + .../operations/getrecentlyaddedresponse.md | 11 + .../getrecentlyaddedresponsebody.md | 10 + .../operations/getresizedphotorequest.md | 14 + .../operations/getresizedphotoresponse.md | 10 + .../operations/getsearchresultscountry.md | 8 + .../operations/getsearchresultsdirector.md | 8 + .../operations/getsearchresultsgenre.md | 8 + .../operations/getsearchresultsmedia.md | 22 + .../getsearchresultsmediacontainer.md | 13 + .../operations/getsearchresultsmetadata.md | 41 + .../models/operations/getsearchresultspart.md | 15 + .../operations/getsearchresultsrequest.md | 8 + .../operations/getsearchresultsresponse.md | 11 + .../getsearchresultsresponsebody.md | 10 + .../models/operations/getsearchresultsrole.md | 8 + .../operations/getsearchresultswriter.md | 8 + .../getserveractivitiesmediacontainer.md | 9 + .../operations/getserveractivitiesresponse.md | 11 + .../getserveractivitiesresponsebody.md | 10 + .../getservercapabilitiesresponse.md | 11 + .../getservercapabilitiesresponsebody.md | 10 + .../getserveridentitymediacontainer.md | 11 + .../operations/getserveridentityresponse.md | 11 + .../getserveridentityresponsebody.md | 10 + .../operations/getserverlistmediacontainer.md | 9 + .../operations/getserverlistresponse.md | 11 + .../operations/getserverlistresponsebody.md | 10 + docs/models/operations/getserverlistserver.md | 13 + .../getserverpreferencesresponse.md | 10 + .../operations/getsessionhistoryresponse.md | 10 + docs/models/operations/getsessionsresponse.md | 10 + .../getsourceconnectioninformationrequest.md | 8 + .../getsourceconnectioninformationresponse.md | 10 + docs/models/operations/gettimelinerequest.md | 17 + docs/models/operations/gettimelineresponse.md | 10 + .../gettranscodesessionsmediacontainer.md | 9 + .../gettranscodesessionsresponse.md | 11 + .../gettranscodesessionsresponsebody.md | 10 + .../operations/gettransienttokenrequest.md | 9 + .../operations/gettransienttokenresponse.md | 10 + .../operations/getupdatestatusresponse.md | 10 + docs/models/operations/guids.md | 8 + docs/models/operations/includedetails.md | 13 + docs/models/operations/level.md | 20 + docs/models/operations/loglinerequest.md | 10 + docs/models/operations/loglineresponse.md | 10 + .../models/operations/logmultilineresponse.md | 10 + docs/models/operations/markplayedrequest.md | 8 + docs/models/operations/markplayedresponse.md | 10 + docs/models/operations/markunplayedrequest.md | 8 + .../models/operations/markunplayedresponse.md | 10 + docs/models/operations/media.md | 23 + docs/models/operations/mediacontainer.md | 58 ++ docs/models/operations/metadata.md | 39 + docs/models/operations/minsize.md | 11 + docs/models/operations/myplex.md | 19 + docs/models/operations/onlytransient.md | 11 + docs/models/operations/part.md | 17 + docs/models/operations/pathparamtaskname.md | 23 + .../models/operations/performsearchrequest.md | 10 + .../operations/performsearchresponse.md | 10 + .../operations/performvoicesearchrequest.md | 10 + .../operations/performvoicesearchresponse.md | 10 + docs/models/operations/playlisttype.md | 12 + docs/models/operations/provider.md | 10 + .../operations/queryparamonlytransient.md | 11 + docs/models/operations/queryparamsmart.md | 11 + docs/models/operations/queryparamtype.md | 10 + .../operations/refreshlibraryrequest.md | 8 + .../operations/refreshlibraryresponse.md | 10 + docs/models/operations/responsebody.md | 8 + docs/models/operations/role.md | 8 + docs/models/operations/scope.md | 10 + docs/models/operations/server.md | 18 + docs/models/operations/skip.md | 11 + docs/models/operations/smart.md | 11 + .../operations/startalltasksresponse.md | 10 + docs/models/operations/starttaskrequest.md | 8 + docs/models/operations/starttaskresponse.md | 10 + .../startuniversaltranscoderequest.md | 23 + .../startuniversaltranscoderesponse.md | 10 + docs/models/operations/state.md | 12 + .../models/operations/stopalltasksresponse.md | 10 + docs/models/operations/stoptaskrequest.md | 8 + docs/models/operations/stoptaskresponse.md | 10 + .../operations/stoptranscodesessionrequest.md | 8 + .../stoptranscodesessionresponse.md | 10 + docs/models/operations/stream.md | 30 + docs/models/operations/taskname.md | 23 + docs/models/operations/tonight.md | 11 + docs/models/operations/transcodesession.md | 29 + docs/models/operations/type.md | 12 + .../operations/updateplaylistrequest.md | 8 + .../operations/updateplaylistresponse.md | 10 + .../operations/updateplayprogressrequest.md | 10 + .../operations/updateplayprogressresponse.md | 10 + .../operations/uploadplaylistrequest.md | 9 + .../operations/uploadplaylistresponse.md | 10 + docs/models/operations/upscale.md | 11 + docs/models/operations/writer.md | 8 + .../sdkerrors/addplaylistcontentserrors.md | 10 + .../addplaylistcontentsresponsebody.md | 11 + docs/models/sdkerrors/applyupdateserrors.md | 10 + .../sdkerrors/applyupdatesresponsebody.md | 11 + .../sdkerrors/cancelserveractivitieserrors.md | 10 + .../cancelserveractivitiesresponsebody.md | 11 + .../models/sdkerrors/checkforupdateserrors.md | 10 + .../sdkerrors/checkforupdatesresponsebody.md | 11 + .../sdkerrors/clearplaylistcontentserrors.md | 10 + .../clearplaylistcontentsresponsebody.md | 11 + docs/models/sdkerrors/createplaylisterrors.md | 10 + .../sdkerrors/createplaylistresponsebody.md | 11 + docs/models/sdkerrors/deletelibraryerrors.md | 10 + .../sdkerrors/deletelibraryresponsebody.md | 11 + docs/models/sdkerrors/deleteplaylisterrors.md | 10 + .../sdkerrors/deleteplaylistresponsebody.md | 11 + .../sdkerrors/enablepapertrailerrors.md | 10 + .../sdkerrors/enablepapertrailresponsebody.md | 11 + docs/models/sdkerrors/errors.md | 10 + .../sdkerrors/getavailableclientserrors.md | 10 + .../getavailableclientsresponsebody.md | 11 + docs/models/sdkerrors/getbutlertaskserrors.md | 10 + .../sdkerrors/getbutlertasksresponsebody.md | 11 + .../sdkerrors/getcommonlibraryitemserrors.md | 10 + .../getcommonlibraryitemsresponsebody.md | 11 + docs/models/sdkerrors/getdeviceserrors.md | 10 + .../sdkerrors/getdevicesresponsebody.md | 11 + docs/models/sdkerrors/getfilehasherrors.md | 10 + .../sdkerrors/getfilehashresponsebody.md | 11 + docs/models/sdkerrors/getglobalhubserrors.md | 10 + .../sdkerrors/getglobalhubsresponsebody.md | 11 + .../sdkerrors/getlatestlibraryitemserrors.md | 10 + .../getlatestlibraryitemsresponsebody.md | 11 + docs/models/sdkerrors/getlibrarieserrors.md | 10 + .../sdkerrors/getlibrariesresponsebody.md | 11 + docs/models/sdkerrors/getlibraryerrors.md | 10 + docs/models/sdkerrors/getlibraryhubserrors.md | 10 + .../sdkerrors/getlibraryhubsresponsebody.md | 11 + .../models/sdkerrors/getlibraryitemserrors.md | 10 + .../sdkerrors/getlibraryitemsresponsebody.md | 11 + .../sdkerrors/getlibraryresponsebody.md | 11 + .../sdkerrors/getmetadatachildrenerrors.md | 10 + .../getmetadatachildrenresponsebody.md | 11 + docs/models/sdkerrors/getmetadataerrors.md | 10 + .../sdkerrors/getmetadataresponsebody.md | 11 + .../sdkerrors/getmyplexaccounterrors.md | 10 + .../sdkerrors/getmyplexaccountresponsebody.md | 11 + docs/models/sdkerrors/getondeckerrors.md | 10 + .../models/sdkerrors/getondeckresponsebody.md | 11 + .../sdkerrors/getplaylistcontentserrors.md | 10 + .../getplaylistcontentsresponsebody.md | 11 + docs/models/sdkerrors/getplaylisterrors.md | 10 + .../sdkerrors/getplaylistresponsebody.md | 11 + docs/models/sdkerrors/getplaylistserrors.md | 10 + .../sdkerrors/getplaylistsresponsebody.md | 11 + .../sdkerrors/getrecentlyaddederrors.md | 10 + .../sdkerrors/getrecentlyaddedresponsebody.md | 11 + .../models/sdkerrors/getresizedphotoerrors.md | 10 + .../sdkerrors/getresizedphotoresponsebody.md | 11 + .../sdkerrors/getsearchresultserrors.md | 10 + .../sdkerrors/getsearchresultsresponsebody.md | 11 + .../sdkerrors/getserveractivitieserrors.md | 10 + .../getserveractivitiesresponsebody.md | 11 + .../getservercapabilitiesresponsebody.md | 11 + .../sdkerrors/getserveridentityerrors.md | 10 + .../getserveridentityresponsebody.md | 11 + docs/models/sdkerrors/getserverlisterrors.md | 10 + .../sdkerrors/getserverlistresponsebody.md | 11 + .../sdkerrors/getserverpreferenceserrors.md | 10 + .../getserverpreferencesresponsebody.md | 11 + .../sdkerrors/getsessionhistoryerrors.md | 10 + .../getsessionhistoryresponsebody.md | 11 + docs/models/sdkerrors/getsessionserrors.md | 10 + .../sdkerrors/getsessionsresponsebody.md | 11 + .../getsourceconnectioninformationerrors.md | 10 + ...sourceconnectioninformationresponsebody.md | 11 + docs/models/sdkerrors/gettimelineerrors.md | 10 + .../sdkerrors/gettimelineresponsebody.md | 11 + .../sdkerrors/gettranscodesessionserrors.md | 10 + .../gettranscodesessionsresponsebody.md | 11 + .../sdkerrors/gettransienttokenerrors.md | 10 + .../gettransienttokenresponsebody.md | 11 + .../models/sdkerrors/getupdatestatuserrors.md | 10 + .../sdkerrors/getupdatestatusresponsebody.md | 11 + docs/models/sdkerrors/loglineerrors.md | 10 + docs/models/sdkerrors/loglineresponsebody.md | 11 + docs/models/sdkerrors/logmultilineerrors.md | 10 + .../sdkerrors/logmultilineresponsebody.md | 11 + docs/models/sdkerrors/markplayederrors.md | 10 + .../sdkerrors/markplayedresponsebody.md | 11 + docs/models/sdkerrors/markunplayederrors.md | 10 + .../sdkerrors/markunplayedresponsebody.md | 11 + docs/models/sdkerrors/performsearcherrors.md | 10 + .../sdkerrors/performsearchresponsebody.md | 11 + .../sdkerrors/performvoicesearcherrors.md | 10 + .../performvoicesearchresponsebody.md | 11 + docs/models/sdkerrors/refreshlibraryerrors.md | 10 + .../sdkerrors/refreshlibraryresponsebody.md | 11 + docs/models/sdkerrors/startalltaskserrors.md | 10 + .../sdkerrors/startalltasksresponsebody.md | 11 + docs/models/sdkerrors/starttaskerrors.md | 10 + .../models/sdkerrors/starttaskresponsebody.md | 11 + .../startuniversaltranscodeerrors.md | 10 + .../startuniversaltranscoderesponsebody.md | 11 + docs/models/sdkerrors/stopalltaskserrors.md | 10 + .../sdkerrors/stopalltasksresponsebody.md | 11 + docs/models/sdkerrors/stoptaskerrors.md | 10 + docs/models/sdkerrors/stoptaskresponsebody.md | 11 + .../sdkerrors/stoptranscodesessionerrors.md | 10 + .../stoptranscodesessionresponsebody.md | 11 + docs/models/sdkerrors/updateplaylisterrors.md | 10 + .../sdkerrors/updateplaylistresponsebody.md | 11 + .../sdkerrors/updateplayprogresserrors.md | 10 + .../updateplayprogressresponsebody.md | 11 + docs/models/sdkerrors/uploadplaylisterrors.md | 10 + .../sdkerrors/uploadplaylistresponsebody.md | 11 + docs/sdks/activities/README.md | 119 +++ docs/sdks/butler/README.md | 281 ++++++ docs/sdks/hubs/README.md | 130 +++ docs/sdks/library/README.md | 702 +++++++++++++ docs/sdks/log/README.md | 174 ++++ docs/sdks/media/README.md | 179 ++++ docs/sdks/playlists/README.md | 533 ++++++++++ docs/sdks/plexapi/README.md | 9 + docs/sdks/search/README.md | 199 ++++ docs/sdks/security/README.md | 125 +++ docs/sdks/server/README.md | 415 ++++++++ docs/sdks/sessions/README.md | 213 ++++ docs/sdks/updater/README.md | 175 ++++ docs/sdks/video/README.md | 131 +++ go.mod | 10 + go.sum | 8 + hubs.go | 174 ++++ internal/utils/contenttype.go | 33 + internal/utils/form.go | 117 +++ internal/utils/headers.go | 102 ++ internal/utils/json.go | 596 ++++++++++++ internal/utils/pathparams.go | 145 +++ internal/utils/queryparams.go | 178 ++++ internal/utils/requestbody.go | 396 ++++++++ internal/utils/retries.go | 117 +++ internal/utils/security.go | 298 ++++++ internal/utils/utils.go | 170 ++++ library.go | 920 ++++++++++++++++++ log.go | 227 +++++ media.go | 241 +++++ models/components/security.go | 14 + models/operations/addplaylistcontents.go | 67 ++ models/operations/applyupdates.go | 116 +++ models/operations/cancelserveractivities.go | 49 + models/operations/checkforupdates.go | 79 ++ models/operations/clearplaylistcontents.go | 49 + models/operations/createplaylist.go | 146 +++ models/operations/deletelibrary.go | 49 + models/operations/deleteplaylist.go | 49 + models/operations/enablepapertrail.go | 37 + models/operations/getavailableclients.go | 167 ++++ models/operations/getbutlertasks.go | 120 +++ models/operations/getcommonlibraryitems.go | 67 ++ models/operations/getdevices.go | 128 +++ models/operations/getfilehash.go | 58 ++ models/operations/getglobalhubs.go | 88 ++ models/operations/getlatestlibraryitems.go | 67 ++ models/operations/getlibraries.go | 37 + models/operations/getlibrary.go | 103 ++ models/operations/getlibraryhubs.go | 97 ++ models/operations/getlibraryitems.go | 67 ++ models/operations/getmetadata.go | 49 + models/operations/getmetadatachildren.go | 49 + models/operations/getmyplexaccount.go | 157 +++ models/operations/getondeck.go | 817 ++++++++++++++++ models/operations/getplaylist.go | 49 + models/operations/getplaylistcontents.go | 58 ++ models/operations/getplaylists.go | 119 +++ models/operations/getrecentlyadded.go | 658 +++++++++++++ models/operations/getresizedphoto.go | 173 ++++ models/operations/getsearchresults.go | 681 +++++++++++++ models/operations/getserveractivities.go | 155 +++ models/operations/getservercapabilities.go | 496 ++++++++++ models/operations/getserveridentity.go | 93 ++ models/operations/getserverlist.go | 128 +++ models/operations/getserverpreferences.go | 37 + models/operations/getsessionhistory.go | 37 + models/operations/getsessions.go | 37 + .../getsourceconnectioninformation.go | 49 + models/operations/gettimeline.go | 163 ++++ models/operations/gettranscodesessions.go | 256 +++++ models/operations/gettransienttoken.go | 110 +++ models/operations/getupdatestatus.go | 37 + models/operations/logline.go | 117 +++ models/operations/logmultiline.go | 37 + models/operations/markplayed.go | 49 + models/operations/markunplayed.go | 49 + models/operations/performsearch.go | 79 ++ models/operations/performvoicesearch.go | 79 ++ models/operations/refreshlibrary.go | 49 + models/operations/startalltasks.go | 37 + models/operations/starttask.go | 115 +++ models/operations/startuniversaltranscode.go | 184 ++++ models/operations/stopalltasks.go | 37 + models/operations/stoptask.go | 115 +++ models/operations/stoptranscodesession.go | 49 + models/operations/updateplaylist.go | 49 + models/operations/updateplayprogress.go | 67 ++ models/operations/uploadplaylist.go | 97 ++ models/sdkerrors/addplaylistcontents.go | 49 + models/sdkerrors/applyupdates.go | 49 + models/sdkerrors/cancelserveractivities.go | 49 + models/sdkerrors/checkforupdates.go | 49 + models/sdkerrors/clearplaylistcontents.go | 49 + models/sdkerrors/createplaylist.go | 49 + models/sdkerrors/deletelibrary.go | 49 + models/sdkerrors/deleteplaylist.go | 49 + models/sdkerrors/enablepapertrail.go | 49 + models/sdkerrors/getavailableclients.go | 49 + models/sdkerrors/getbutlertasks.go | 49 + models/sdkerrors/getcommonlibraryitems.go | 49 + models/sdkerrors/getdevices.go | 49 + models/sdkerrors/getfilehash.go | 49 + models/sdkerrors/getglobalhubs.go | 49 + models/sdkerrors/getlatestlibraryitems.go | 49 + models/sdkerrors/getlibraries.go | 49 + models/sdkerrors/getlibrary.go | 49 + models/sdkerrors/getlibraryhubs.go | 49 + models/sdkerrors/getlibraryitems.go | 49 + models/sdkerrors/getmetadata.go | 49 + models/sdkerrors/getmetadatachildren.go | 49 + models/sdkerrors/getmyplexaccount.go | 49 + models/sdkerrors/getondeck.go | 49 + models/sdkerrors/getplaylist.go | 49 + models/sdkerrors/getplaylistcontents.go | 49 + models/sdkerrors/getplaylists.go | 49 + models/sdkerrors/getrecentlyadded.go | 49 + models/sdkerrors/getresizedphoto.go | 49 + models/sdkerrors/getsearchresults.go | 49 + models/sdkerrors/getserveractivities.go | 49 + models/sdkerrors/getservercapabilities.go | 49 + models/sdkerrors/getserveridentity.go | 49 + models/sdkerrors/getserverlist.go | 49 + models/sdkerrors/getserverpreferences.go | 49 + models/sdkerrors/getsessionhistory.go | 49 + models/sdkerrors/getsessions.go | 49 + .../getsourceconnectioninformation.go | 49 + models/sdkerrors/gettimeline.go | 49 + models/sdkerrors/gettranscodesessions.go | 49 + models/sdkerrors/gettransienttoken.go | 49 + models/sdkerrors/getupdatestatus.go | 49 + models/sdkerrors/logline.go | 49 + models/sdkerrors/logmultiline.go | 49 + models/sdkerrors/markplayed.go | 49 + models/sdkerrors/markunplayed.go | 49 + models/sdkerrors/performsearch.go | 49 + models/sdkerrors/performvoicesearch.go | 49 + models/sdkerrors/refreshlibrary.go | 49 + models/sdkerrors/sdkerror.go | 35 + models/sdkerrors/startalltasks.go | 49 + models/sdkerrors/starttask.go | 49 + models/sdkerrors/startuniversaltranscode.go | 49 + models/sdkerrors/stopalltasks.go | 49 + models/sdkerrors/stoptask.go | 49 + models/sdkerrors/stoptranscodesession.go | 49 + models/sdkerrors/updateplaylist.go | 49 + models/sdkerrors/updateplayprogress.go | 49 + models/sdkerrors/uploadplaylist.go | 49 + playlists.go | 678 +++++++++++++ plexapi.go | 312 ++++++ search.go | 269 +++++ security.go | 170 ++++ server.go | 600 ++++++++++++ sessions.go | 296 ++++++ types/bigint.go | 21 + types/date.go | 90 ++ types/datetime.go | 23 + types/decimal.go | 20 + types/pointers.go | 10 + updater.go | 235 +++++ video.go | 160 +++ 455 files changed, 24819 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100755 .speakeasy/gen.lock create mode 100644 README.md create mode 100644 RELEASES.md create mode 100644 USAGE.md create mode 100644 activities.go create mode 100644 butler.go create mode 100644 docs/models/components/security.md create mode 100644 docs/models/operations/activity.md create mode 100644 docs/models/operations/addplaylistcontentsrequest.md create mode 100644 docs/models/operations/addplaylistcontentsresponse.md create mode 100644 docs/models/operations/applyupdatesrequest.md create mode 100644 docs/models/operations/applyupdatesresponse.md create mode 100644 docs/models/operations/butlertask.md create mode 100644 docs/models/operations/butlertasks.md create mode 100644 docs/models/operations/cancelserveractivitiesrequest.md create mode 100644 docs/models/operations/cancelserveractivitiesresponse.md create mode 100644 docs/models/operations/checkforupdatesrequest.md create mode 100644 docs/models/operations/checkforupdatesresponse.md create mode 100644 docs/models/operations/clearplaylistcontentsrequest.md create mode 100644 docs/models/operations/clearplaylistcontentsresponse.md create mode 100644 docs/models/operations/context.md create mode 100644 docs/models/operations/country.md create mode 100644 docs/models/operations/createplaylistrequest.md create mode 100644 docs/models/operations/createplaylistresponse.md create mode 100644 docs/models/operations/deletelibraryrequest.md create mode 100644 docs/models/operations/deletelibraryresponse.md create mode 100644 docs/models/operations/deleteplaylistrequest.md create mode 100644 docs/models/operations/deleteplaylistresponse.md create mode 100644 docs/models/operations/device.md create mode 100644 docs/models/operations/director.md create mode 100644 docs/models/operations/directory.md create mode 100644 docs/models/operations/download.md create mode 100644 docs/models/operations/enablepapertrailresponse.md create mode 100644 docs/models/operations/force.md create mode 100644 docs/models/operations/genre.md create mode 100644 docs/models/operations/getavailableclientsmediacontainer.md create mode 100644 docs/models/operations/getavailableclientsresponse.md create mode 100644 docs/models/operations/getbutlertasksresponse.md create mode 100644 docs/models/operations/getbutlertasksresponsebody.md create mode 100644 docs/models/operations/getcommonlibraryitemsrequest.md create mode 100644 docs/models/operations/getcommonlibraryitemsresponse.md create mode 100644 docs/models/operations/getdevicesmediacontainer.md create mode 100644 docs/models/operations/getdevicesresponse.md create mode 100644 docs/models/operations/getdevicesresponsebody.md create mode 100644 docs/models/operations/getfilehashrequest.md create mode 100644 docs/models/operations/getfilehashresponse.md create mode 100644 docs/models/operations/getglobalhubsrequest.md create mode 100644 docs/models/operations/getglobalhubsresponse.md create mode 100644 docs/models/operations/getlatestlibraryitemsrequest.md create mode 100644 docs/models/operations/getlatestlibraryitemsresponse.md create mode 100644 docs/models/operations/getlibrariesresponse.md create mode 100644 docs/models/operations/getlibraryhubsrequest.md create mode 100644 docs/models/operations/getlibraryhubsresponse.md create mode 100644 docs/models/operations/getlibraryitemsrequest.md create mode 100644 docs/models/operations/getlibraryitemsresponse.md create mode 100644 docs/models/operations/getlibraryrequest.md create mode 100644 docs/models/operations/getlibraryresponse.md create mode 100644 docs/models/operations/getmetadatachildrenrequest.md create mode 100644 docs/models/operations/getmetadatachildrenresponse.md create mode 100644 docs/models/operations/getmetadatarequest.md create mode 100644 docs/models/operations/getmetadataresponse.md create mode 100644 docs/models/operations/getmyplexaccountresponse.md create mode 100644 docs/models/operations/getmyplexaccountresponsebody.md create mode 100644 docs/models/operations/getondeckmedia.md create mode 100644 docs/models/operations/getondeckmediacontainer.md create mode 100644 docs/models/operations/getondeckmetadata.md create mode 100644 docs/models/operations/getondeckpart.md create mode 100644 docs/models/operations/getondeckresponse.md create mode 100644 docs/models/operations/getondeckresponsebody.md create mode 100644 docs/models/operations/getplaylistcontentsrequest.md create mode 100644 docs/models/operations/getplaylistcontentsresponse.md create mode 100644 docs/models/operations/getplaylistrequest.md create mode 100644 docs/models/operations/getplaylistresponse.md create mode 100644 docs/models/operations/getplaylistsrequest.md create mode 100644 docs/models/operations/getplaylistsresponse.md create mode 100644 docs/models/operations/getrecentlyaddedmediacontainer.md create mode 100644 docs/models/operations/getrecentlyaddedresponse.md create mode 100644 docs/models/operations/getrecentlyaddedresponsebody.md create mode 100644 docs/models/operations/getresizedphotorequest.md create mode 100644 docs/models/operations/getresizedphotoresponse.md create mode 100644 docs/models/operations/getsearchresultscountry.md create mode 100644 docs/models/operations/getsearchresultsdirector.md create mode 100644 docs/models/operations/getsearchresultsgenre.md create mode 100644 docs/models/operations/getsearchresultsmedia.md create mode 100644 docs/models/operations/getsearchresultsmediacontainer.md create mode 100644 docs/models/operations/getsearchresultsmetadata.md create mode 100644 docs/models/operations/getsearchresultspart.md create mode 100644 docs/models/operations/getsearchresultsrequest.md create mode 100644 docs/models/operations/getsearchresultsresponse.md create mode 100644 docs/models/operations/getsearchresultsresponsebody.md create mode 100644 docs/models/operations/getsearchresultsrole.md create mode 100644 docs/models/operations/getsearchresultswriter.md create mode 100644 docs/models/operations/getserveractivitiesmediacontainer.md create mode 100644 docs/models/operations/getserveractivitiesresponse.md create mode 100644 docs/models/operations/getserveractivitiesresponsebody.md create mode 100644 docs/models/operations/getservercapabilitiesresponse.md create mode 100644 docs/models/operations/getservercapabilitiesresponsebody.md create mode 100644 docs/models/operations/getserveridentitymediacontainer.md create mode 100644 docs/models/operations/getserveridentityresponse.md create mode 100644 docs/models/operations/getserveridentityresponsebody.md create mode 100644 docs/models/operations/getserverlistmediacontainer.md create mode 100644 docs/models/operations/getserverlistresponse.md create mode 100644 docs/models/operations/getserverlistresponsebody.md create mode 100644 docs/models/operations/getserverlistserver.md create mode 100644 docs/models/operations/getserverpreferencesresponse.md create mode 100644 docs/models/operations/getsessionhistoryresponse.md create mode 100644 docs/models/operations/getsessionsresponse.md create mode 100644 docs/models/operations/getsourceconnectioninformationrequest.md create mode 100644 docs/models/operations/getsourceconnectioninformationresponse.md create mode 100644 docs/models/operations/gettimelinerequest.md create mode 100644 docs/models/operations/gettimelineresponse.md create mode 100644 docs/models/operations/gettranscodesessionsmediacontainer.md create mode 100644 docs/models/operations/gettranscodesessionsresponse.md create mode 100644 docs/models/operations/gettranscodesessionsresponsebody.md create mode 100644 docs/models/operations/gettransienttokenrequest.md create mode 100644 docs/models/operations/gettransienttokenresponse.md create mode 100644 docs/models/operations/getupdatestatusresponse.md create mode 100644 docs/models/operations/guids.md create mode 100644 docs/models/operations/includedetails.md create mode 100644 docs/models/operations/level.md create mode 100644 docs/models/operations/loglinerequest.md create mode 100644 docs/models/operations/loglineresponse.md create mode 100644 docs/models/operations/logmultilineresponse.md create mode 100644 docs/models/operations/markplayedrequest.md create mode 100644 docs/models/operations/markplayedresponse.md create mode 100644 docs/models/operations/markunplayedrequest.md create mode 100644 docs/models/operations/markunplayedresponse.md create mode 100644 docs/models/operations/media.md create mode 100644 docs/models/operations/mediacontainer.md create mode 100644 docs/models/operations/metadata.md create mode 100644 docs/models/operations/minsize.md create mode 100644 docs/models/operations/myplex.md create mode 100644 docs/models/operations/onlytransient.md create mode 100644 docs/models/operations/part.md create mode 100644 docs/models/operations/pathparamtaskname.md create mode 100644 docs/models/operations/performsearchrequest.md create mode 100644 docs/models/operations/performsearchresponse.md create mode 100644 docs/models/operations/performvoicesearchrequest.md create mode 100644 docs/models/operations/performvoicesearchresponse.md create mode 100644 docs/models/operations/playlisttype.md create mode 100644 docs/models/operations/provider.md create mode 100644 docs/models/operations/queryparamonlytransient.md create mode 100644 docs/models/operations/queryparamsmart.md create mode 100644 docs/models/operations/queryparamtype.md create mode 100644 docs/models/operations/refreshlibraryrequest.md create mode 100644 docs/models/operations/refreshlibraryresponse.md create mode 100644 docs/models/operations/responsebody.md create mode 100644 docs/models/operations/role.md create mode 100644 docs/models/operations/scope.md create mode 100644 docs/models/operations/server.md create mode 100644 docs/models/operations/skip.md create mode 100644 docs/models/operations/smart.md create mode 100644 docs/models/operations/startalltasksresponse.md create mode 100644 docs/models/operations/starttaskrequest.md create mode 100644 docs/models/operations/starttaskresponse.md create mode 100644 docs/models/operations/startuniversaltranscoderequest.md create mode 100644 docs/models/operations/startuniversaltranscoderesponse.md create mode 100644 docs/models/operations/state.md create mode 100644 docs/models/operations/stopalltasksresponse.md create mode 100644 docs/models/operations/stoptaskrequest.md create mode 100644 docs/models/operations/stoptaskresponse.md create mode 100644 docs/models/operations/stoptranscodesessionrequest.md create mode 100644 docs/models/operations/stoptranscodesessionresponse.md create mode 100644 docs/models/operations/stream.md create mode 100644 docs/models/operations/taskname.md create mode 100644 docs/models/operations/tonight.md create mode 100644 docs/models/operations/transcodesession.md create mode 100644 docs/models/operations/type.md create mode 100644 docs/models/operations/updateplaylistrequest.md create mode 100644 docs/models/operations/updateplaylistresponse.md create mode 100644 docs/models/operations/updateplayprogressrequest.md create mode 100644 docs/models/operations/updateplayprogressresponse.md create mode 100644 docs/models/operations/uploadplaylistrequest.md create mode 100644 docs/models/operations/uploadplaylistresponse.md create mode 100644 docs/models/operations/upscale.md create mode 100644 docs/models/operations/writer.md create mode 100644 docs/models/sdkerrors/addplaylistcontentserrors.md create mode 100644 docs/models/sdkerrors/addplaylistcontentsresponsebody.md create mode 100644 docs/models/sdkerrors/applyupdateserrors.md create mode 100644 docs/models/sdkerrors/applyupdatesresponsebody.md create mode 100644 docs/models/sdkerrors/cancelserveractivitieserrors.md create mode 100644 docs/models/sdkerrors/cancelserveractivitiesresponsebody.md create mode 100644 docs/models/sdkerrors/checkforupdateserrors.md create mode 100644 docs/models/sdkerrors/checkforupdatesresponsebody.md create mode 100644 docs/models/sdkerrors/clearplaylistcontentserrors.md create mode 100644 docs/models/sdkerrors/clearplaylistcontentsresponsebody.md create mode 100644 docs/models/sdkerrors/createplaylisterrors.md create mode 100644 docs/models/sdkerrors/createplaylistresponsebody.md create mode 100644 docs/models/sdkerrors/deletelibraryerrors.md create mode 100644 docs/models/sdkerrors/deletelibraryresponsebody.md create mode 100644 docs/models/sdkerrors/deleteplaylisterrors.md create mode 100644 docs/models/sdkerrors/deleteplaylistresponsebody.md create mode 100644 docs/models/sdkerrors/enablepapertrailerrors.md create mode 100644 docs/models/sdkerrors/enablepapertrailresponsebody.md create mode 100644 docs/models/sdkerrors/errors.md create mode 100644 docs/models/sdkerrors/getavailableclientserrors.md create mode 100644 docs/models/sdkerrors/getavailableclientsresponsebody.md create mode 100644 docs/models/sdkerrors/getbutlertaskserrors.md create mode 100644 docs/models/sdkerrors/getbutlertasksresponsebody.md create mode 100644 docs/models/sdkerrors/getcommonlibraryitemserrors.md create mode 100644 docs/models/sdkerrors/getcommonlibraryitemsresponsebody.md create mode 100644 docs/models/sdkerrors/getdeviceserrors.md create mode 100644 docs/models/sdkerrors/getdevicesresponsebody.md create mode 100644 docs/models/sdkerrors/getfilehasherrors.md create mode 100644 docs/models/sdkerrors/getfilehashresponsebody.md create mode 100644 docs/models/sdkerrors/getglobalhubserrors.md create mode 100644 docs/models/sdkerrors/getglobalhubsresponsebody.md create mode 100644 docs/models/sdkerrors/getlatestlibraryitemserrors.md create mode 100644 docs/models/sdkerrors/getlatestlibraryitemsresponsebody.md create mode 100644 docs/models/sdkerrors/getlibrarieserrors.md create mode 100644 docs/models/sdkerrors/getlibrariesresponsebody.md create mode 100644 docs/models/sdkerrors/getlibraryerrors.md create mode 100644 docs/models/sdkerrors/getlibraryhubserrors.md create mode 100644 docs/models/sdkerrors/getlibraryhubsresponsebody.md create mode 100644 docs/models/sdkerrors/getlibraryitemserrors.md create mode 100644 docs/models/sdkerrors/getlibraryitemsresponsebody.md create mode 100644 docs/models/sdkerrors/getlibraryresponsebody.md create mode 100644 docs/models/sdkerrors/getmetadatachildrenerrors.md create mode 100644 docs/models/sdkerrors/getmetadatachildrenresponsebody.md create mode 100644 docs/models/sdkerrors/getmetadataerrors.md create mode 100644 docs/models/sdkerrors/getmetadataresponsebody.md create mode 100644 docs/models/sdkerrors/getmyplexaccounterrors.md create mode 100644 docs/models/sdkerrors/getmyplexaccountresponsebody.md create mode 100644 docs/models/sdkerrors/getondeckerrors.md create mode 100644 docs/models/sdkerrors/getondeckresponsebody.md create mode 100644 docs/models/sdkerrors/getplaylistcontentserrors.md create mode 100644 docs/models/sdkerrors/getplaylistcontentsresponsebody.md create mode 100644 docs/models/sdkerrors/getplaylisterrors.md create mode 100644 docs/models/sdkerrors/getplaylistresponsebody.md create mode 100644 docs/models/sdkerrors/getplaylistserrors.md create mode 100644 docs/models/sdkerrors/getplaylistsresponsebody.md create mode 100644 docs/models/sdkerrors/getrecentlyaddederrors.md create mode 100644 docs/models/sdkerrors/getrecentlyaddedresponsebody.md create mode 100644 docs/models/sdkerrors/getresizedphotoerrors.md create mode 100644 docs/models/sdkerrors/getresizedphotoresponsebody.md create mode 100644 docs/models/sdkerrors/getsearchresultserrors.md create mode 100644 docs/models/sdkerrors/getsearchresultsresponsebody.md create mode 100644 docs/models/sdkerrors/getserveractivitieserrors.md create mode 100644 docs/models/sdkerrors/getserveractivitiesresponsebody.md create mode 100644 docs/models/sdkerrors/getservercapabilitiesresponsebody.md create mode 100644 docs/models/sdkerrors/getserveridentityerrors.md create mode 100644 docs/models/sdkerrors/getserveridentityresponsebody.md create mode 100644 docs/models/sdkerrors/getserverlisterrors.md create mode 100644 docs/models/sdkerrors/getserverlistresponsebody.md create mode 100644 docs/models/sdkerrors/getserverpreferenceserrors.md create mode 100644 docs/models/sdkerrors/getserverpreferencesresponsebody.md create mode 100644 docs/models/sdkerrors/getsessionhistoryerrors.md create mode 100644 docs/models/sdkerrors/getsessionhistoryresponsebody.md create mode 100644 docs/models/sdkerrors/getsessionserrors.md create mode 100644 docs/models/sdkerrors/getsessionsresponsebody.md create mode 100644 docs/models/sdkerrors/getsourceconnectioninformationerrors.md create mode 100644 docs/models/sdkerrors/getsourceconnectioninformationresponsebody.md create mode 100644 docs/models/sdkerrors/gettimelineerrors.md create mode 100644 docs/models/sdkerrors/gettimelineresponsebody.md create mode 100644 docs/models/sdkerrors/gettranscodesessionserrors.md create mode 100644 docs/models/sdkerrors/gettranscodesessionsresponsebody.md create mode 100644 docs/models/sdkerrors/gettransienttokenerrors.md create mode 100644 docs/models/sdkerrors/gettransienttokenresponsebody.md create mode 100644 docs/models/sdkerrors/getupdatestatuserrors.md create mode 100644 docs/models/sdkerrors/getupdatestatusresponsebody.md create mode 100644 docs/models/sdkerrors/loglineerrors.md create mode 100644 docs/models/sdkerrors/loglineresponsebody.md create mode 100644 docs/models/sdkerrors/logmultilineerrors.md create mode 100644 docs/models/sdkerrors/logmultilineresponsebody.md create mode 100644 docs/models/sdkerrors/markplayederrors.md create mode 100644 docs/models/sdkerrors/markplayedresponsebody.md create mode 100644 docs/models/sdkerrors/markunplayederrors.md create mode 100644 docs/models/sdkerrors/markunplayedresponsebody.md create mode 100644 docs/models/sdkerrors/performsearcherrors.md create mode 100644 docs/models/sdkerrors/performsearchresponsebody.md create mode 100644 docs/models/sdkerrors/performvoicesearcherrors.md create mode 100644 docs/models/sdkerrors/performvoicesearchresponsebody.md create mode 100644 docs/models/sdkerrors/refreshlibraryerrors.md create mode 100644 docs/models/sdkerrors/refreshlibraryresponsebody.md create mode 100644 docs/models/sdkerrors/startalltaskserrors.md create mode 100644 docs/models/sdkerrors/startalltasksresponsebody.md create mode 100644 docs/models/sdkerrors/starttaskerrors.md create mode 100644 docs/models/sdkerrors/starttaskresponsebody.md create mode 100644 docs/models/sdkerrors/startuniversaltranscodeerrors.md create mode 100644 docs/models/sdkerrors/startuniversaltranscoderesponsebody.md create mode 100644 docs/models/sdkerrors/stopalltaskserrors.md create mode 100644 docs/models/sdkerrors/stopalltasksresponsebody.md create mode 100644 docs/models/sdkerrors/stoptaskerrors.md create mode 100644 docs/models/sdkerrors/stoptaskresponsebody.md create mode 100644 docs/models/sdkerrors/stoptranscodesessionerrors.md create mode 100644 docs/models/sdkerrors/stoptranscodesessionresponsebody.md create mode 100644 docs/models/sdkerrors/updateplaylisterrors.md create mode 100644 docs/models/sdkerrors/updateplaylistresponsebody.md create mode 100644 docs/models/sdkerrors/updateplayprogresserrors.md create mode 100644 docs/models/sdkerrors/updateplayprogressresponsebody.md create mode 100644 docs/models/sdkerrors/uploadplaylisterrors.md create mode 100644 docs/models/sdkerrors/uploadplaylistresponsebody.md create mode 100644 docs/sdks/activities/README.md create mode 100644 docs/sdks/butler/README.md create mode 100644 docs/sdks/hubs/README.md create mode 100644 docs/sdks/library/README.md create mode 100644 docs/sdks/log/README.md create mode 100644 docs/sdks/media/README.md create mode 100644 docs/sdks/playlists/README.md create mode 100644 docs/sdks/plexapi/README.md create mode 100644 docs/sdks/search/README.md create mode 100644 docs/sdks/security/README.md create mode 100644 docs/sdks/server/README.md create mode 100644 docs/sdks/sessions/README.md create mode 100644 docs/sdks/updater/README.md create mode 100644 docs/sdks/video/README.md create mode 100644 go.mod create mode 100644 go.sum create mode 100644 hubs.go create mode 100644 internal/utils/contenttype.go create mode 100644 internal/utils/form.go create mode 100644 internal/utils/headers.go create mode 100644 internal/utils/json.go create mode 100644 internal/utils/pathparams.go create mode 100644 internal/utils/queryparams.go create mode 100644 internal/utils/requestbody.go create mode 100644 internal/utils/retries.go create mode 100644 internal/utils/security.go create mode 100644 internal/utils/utils.go create mode 100644 library.go create mode 100644 log.go create mode 100644 media.go create mode 100644 models/components/security.go create mode 100644 models/operations/addplaylistcontents.go create mode 100644 models/operations/applyupdates.go create mode 100644 models/operations/cancelserveractivities.go create mode 100644 models/operations/checkforupdates.go create mode 100644 models/operations/clearplaylistcontents.go create mode 100644 models/operations/createplaylist.go create mode 100644 models/operations/deletelibrary.go create mode 100644 models/operations/deleteplaylist.go create mode 100644 models/operations/enablepapertrail.go create mode 100644 models/operations/getavailableclients.go create mode 100644 models/operations/getbutlertasks.go create mode 100644 models/operations/getcommonlibraryitems.go create mode 100644 models/operations/getdevices.go create mode 100644 models/operations/getfilehash.go create mode 100644 models/operations/getglobalhubs.go create mode 100644 models/operations/getlatestlibraryitems.go create mode 100644 models/operations/getlibraries.go create mode 100644 models/operations/getlibrary.go create mode 100644 models/operations/getlibraryhubs.go create mode 100644 models/operations/getlibraryitems.go create mode 100644 models/operations/getmetadata.go create mode 100644 models/operations/getmetadatachildren.go create mode 100644 models/operations/getmyplexaccount.go create mode 100644 models/operations/getondeck.go create mode 100644 models/operations/getplaylist.go create mode 100644 models/operations/getplaylistcontents.go create mode 100644 models/operations/getplaylists.go create mode 100644 models/operations/getrecentlyadded.go create mode 100644 models/operations/getresizedphoto.go create mode 100644 models/operations/getsearchresults.go create mode 100644 models/operations/getserveractivities.go create mode 100644 models/operations/getservercapabilities.go create mode 100644 models/operations/getserveridentity.go create mode 100644 models/operations/getserverlist.go create mode 100644 models/operations/getserverpreferences.go create mode 100644 models/operations/getsessionhistory.go create mode 100644 models/operations/getsessions.go create mode 100644 models/operations/getsourceconnectioninformation.go create mode 100644 models/operations/gettimeline.go create mode 100644 models/operations/gettranscodesessions.go create mode 100644 models/operations/gettransienttoken.go create mode 100644 models/operations/getupdatestatus.go create mode 100644 models/operations/logline.go create mode 100644 models/operations/logmultiline.go create mode 100644 models/operations/markplayed.go create mode 100644 models/operations/markunplayed.go create mode 100644 models/operations/performsearch.go create mode 100644 models/operations/performvoicesearch.go create mode 100644 models/operations/refreshlibrary.go create mode 100644 models/operations/startalltasks.go create mode 100644 models/operations/starttask.go create mode 100644 models/operations/startuniversaltranscode.go create mode 100644 models/operations/stopalltasks.go create mode 100644 models/operations/stoptask.go create mode 100644 models/operations/stoptranscodesession.go create mode 100644 models/operations/updateplaylist.go create mode 100644 models/operations/updateplayprogress.go create mode 100644 models/operations/uploadplaylist.go create mode 100644 models/sdkerrors/addplaylistcontents.go create mode 100644 models/sdkerrors/applyupdates.go create mode 100644 models/sdkerrors/cancelserveractivities.go create mode 100644 models/sdkerrors/checkforupdates.go create mode 100644 models/sdkerrors/clearplaylistcontents.go create mode 100644 models/sdkerrors/createplaylist.go create mode 100644 models/sdkerrors/deletelibrary.go create mode 100644 models/sdkerrors/deleteplaylist.go create mode 100644 models/sdkerrors/enablepapertrail.go create mode 100644 models/sdkerrors/getavailableclients.go create mode 100644 models/sdkerrors/getbutlertasks.go create mode 100644 models/sdkerrors/getcommonlibraryitems.go create mode 100644 models/sdkerrors/getdevices.go create mode 100644 models/sdkerrors/getfilehash.go create mode 100644 models/sdkerrors/getglobalhubs.go create mode 100644 models/sdkerrors/getlatestlibraryitems.go create mode 100644 models/sdkerrors/getlibraries.go create mode 100644 models/sdkerrors/getlibrary.go create mode 100644 models/sdkerrors/getlibraryhubs.go create mode 100644 models/sdkerrors/getlibraryitems.go create mode 100644 models/sdkerrors/getmetadata.go create mode 100644 models/sdkerrors/getmetadatachildren.go create mode 100644 models/sdkerrors/getmyplexaccount.go create mode 100644 models/sdkerrors/getondeck.go create mode 100644 models/sdkerrors/getplaylist.go create mode 100644 models/sdkerrors/getplaylistcontents.go create mode 100644 models/sdkerrors/getplaylists.go create mode 100644 models/sdkerrors/getrecentlyadded.go create mode 100644 models/sdkerrors/getresizedphoto.go create mode 100644 models/sdkerrors/getsearchresults.go create mode 100644 models/sdkerrors/getserveractivities.go create mode 100644 models/sdkerrors/getservercapabilities.go create mode 100644 models/sdkerrors/getserveridentity.go create mode 100644 models/sdkerrors/getserverlist.go create mode 100644 models/sdkerrors/getserverpreferences.go create mode 100644 models/sdkerrors/getsessionhistory.go create mode 100644 models/sdkerrors/getsessions.go create mode 100644 models/sdkerrors/getsourceconnectioninformation.go create mode 100644 models/sdkerrors/gettimeline.go create mode 100644 models/sdkerrors/gettranscodesessions.go create mode 100644 models/sdkerrors/gettransienttoken.go create mode 100644 models/sdkerrors/getupdatestatus.go create mode 100644 models/sdkerrors/logline.go create mode 100644 models/sdkerrors/logmultiline.go create mode 100644 models/sdkerrors/markplayed.go create mode 100644 models/sdkerrors/markunplayed.go create mode 100644 models/sdkerrors/performsearch.go create mode 100644 models/sdkerrors/performvoicesearch.go create mode 100644 models/sdkerrors/refreshlibrary.go create mode 100644 models/sdkerrors/sdkerror.go create mode 100644 models/sdkerrors/startalltasks.go create mode 100644 models/sdkerrors/starttask.go create mode 100644 models/sdkerrors/startuniversaltranscode.go create mode 100644 models/sdkerrors/stopalltasks.go create mode 100644 models/sdkerrors/stoptask.go create mode 100644 models/sdkerrors/stoptranscodesession.go create mode 100644 models/sdkerrors/updateplaylist.go create mode 100644 models/sdkerrors/updateplayprogress.go create mode 100644 models/sdkerrors/uploadplaylist.go create mode 100644 playlists.go create mode 100644 plexapi.go create mode 100644 search.go create mode 100644 security.go create mode 100644 server.go create mode 100644 sessions.go create mode 100644 types/bigint.go create mode 100644 types/date.go create mode 100644 types/datetime.go create mode 100644 types/decimal.go create mode 100644 types/pointers.go create mode 100644 updater.go create mode 100644 video.go diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..e6a9944 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# This allows generated code to be indexed correctly +*.go linguist-generated=false \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d3c2f59 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +# .gitignore diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock new file mode 100755 index 0000000..1caad7e --- /dev/null +++ b/.speakeasy/gen.lock @@ -0,0 +1,474 @@ +lockVersion: 2.0.0 +id: dfa99515-01c0-42eb-9be5-ee212fd03eb3 +management: + docChecksum: 550154cf1b4d0c237436fb18c418b5db + docVersion: 0.0.3 + speakeasyVersion: internal + generationVersion: 2.228.1 + releaseVersion: 0.0.1 + configChecksum: 17cc95530e519354b089a256cb0ca7f6 + repoURL: https://github.com/LukeHagar/plexgo.git + repoSubDirectory: . + installationURL: https://github.com/LukeHagar/plexgo + published: true +features: + go: + constsAndDefaults: 0.1.2 + core: 3.3.0 + flattening: 2.81.1 + globalSecurity: 2.82.3 + globalServerURLs: 2.82.1 + nameOverrides: 2.81.1 +generatedFiles: + - server.go + - media.go + - activities.go + - butler.go + - hubs.go + - search.go + - library.go + - log.go + - playlists.go + - security.go + - sessions.go + - updater.go + - video.go + - plexapi.go + - go.mod + - go.sum + - tests/helpers.go + - models/sdkerrors/sdkerror.go + - types/bigint.go + - types/date.go + - types/datetime.go + - types/decimal.go + - types/pointers.go + - internal/utils/contenttype.go + - internal/utils/form.go + - internal/utils/headers.go + - internal/utils/json.go + - internal/utils/pathparams.go + - internal/utils/queryparams.go + - internal/utils/requestbody.go + - internal/utils/retries.go + - internal/utils/security.go + - internal/utils/utils.go + - /models/operations/getservercapabilities.go + - /models/operations/getserverpreferences.go + - /models/operations/getavailableclients.go + - /models/operations/getdevices.go + - /models/operations/getserveridentity.go + - /models/operations/getmyplexaccount.go + - /models/operations/getresizedphoto.go + - /models/operations/getserverlist.go + - /models/operations/markplayed.go + - /models/operations/markunplayed.go + - /models/operations/updateplayprogress.go + - /models/operations/getserveractivities.go + - /models/operations/cancelserveractivities.go + - /models/operations/getbutlertasks.go + - /models/operations/startalltasks.go + - /models/operations/stopalltasks.go + - /models/operations/starttask.go + - /models/operations/stoptask.go + - /models/operations/getglobalhubs.go + - /models/operations/getlibraryhubs.go + - /models/operations/performsearch.go + - /models/operations/performvoicesearch.go + - /models/operations/getsearchresults.go + - /models/operations/getfilehash.go + - /models/operations/getrecentlyadded.go + - /models/operations/getlibraries.go + - /models/operations/getlibrary.go + - /models/operations/deletelibrary.go + - /models/operations/getlibraryitems.go + - /models/operations/refreshlibrary.go + - /models/operations/getlatestlibraryitems.go + - /models/operations/getcommonlibraryitems.go + - /models/operations/getmetadata.go + - /models/operations/getmetadatachildren.go + - /models/operations/getondeck.go + - /models/operations/logline.go + - /models/operations/logmultiline.go + - /models/operations/enablepapertrail.go + - /models/operations/createplaylist.go + - /models/operations/getplaylists.go + - /models/operations/getplaylist.go + - /models/operations/deleteplaylist.go + - /models/operations/updateplaylist.go + - /models/operations/getplaylistcontents.go + - /models/operations/clearplaylistcontents.go + - /models/operations/addplaylistcontents.go + - /models/operations/uploadplaylist.go + - /models/operations/gettransienttoken.go + - /models/operations/getsourceconnectioninformation.go + - /models/operations/getsessions.go + - /models/operations/getsessionhistory.go + - /models/operations/gettranscodesessions.go + - /models/operations/stoptranscodesession.go + - /models/operations/getupdatestatus.go + - /models/operations/checkforupdates.go + - /models/operations/applyupdates.go + - /models/operations/startuniversaltranscode.go + - /models/operations/gettimeline.go + - /models/sdkerrors/getservercapabilities.go + - /models/sdkerrors/getserverpreferences.go + - /models/sdkerrors/getavailableclients.go + - /models/sdkerrors/getdevices.go + - /models/sdkerrors/getserveridentity.go + - /models/sdkerrors/getmyplexaccount.go + - /models/sdkerrors/getresizedphoto.go + - /models/sdkerrors/getserverlist.go + - /models/sdkerrors/markplayed.go + - /models/sdkerrors/markunplayed.go + - /models/sdkerrors/updateplayprogress.go + - /models/sdkerrors/getserveractivities.go + - /models/sdkerrors/cancelserveractivities.go + - /models/sdkerrors/getbutlertasks.go + - /models/sdkerrors/startalltasks.go + - /models/sdkerrors/stopalltasks.go + - /models/sdkerrors/starttask.go + - /models/sdkerrors/stoptask.go + - /models/sdkerrors/getglobalhubs.go + - /models/sdkerrors/getlibraryhubs.go + - /models/sdkerrors/performsearch.go + - /models/sdkerrors/performvoicesearch.go + - /models/sdkerrors/getsearchresults.go + - /models/sdkerrors/getfilehash.go + - /models/sdkerrors/getrecentlyadded.go + - /models/sdkerrors/getlibraries.go + - /models/sdkerrors/getlibrary.go + - /models/sdkerrors/deletelibrary.go + - /models/sdkerrors/getlibraryitems.go + - /models/sdkerrors/refreshlibrary.go + - /models/sdkerrors/getlatestlibraryitems.go + - /models/sdkerrors/getcommonlibraryitems.go + - /models/sdkerrors/getmetadata.go + - /models/sdkerrors/getmetadatachildren.go + - /models/sdkerrors/getondeck.go + - /models/sdkerrors/logline.go + - /models/sdkerrors/logmultiline.go + - /models/sdkerrors/enablepapertrail.go + - /models/sdkerrors/createplaylist.go + - /models/sdkerrors/getplaylists.go + - /models/sdkerrors/getplaylist.go + - /models/sdkerrors/deleteplaylist.go + - /models/sdkerrors/updateplaylist.go + - /models/sdkerrors/getplaylistcontents.go + - /models/sdkerrors/clearplaylistcontents.go + - /models/sdkerrors/addplaylistcontents.go + - /models/sdkerrors/uploadplaylist.go + - /models/sdkerrors/gettransienttoken.go + - /models/sdkerrors/getsourceconnectioninformation.go + - /models/sdkerrors/getsessions.go + - /models/sdkerrors/getsessionhistory.go + - /models/sdkerrors/gettranscodesessions.go + - /models/sdkerrors/stoptranscodesession.go + - /models/sdkerrors/getupdatestatus.go + - /models/sdkerrors/checkforupdates.go + - /models/sdkerrors/applyupdates.go + - /models/sdkerrors/startuniversaltranscode.go + - /models/sdkerrors/gettimeline.go + - /models/components/security.go + - docs/models/operations/directory.md + - docs/models/operations/mediacontainer.md + - docs/models/operations/getservercapabilitiesresponsebody.md + - docs/models/operations/getservercapabilitiesresponse.md + - docs/models/operations/getserverpreferencesresponse.md + - docs/models/operations/server.md + - docs/models/operations/getavailableclientsmediacontainer.md + - docs/models/operations/responsebody.md + - docs/models/operations/getavailableclientsresponse.md + - docs/models/operations/device.md + - docs/models/operations/getdevicesmediacontainer.md + - docs/models/operations/getdevicesresponsebody.md + - docs/models/operations/getdevicesresponse.md + - docs/models/operations/getserveridentitymediacontainer.md + - docs/models/operations/getserveridentityresponsebody.md + - docs/models/operations/getserveridentityresponse.md + - docs/models/operations/myplex.md + - docs/models/operations/getmyplexaccountresponsebody.md + - docs/models/operations/getmyplexaccountresponse.md + - docs/models/operations/minsize.md + - docs/models/operations/upscale.md + - docs/models/operations/getresizedphotorequest.md + - docs/models/operations/getresizedphotoresponse.md + - docs/models/operations/getserverlistserver.md + - docs/models/operations/getserverlistmediacontainer.md + - docs/models/operations/getserverlistresponsebody.md + - docs/models/operations/getserverlistresponse.md + - docs/models/operations/markplayedrequest.md + - docs/models/operations/markplayedresponse.md + - docs/models/operations/markunplayedrequest.md + - docs/models/operations/markunplayedresponse.md + - docs/models/operations/updateplayprogressrequest.md + - docs/models/operations/updateplayprogressresponse.md + - docs/models/operations/context.md + - docs/models/operations/activity.md + - docs/models/operations/getserveractivitiesmediacontainer.md + - docs/models/operations/getserveractivitiesresponsebody.md + - docs/models/operations/getserveractivitiesresponse.md + - docs/models/operations/cancelserveractivitiesrequest.md + - docs/models/operations/cancelserveractivitiesresponse.md + - docs/models/operations/butlertask.md + - docs/models/operations/butlertasks.md + - docs/models/operations/getbutlertasksresponsebody.md + - docs/models/operations/getbutlertasksresponse.md + - docs/models/operations/startalltasksresponse.md + - docs/models/operations/stopalltasksresponse.md + - docs/models/operations/taskname.md + - docs/models/operations/starttaskrequest.md + - docs/models/operations/starttaskresponse.md + - docs/models/operations/pathparamtaskname.md + - docs/models/operations/stoptaskrequest.md + - docs/models/operations/stoptaskresponse.md + - docs/models/operations/onlytransient.md + - docs/models/operations/getglobalhubsrequest.md + - docs/models/operations/getglobalhubsresponse.md + - docs/models/operations/queryparamonlytransient.md + - docs/models/operations/getlibraryhubsrequest.md + - docs/models/operations/getlibraryhubsresponse.md + - docs/models/operations/performsearchrequest.md + - docs/models/operations/performsearchresponse.md + - docs/models/operations/performvoicesearchrequest.md + - docs/models/operations/performvoicesearchresponse.md + - docs/models/operations/getsearchresultsrequest.md + - docs/models/operations/getsearchresultspart.md + - docs/models/operations/getsearchresultsmedia.md + - docs/models/operations/getsearchresultsgenre.md + - docs/models/operations/getsearchresultsdirector.md + - docs/models/operations/getsearchresultswriter.md + - docs/models/operations/getsearchresultscountry.md + - docs/models/operations/getsearchresultsrole.md + - docs/models/operations/getsearchresultsmetadata.md + - docs/models/operations/provider.md + - docs/models/operations/getsearchresultsmediacontainer.md + - docs/models/operations/getsearchresultsresponsebody.md + - docs/models/operations/getsearchresultsresponse.md + - docs/models/operations/getfilehashrequest.md + - docs/models/operations/getfilehashresponse.md + - docs/models/operations/part.md + - docs/models/operations/media.md + - docs/models/operations/genre.md + - docs/models/operations/director.md + - docs/models/operations/writer.md + - docs/models/operations/country.md + - docs/models/operations/role.md + - docs/models/operations/metadata.md + - docs/models/operations/getrecentlyaddedmediacontainer.md + - docs/models/operations/getrecentlyaddedresponsebody.md + - docs/models/operations/getrecentlyaddedresponse.md + - docs/models/operations/getlibrariesresponse.md + - docs/models/operations/includedetails.md + - docs/models/operations/getlibraryrequest.md + - docs/models/operations/getlibraryresponse.md + - docs/models/operations/deletelibraryrequest.md + - docs/models/operations/deletelibraryresponse.md + - docs/models/operations/getlibraryitemsrequest.md + - docs/models/operations/getlibraryitemsresponse.md + - docs/models/operations/refreshlibraryrequest.md + - docs/models/operations/refreshlibraryresponse.md + - docs/models/operations/getlatestlibraryitemsrequest.md + - docs/models/operations/getlatestlibraryitemsresponse.md + - docs/models/operations/getcommonlibraryitemsrequest.md + - docs/models/operations/getcommonlibraryitemsresponse.md + - docs/models/operations/getmetadatarequest.md + - docs/models/operations/getmetadataresponse.md + - docs/models/operations/getmetadatachildrenrequest.md + - docs/models/operations/getmetadatachildrenresponse.md + - docs/models/operations/stream.md + - docs/models/operations/getondeckpart.md + - docs/models/operations/getondeckmedia.md + - docs/models/operations/guids.md + - docs/models/operations/getondeckmetadata.md + - docs/models/operations/getondeckmediacontainer.md + - docs/models/operations/getondeckresponsebody.md + - docs/models/operations/getondeckresponse.md + - docs/models/operations/level.md + - docs/models/operations/loglinerequest.md + - docs/models/operations/loglineresponse.md + - docs/models/operations/logmultilineresponse.md + - docs/models/operations/enablepapertrailresponse.md + - docs/models/operations/type.md + - docs/models/operations/smart.md + - docs/models/operations/createplaylistrequest.md + - docs/models/operations/createplaylistresponse.md + - docs/models/operations/playlisttype.md + - docs/models/operations/queryparamsmart.md + - docs/models/operations/getplaylistsrequest.md + - docs/models/operations/getplaylistsresponse.md + - docs/models/operations/getplaylistrequest.md + - docs/models/operations/getplaylistresponse.md + - docs/models/operations/deleteplaylistrequest.md + - docs/models/operations/deleteplaylistresponse.md + - docs/models/operations/updateplaylistrequest.md + - docs/models/operations/updateplaylistresponse.md + - docs/models/operations/getplaylistcontentsrequest.md + - docs/models/operations/getplaylistcontentsresponse.md + - docs/models/operations/clearplaylistcontentsrequest.md + - docs/models/operations/clearplaylistcontentsresponse.md + - docs/models/operations/addplaylistcontentsrequest.md + - docs/models/operations/addplaylistcontentsresponse.md + - docs/models/operations/force.md + - docs/models/operations/uploadplaylistrequest.md + - docs/models/operations/uploadplaylistresponse.md + - docs/models/operations/queryparamtype.md + - docs/models/operations/scope.md + - docs/models/operations/gettransienttokenrequest.md + - docs/models/operations/gettransienttokenresponse.md + - docs/models/operations/getsourceconnectioninformationrequest.md + - docs/models/operations/getsourceconnectioninformationresponse.md + - docs/models/operations/getsessionsresponse.md + - docs/models/operations/getsessionhistoryresponse.md + - docs/models/operations/transcodesession.md + - docs/models/operations/gettranscodesessionsmediacontainer.md + - docs/models/operations/gettranscodesessionsresponsebody.md + - docs/models/operations/gettranscodesessionsresponse.md + - docs/models/operations/stoptranscodesessionrequest.md + - docs/models/operations/stoptranscodesessionresponse.md + - docs/models/operations/getupdatestatusresponse.md + - docs/models/operations/download.md + - docs/models/operations/checkforupdatesrequest.md + - docs/models/operations/checkforupdatesresponse.md + - docs/models/operations/tonight.md + - docs/models/operations/skip.md + - docs/models/operations/applyupdatesrequest.md + - docs/models/operations/applyupdatesresponse.md + - docs/models/operations/startuniversaltranscoderequest.md + - docs/models/operations/startuniversaltranscoderesponse.md + - docs/models/operations/state.md + - docs/models/operations/gettimelinerequest.md + - docs/models/operations/gettimelineresponse.md + - docs/models/sdkerrors/errors.md + - docs/models/sdkerrors/getservercapabilitiesresponsebody.md + - docs/models/sdkerrors/getserverpreferenceserrors.md + - docs/models/sdkerrors/getserverpreferencesresponsebody.md + - docs/models/sdkerrors/getavailableclientserrors.md + - docs/models/sdkerrors/getavailableclientsresponsebody.md + - docs/models/sdkerrors/getdeviceserrors.md + - docs/models/sdkerrors/getdevicesresponsebody.md + - docs/models/sdkerrors/getserveridentityerrors.md + - docs/models/sdkerrors/getserveridentityresponsebody.md + - docs/models/sdkerrors/getmyplexaccounterrors.md + - docs/models/sdkerrors/getmyplexaccountresponsebody.md + - docs/models/sdkerrors/getresizedphotoerrors.md + - docs/models/sdkerrors/getresizedphotoresponsebody.md + - docs/models/sdkerrors/getserverlisterrors.md + - docs/models/sdkerrors/getserverlistresponsebody.md + - docs/models/sdkerrors/markplayederrors.md + - docs/models/sdkerrors/markplayedresponsebody.md + - docs/models/sdkerrors/markunplayederrors.md + - docs/models/sdkerrors/markunplayedresponsebody.md + - docs/models/sdkerrors/updateplayprogresserrors.md + - docs/models/sdkerrors/updateplayprogressresponsebody.md + - docs/models/sdkerrors/getserveractivitieserrors.md + - docs/models/sdkerrors/getserveractivitiesresponsebody.md + - docs/models/sdkerrors/cancelserveractivitieserrors.md + - docs/models/sdkerrors/cancelserveractivitiesresponsebody.md + - docs/models/sdkerrors/getbutlertaskserrors.md + - docs/models/sdkerrors/getbutlertasksresponsebody.md + - docs/models/sdkerrors/startalltaskserrors.md + - docs/models/sdkerrors/startalltasksresponsebody.md + - docs/models/sdkerrors/stopalltaskserrors.md + - docs/models/sdkerrors/stopalltasksresponsebody.md + - docs/models/sdkerrors/starttaskerrors.md + - docs/models/sdkerrors/starttaskresponsebody.md + - docs/models/sdkerrors/stoptaskerrors.md + - docs/models/sdkerrors/stoptaskresponsebody.md + - docs/models/sdkerrors/getglobalhubserrors.md + - docs/models/sdkerrors/getglobalhubsresponsebody.md + - docs/models/sdkerrors/getlibraryhubserrors.md + - docs/models/sdkerrors/getlibraryhubsresponsebody.md + - docs/models/sdkerrors/performsearcherrors.md + - docs/models/sdkerrors/performsearchresponsebody.md + - docs/models/sdkerrors/performvoicesearcherrors.md + - docs/models/sdkerrors/performvoicesearchresponsebody.md + - docs/models/sdkerrors/getsearchresultserrors.md + - docs/models/sdkerrors/getsearchresultsresponsebody.md + - docs/models/sdkerrors/getfilehasherrors.md + - docs/models/sdkerrors/getfilehashresponsebody.md + - docs/models/sdkerrors/getrecentlyaddederrors.md + - docs/models/sdkerrors/getrecentlyaddedresponsebody.md + - docs/models/sdkerrors/getlibrarieserrors.md + - docs/models/sdkerrors/getlibrariesresponsebody.md + - docs/models/sdkerrors/getlibraryerrors.md + - docs/models/sdkerrors/getlibraryresponsebody.md + - docs/models/sdkerrors/deletelibraryerrors.md + - docs/models/sdkerrors/deletelibraryresponsebody.md + - docs/models/sdkerrors/getlibraryitemserrors.md + - docs/models/sdkerrors/getlibraryitemsresponsebody.md + - docs/models/sdkerrors/refreshlibraryerrors.md + - docs/models/sdkerrors/refreshlibraryresponsebody.md + - docs/models/sdkerrors/getlatestlibraryitemserrors.md + - docs/models/sdkerrors/getlatestlibraryitemsresponsebody.md + - docs/models/sdkerrors/getcommonlibraryitemserrors.md + - docs/models/sdkerrors/getcommonlibraryitemsresponsebody.md + - docs/models/sdkerrors/getmetadataerrors.md + - docs/models/sdkerrors/getmetadataresponsebody.md + - docs/models/sdkerrors/getmetadatachildrenerrors.md + - docs/models/sdkerrors/getmetadatachildrenresponsebody.md + - docs/models/sdkerrors/getondeckerrors.md + - docs/models/sdkerrors/getondeckresponsebody.md + - docs/models/sdkerrors/loglineerrors.md + - docs/models/sdkerrors/loglineresponsebody.md + - docs/models/sdkerrors/logmultilineerrors.md + - docs/models/sdkerrors/logmultilineresponsebody.md + - docs/models/sdkerrors/enablepapertrailerrors.md + - docs/models/sdkerrors/enablepapertrailresponsebody.md + - docs/models/sdkerrors/createplaylisterrors.md + - docs/models/sdkerrors/createplaylistresponsebody.md + - docs/models/sdkerrors/getplaylistserrors.md + - docs/models/sdkerrors/getplaylistsresponsebody.md + - docs/models/sdkerrors/getplaylisterrors.md + - docs/models/sdkerrors/getplaylistresponsebody.md + - docs/models/sdkerrors/deleteplaylisterrors.md + - docs/models/sdkerrors/deleteplaylistresponsebody.md + - docs/models/sdkerrors/updateplaylisterrors.md + - docs/models/sdkerrors/updateplaylistresponsebody.md + - docs/models/sdkerrors/getplaylistcontentserrors.md + - docs/models/sdkerrors/getplaylistcontentsresponsebody.md + - docs/models/sdkerrors/clearplaylistcontentserrors.md + - docs/models/sdkerrors/clearplaylistcontentsresponsebody.md + - docs/models/sdkerrors/addplaylistcontentserrors.md + - docs/models/sdkerrors/addplaylistcontentsresponsebody.md + - docs/models/sdkerrors/uploadplaylisterrors.md + - docs/models/sdkerrors/uploadplaylistresponsebody.md + - docs/models/sdkerrors/gettransienttokenerrors.md + - docs/models/sdkerrors/gettransienttokenresponsebody.md + - docs/models/sdkerrors/getsourceconnectioninformationerrors.md + - docs/models/sdkerrors/getsourceconnectioninformationresponsebody.md + - docs/models/sdkerrors/getsessionserrors.md + - docs/models/sdkerrors/getsessionsresponsebody.md + - docs/models/sdkerrors/getsessionhistoryerrors.md + - docs/models/sdkerrors/getsessionhistoryresponsebody.md + - docs/models/sdkerrors/gettranscodesessionserrors.md + - docs/models/sdkerrors/gettranscodesessionsresponsebody.md + - docs/models/sdkerrors/stoptranscodesessionerrors.md + - docs/models/sdkerrors/stoptranscodesessionresponsebody.md + - docs/models/sdkerrors/getupdatestatuserrors.md + - docs/models/sdkerrors/getupdatestatusresponsebody.md + - docs/models/sdkerrors/checkforupdateserrors.md + - docs/models/sdkerrors/checkforupdatesresponsebody.md + - docs/models/sdkerrors/applyupdateserrors.md + - docs/models/sdkerrors/applyupdatesresponsebody.md + - docs/models/sdkerrors/startuniversaltranscodeerrors.md + - docs/models/sdkerrors/startuniversaltranscoderesponsebody.md + - docs/models/sdkerrors/gettimelineerrors.md + - docs/models/sdkerrors/gettimelineresponsebody.md + - docs/models/components/security.md + - docs/sdks/plexapi/README.md + - docs/sdks/server/README.md + - docs/sdks/media/README.md + - docs/sdks/activities/README.md + - docs/sdks/butler/README.md + - docs/sdks/hubs/README.md + - docs/sdks/search/README.md + - docs/sdks/library/README.md + - docs/sdks/log/README.md + - docs/sdks/playlists/README.md + - docs/sdks/security/README.md + - docs/sdks/sessions/README.md + - docs/sdks/updater/README.md + - docs/sdks/video/README.md + - USAGE.md + - .gitattributes diff --git a/README.md b/README.md new file mode 100644 index 0000000..93cf187 --- /dev/null +++ b/README.md @@ -0,0 +1,385 @@ +# github.com/LukeHagar/plexgo + +
+ + + + +
+ + +## 🏗 **Welcome to your new SDK!** 🏗 + +It has been generated successfully based on your OpenAPI spec. However, it is not yet ready for production use. Here are some next steps: +- [ ] 🛠 Make your SDK feel handcrafted by [customizing it](https://www.speakeasyapi.dev/docs/customize-sdks) +- [ ] ♻️ Refine your SDK quickly by iterating locally with the [Speakeasy CLI](https://github.com/speakeasy-api/speakeasy) +- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks) +- [ ] ✨ When ready to productionize, delete this section from the README + + +## SDK Installation + +```bash +go get github.com/LukeHagar/plexgo +``` + + + +## SDK Example Usage + +### Example + +```go +package main + +import ( + "context" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} + +``` + + + +## Available Resources and Operations + +### [Server](docs/sdks/server/README.md) + +* [GetServerCapabilities](docs/sdks/server/README.md#getservercapabilities) - Server Capabilities +* [GetServerPreferences](docs/sdks/server/README.md#getserverpreferences) - Get Server Preferences +* [GetAvailableClients](docs/sdks/server/README.md#getavailableclients) - Get Available Clients +* [GetDevices](docs/sdks/server/README.md#getdevices) - Get Devices +* [GetServerIdentity](docs/sdks/server/README.md#getserveridentity) - Get Server Identity +* [GetMyPlexAccount](docs/sdks/server/README.md#getmyplexaccount) - Get MyPlex Account +* [GetResizedPhoto](docs/sdks/server/README.md#getresizedphoto) - Get a Resized Photo +* [GetServerList](docs/sdks/server/README.md#getserverlist) - Get Server List + +### [Media](docs/sdks/media/README.md) + +* [MarkPlayed](docs/sdks/media/README.md#markplayed) - Mark Media Played +* [MarkUnplayed](docs/sdks/media/README.md#markunplayed) - Mark Media Unplayed +* [UpdatePlayProgress](docs/sdks/media/README.md#updateplayprogress) - Update Media Play Progress + +### [Activities](docs/sdks/activities/README.md) + +* [GetServerActivities](docs/sdks/activities/README.md#getserveractivities) - Get Server Activities +* [CancelServerActivities](docs/sdks/activities/README.md#cancelserveractivities) - Cancel Server Activities + +### [Butler](docs/sdks/butler/README.md) + +* [GetButlerTasks](docs/sdks/butler/README.md#getbutlertasks) - Get Butler tasks +* [StartAllTasks](docs/sdks/butler/README.md#startalltasks) - Start all Butler tasks +* [StopAllTasks](docs/sdks/butler/README.md#stopalltasks) - Stop all Butler tasks +* [StartTask](docs/sdks/butler/README.md#starttask) - Start a single Butler task +* [StopTask](docs/sdks/butler/README.md#stoptask) - Stop a single Butler task + +### [Hubs](docs/sdks/hubs/README.md) + +* [GetGlobalHubs](docs/sdks/hubs/README.md#getglobalhubs) - Get Global Hubs +* [GetLibraryHubs](docs/sdks/hubs/README.md#getlibraryhubs) - Get library specific hubs + +### [Search](docs/sdks/search/README.md) + +* [PerformSearch](docs/sdks/search/README.md#performsearch) - Perform a search +* [PerformVoiceSearch](docs/sdks/search/README.md#performvoicesearch) - Perform a voice search +* [GetSearchResults](docs/sdks/search/README.md#getsearchresults) - Get Search Results + +### [Library](docs/sdks/library/README.md) + +* [GetFileHash](docs/sdks/library/README.md#getfilehash) - Get Hash Value +* [GetRecentlyAdded](docs/sdks/library/README.md#getrecentlyadded) - Get Recently Added +* [GetLibraries](docs/sdks/library/README.md#getlibraries) - Get All Libraries +* [GetLibrary](docs/sdks/library/README.md#getlibrary) - Get Library Details +* [DeleteLibrary](docs/sdks/library/README.md#deletelibrary) - Delete Library Section +* [GetLibraryItems](docs/sdks/library/README.md#getlibraryitems) - Get Library Items +* [RefreshLibrary](docs/sdks/library/README.md#refreshlibrary) - Refresh Library +* [GetLatestLibraryItems](docs/sdks/library/README.md#getlatestlibraryitems) - Get Latest Library Items +* [GetCommonLibraryItems](docs/sdks/library/README.md#getcommonlibraryitems) - Get Common Library Items +* [GetMetadata](docs/sdks/library/README.md#getmetadata) - Get Items Metadata +* [GetMetadataChildren](docs/sdks/library/README.md#getmetadatachildren) - Get Items Children +* [GetOnDeck](docs/sdks/library/README.md#getondeck) - Get On Deck + +### [Log](docs/sdks/log/README.md) + +* [LogLine](docs/sdks/log/README.md#logline) - Logging a single line message. +* [LogMultiLine](docs/sdks/log/README.md#logmultiline) - Logging a multi-line message +* [EnablePaperTrail](docs/sdks/log/README.md#enablepapertrail) - Enabling Papertrail + +### [Playlists](docs/sdks/playlists/README.md) + +* [CreatePlaylist](docs/sdks/playlists/README.md#createplaylist) - Create a Playlist +* [GetPlaylists](docs/sdks/playlists/README.md#getplaylists) - Get All Playlists +* [GetPlaylist](docs/sdks/playlists/README.md#getplaylist) - Retrieve Playlist +* [DeletePlaylist](docs/sdks/playlists/README.md#deleteplaylist) - Deletes a Playlist +* [UpdatePlaylist](docs/sdks/playlists/README.md#updateplaylist) - Update a Playlist +* [GetPlaylistContents](docs/sdks/playlists/README.md#getplaylistcontents) - Retrieve Playlist Contents +* [ClearPlaylistContents](docs/sdks/playlists/README.md#clearplaylistcontents) - Delete Playlist Contents +* [AddPlaylistContents](docs/sdks/playlists/README.md#addplaylistcontents) - Adding to a Playlist +* [UploadPlaylist](docs/sdks/playlists/README.md#uploadplaylist) - Upload Playlist + +### [Security](docs/sdks/security/README.md) + +* [GetTransientToken](docs/sdks/security/README.md#gettransienttoken) - Get a Transient Token. +* [GetSourceConnectionInformation](docs/sdks/security/README.md#getsourceconnectioninformation) - Get Source Connection Information + +### [Sessions](docs/sdks/sessions/README.md) + +* [GetSessions](docs/sdks/sessions/README.md#getsessions) - Get Active Sessions +* [GetSessionHistory](docs/sdks/sessions/README.md#getsessionhistory) - Get Session History +* [GetTranscodeSessions](docs/sdks/sessions/README.md#gettranscodesessions) - Get Transcode Sessions +* [StopTranscodeSession](docs/sdks/sessions/README.md#stoptranscodesession) - Stop a Transcode Session + +### [Updater](docs/sdks/updater/README.md) + +* [GetUpdateStatus](docs/sdks/updater/README.md#getupdatestatus) - Querying status of updates +* [CheckForUpdates](docs/sdks/updater/README.md#checkforupdates) - Checking for updates +* [ApplyUpdates](docs/sdks/updater/README.md#applyupdates) - Apply Updates + +### [Video](docs/sdks/video/README.md) + +* [StartUniversalTranscode](docs/sdks/video/README.md#startuniversaltranscode) - Start Universal Transcode +* [GetTimeline](docs/sdks/video/README.md#gettimeline) - Get the timeline for a media item + + + +## Error Handling + +Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass. + +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| sdkerrors.GetServerCapabilitiesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +### Example + +```go +package main + +import ( + "context" + "errors" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + + var e *sdkerrors.GetServerCapabilitiesResponseBody + if errors.As(err, &e) { + // handle error + log.Fatal(e.Error()) + } + + var e *sdkerrors.SDKError + if errors.As(err, &e) { + // handle error + log.Fatal(e.Error()) + } + } +} + +``` + + + +## Server Selection + +### Select Server by Index + +You can override the default server globally using the `WithServerIndex` option 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 | `http://10.10.10.47:32400` | None | +| 1 | `{protocol}://{ip}:{port}` | `protocol` (default is `http`), `ip` (default is `10.10.10.47`), `port` (default is `32400`) | + +#### Example + +```go +package main + +import ( + "context" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithServerIndex(1), + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} + +``` + +#### Variables + +Some of the server options above contain variables. If you want to set the values of those variables, the following options are provided for doing so: + * `WithProtocol plexgo.ServerProtocol` + * `WithIP string` + * `WithPort string` + +### Override Server URL Per-Client + +The default server can also be overridden globally using the `WithServerURL` option when initializing the SDK client instance. For example: +```go +package main + +import ( + "context" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithServerURL("http://10.10.10.47:32400"), + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} + +``` + + + +## Custom HTTP Client + +The Go SDK makes API calls that wrap an internal HTTP client. The requirements for the HTTP client are very simple. It must match this interface: + +```go +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} +``` + +The built-in `net/http` client satisfies this interface and a default client based on the built-in is provided by default. To replace this default with a client of your own, you can implement this interface yourself or provide your own client configured as desired. Here's a simple example, which adds a client with a 30 second timeout. + +```go +import ( + "net/http" + "time" + "github.com/myorg/your-go-sdk" +) + +var ( + httpClient = &http.Client{Timeout: 30 * time.Second} + sdkClient = sdk.New(sdk.WithClient(httpClient)) +) +``` + +This can be a convenient way to configure timeouts, cookies, proxies, custom headers, and other low-level configuration. + + + +## Authentication + +### Per-Client Security Schemes + +This SDK supports the following security scheme globally: + +| Name | Type | Scheme | +| ------------- | ------------- | ------------- | +| `AccessToken` | apiKey | API key | + +You can configure it using the `WithSecurity` option when initializing the SDK client instance. For example: +```go +package main + +import ( + "context" + "github.com/LukeHagar/plexgo" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} + +``` + + + +## Special Types + + + + + + +# Development + +## Maturity + +This SDK is in beta, and there may be breaking changes between versions without a major version update. Therefore, we recommend pinning usage +to a specific package version. This way, you can install the same version each time without breaking changes unless you are intentionally +looking for the latest version. + +## Contributions + +While we value open-source contributions to this SDK, this library is generated programmatically. +Feel free to open a PR or a Github issue as a proof of concept and we'll do our best to include it in a future release! + +### SDK Created by [Speakeasy](https://docs.speakeasyapi.dev/docs/using-speakeasy/client-sdks) diff --git a/RELEASES.md b/RELEASES.md new file mode 100644 index 0000000..729e921 --- /dev/null +++ b/RELEASES.md @@ -0,0 +1,11 @@ + + +## 2024-01-05 19:39:38 +### Changes +Based on: +- OpenAPI Doc 0.0.3 +- Speakeasy CLI 1.133.1 (2.228.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [go v0.0.1] . +### Releases +- [Go v0.0.1] https://github.com/LukeHagar/plexgo/releases/tag/v0.0.1 - . \ No newline at end of file diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..471773e --- /dev/null +++ b/USAGE.md @@ -0,0 +1,29 @@ + +```go +package main + +import ( + "context" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/components" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} + +``` + \ No newline at end of file diff --git a/activities.go b/activities.go new file mode 100644 index 0000000..f41dc05 --- /dev/null +++ b/activities.go @@ -0,0 +1,176 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. +// Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. +// Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: +// - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. +// - They must contain an `type` which is used by clients to distinguish the specific activity. +// - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) +// - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. +type Activities struct { + sdkConfiguration sdkConfiguration +} + +func newActivities(sdkConfig sdkConfiguration) *Activities { + return &Activities{ + sdkConfiguration: sdkConfig, + } +} + +// GetServerActivities - Get Server Activities +// Get Server Activities +func (s *Activities) GetServerActivities(ctx context.Context) (*operations.GetServerActivitiesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/activities" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetServerActivitiesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetServerActivitiesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetServerActivitiesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// CancelServerActivities - Cancel Server Activities +// Cancel Server Activities +func (s *Activities) CancelServerActivities(ctx context.Context, activityUUID string) (*operations.CancelServerActivitiesResponse, error) { + request := operations.CancelServerActivitiesRequest{ + ActivityUUID: activityUUID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/activities/{activityUUID}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CancelServerActivitiesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.CancelServerActivitiesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/butler.go b/butler.go new file mode 100644 index 0000000..06ba299 --- /dev/null +++ b/butler.go @@ -0,0 +1,378 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Butler is the task manager of the Plex Media Server Ecosystem. +type Butler struct { + sdkConfiguration sdkConfiguration +} + +func newButler(sdkConfig sdkConfiguration) *Butler { + return &Butler{ + sdkConfiguration: sdkConfig, + } +} + +// GetButlerTasks - Get Butler tasks +// Returns a list of butler tasks +func (s *Butler) GetButlerTasks(ctx context.Context) (*operations.GetButlerTasksResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/butler" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetButlerTasksResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetButlerTasksResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetButlerTasksResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// StartAllTasks - Start all Butler tasks +// This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: +// 1. Any tasks not scheduled to run on the current day will be skipped. +// 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. +// 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. +// 4. If we are outside the configured window, the task will start immediately. +func (s *Butler) StartAllTasks(ctx context.Context) (*operations.StartAllTasksResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/butler" + + req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.StartAllTasksResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.StartAllTasksResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// StopAllTasks - Stop all Butler tasks +// This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. +func (s *Butler) StopAllTasks(ctx context.Context) (*operations.StopAllTasksResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/butler" + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.StopAllTasksResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.StopAllTasksResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// StartTask - Start a single Butler task +// This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: +// 1. Any tasks not scheduled to run on the current day will be skipped. +// 2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. +// 3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. +// 4. If we are outside the configured window, the task will start immediately. +func (s *Butler) StartTask(ctx context.Context, taskName operations.TaskName) (*operations.StartTaskResponse, error) { + request := operations.StartTaskRequest{ + TaskName: taskName, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.StartTaskResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + fallthrough + case httpRes.StatusCode == 202: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.StartTaskResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// StopTask - Stop a single Butler task +// This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. +func (s *Butler) StopTask(ctx context.Context, taskName operations.PathParamTaskName) (*operations.StopTaskResponse, error) { + request := operations.StopTaskRequest{ + TaskName: taskName, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/butler/{taskName}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.StopTaskResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.StopTaskResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/docs/models/components/security.md b/docs/models/components/security.md new file mode 100644 index 0000000..cd7c168 --- /dev/null +++ b/docs/models/components/security.md @@ -0,0 +1,8 @@ +# Security + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `AccessToken` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/activity.md b/docs/models/operations/activity.md new file mode 100644 index 0000000..844341d --- /dev/null +++ b/docs/models/operations/activity.md @@ -0,0 +1,15 @@ +# Activity + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `UUID` | **string* | :heavy_minus_sign: | N/A | +| `Type` | **string* | :heavy_minus_sign: | N/A | +| `Cancellable` | **bool* | :heavy_minus_sign: | N/A | +| `UserID` | **float64* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | +| `Subtitle` | **string* | :heavy_minus_sign: | N/A | +| `Progress` | **float64* | :heavy_minus_sign: | N/A | +| `Context` | [*operations.Context](../../models/operations/context.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/addplaylistcontentsrequest.md b/docs/models/operations/addplaylistcontentsrequest.md new file mode 100644 index 0000000..fb18927 --- /dev/null +++ b/docs/models/operations/addplaylistcontentsrequest.md @@ -0,0 +1,10 @@ +# AddPlaylistContentsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | | +| `URI` | *string* | :heavy_check_mark: | the content URI for the playlist | library://.. | +| `PlayQueueID` | *float64* | :heavy_check_mark: | the play queue to add to a playlist | 123 | \ No newline at end of file diff --git a/docs/models/operations/addplaylistcontentsresponse.md b/docs/models/operations/addplaylistcontentsresponse.md new file mode 100644 index 0000000..4679ed7 --- /dev/null +++ b/docs/models/operations/addplaylistcontentsresponse.md @@ -0,0 +1,10 @@ +# AddPlaylistContentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/applyupdatesrequest.md b/docs/models/operations/applyupdatesrequest.md new file mode 100644 index 0000000..3bf991b --- /dev/null +++ b/docs/models/operations/applyupdatesrequest.md @@ -0,0 +1,9 @@ +# ApplyUpdatesRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | 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 | +| `Skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | \ No newline at end of file diff --git a/docs/models/operations/applyupdatesresponse.md b/docs/models/operations/applyupdatesresponse.md new file mode 100644 index 0000000..20c50e4 --- /dev/null +++ b/docs/models/operations/applyupdatesresponse.md @@ -0,0 +1,10 @@ +# ApplyUpdatesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/butlertask.md b/docs/models/operations/butlertask.md new file mode 100644 index 0000000..6719ed9 --- /dev/null +++ b/docs/models/operations/butlertask.md @@ -0,0 +1,13 @@ +# ButlerTask + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | BackupDatabase | +| `Interval` | **float64* | :heavy_minus_sign: | N/A | 3 | +| `ScheduleRandomized` | **bool* | :heavy_minus_sign: | N/A | | +| `Enabled` | **bool* | :heavy_minus_sign: | N/A | | +| `Title` | **string* | :heavy_minus_sign: | N/A | Backup Database | +| `Description` | **string* | :heavy_minus_sign: | N/A | Create a backup copy of the server's database in the configured backup directory | \ No newline at end of file diff --git a/docs/models/operations/butlertasks.md b/docs/models/operations/butlertasks.md new file mode 100644 index 0000000..9b1bf61 --- /dev/null +++ b/docs/models/operations/butlertasks.md @@ -0,0 +1,8 @@ +# ButlerTasks + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | +| `ButlerTask` | [][operations.ButlerTask](../../models/operations/butlertask.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/cancelserveractivitiesrequest.md b/docs/models/operations/cancelserveractivitiesrequest.md new file mode 100644 index 0000000..d4bf7ee --- /dev/null +++ b/docs/models/operations/cancelserveractivitiesrequest.md @@ -0,0 +1,8 @@ +# CancelServerActivitiesRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | +| `ActivityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | \ No newline at end of file diff --git a/docs/models/operations/cancelserveractivitiesresponse.md b/docs/models/operations/cancelserveractivitiesresponse.md new file mode 100644 index 0000000..e5c0f9f --- /dev/null +++ b/docs/models/operations/cancelserveractivitiesresponse.md @@ -0,0 +1,10 @@ +# CancelServerActivitiesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/checkforupdatesrequest.md b/docs/models/operations/checkforupdatesrequest.md new file mode 100644 index 0000000..704dfcc --- /dev/null +++ b/docs/models/operations/checkforupdatesrequest.md @@ -0,0 +1,8 @@ +# CheckForUpdatesRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `Download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | \ No newline at end of file diff --git a/docs/models/operations/checkforupdatesresponse.md b/docs/models/operations/checkforupdatesresponse.md new file mode 100644 index 0000000..fd64d66 --- /dev/null +++ b/docs/models/operations/checkforupdatesresponse.md @@ -0,0 +1,10 @@ +# CheckForUpdatesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/clearplaylistcontentsrequest.md b/docs/models/operations/clearplaylistcontentsrequest.md new file mode 100644 index 0000000..d3aec97 --- /dev/null +++ b/docs/models/operations/clearplaylistcontentsrequest.md @@ -0,0 +1,8 @@ +# ClearPlaylistContentsRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | \ No newline at end of file diff --git a/docs/models/operations/clearplaylistcontentsresponse.md b/docs/models/operations/clearplaylistcontentsresponse.md new file mode 100644 index 0000000..bee2ea1 --- /dev/null +++ b/docs/models/operations/clearplaylistcontentsresponse.md @@ -0,0 +1,10 @@ +# ClearPlaylistContentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/context.md b/docs/models/operations/context.md new file mode 100644 index 0000000..93475f0 --- /dev/null +++ b/docs/models/operations/context.md @@ -0,0 +1,8 @@ +# Context + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `LibrarySectionID` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/country.md b/docs/models/operations/country.md new file mode 100644 index 0000000..a3f5fe0 --- /dev/null +++ b/docs/models/operations/country.md @@ -0,0 +1,8 @@ +# Country + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/models/operations/createplaylistrequest.md b/docs/models/operations/createplaylistrequest.md new file mode 100644 index 0000000..62d9d59 --- /dev/null +++ b/docs/models/operations/createplaylistrequest.md @@ -0,0 +1,12 @@ +# CreatePlaylistRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `Title` | *string* | :heavy_check_mark: | name of the playlist | +| `Type` | [operations.Type](../../models/operations/type.md) | :heavy_check_mark: | type of playlist to create | +| `Smart` | [operations.Smart](../../models/operations/smart.md) | :heavy_check_mark: | whether the playlist is smart or not | +| `URI` | **string* | :heavy_minus_sign: | the content URI for the playlist | +| `PlayQueueID` | **float64* | :heavy_minus_sign: | the play queue to copy to a playlist | \ No newline at end of file diff --git a/docs/models/operations/createplaylistresponse.md b/docs/models/operations/createplaylistresponse.md new file mode 100644 index 0000000..356b156 --- /dev/null +++ b/docs/models/operations/createplaylistresponse.md @@ -0,0 +1,10 @@ +# CreatePlaylistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deletelibraryrequest.md b/docs/models/operations/deletelibraryrequest.md new file mode 100644 index 0000000..0007af2 --- /dev/null +++ b/docs/models/operations/deletelibraryrequest.md @@ -0,0 +1,8 @@ +# DeleteLibraryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | 1000 | \ No newline at end of file diff --git a/docs/models/operations/deletelibraryresponse.md b/docs/models/operations/deletelibraryresponse.md new file mode 100644 index 0000000..7ced67b --- /dev/null +++ b/docs/models/operations/deletelibraryresponse.md @@ -0,0 +1,10 @@ +# DeleteLibraryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/deleteplaylistrequest.md b/docs/models/operations/deleteplaylistrequest.md new file mode 100644 index 0000000..dd49a72 --- /dev/null +++ b/docs/models/operations/deleteplaylistrequest.md @@ -0,0 +1,8 @@ +# DeletePlaylistRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | \ No newline at end of file diff --git a/docs/models/operations/deleteplaylistresponse.md b/docs/models/operations/deleteplaylistresponse.md new file mode 100644 index 0000000..161da8f --- /dev/null +++ b/docs/models/operations/deleteplaylistresponse.md @@ -0,0 +1,10 @@ +# DeletePlaylistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/device.md b/docs/models/operations/device.md new file mode 100644 index 0000000..a80e5a5 --- /dev/null +++ b/docs/models/operations/device.md @@ -0,0 +1,12 @@ +# Device + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `Name` | **string* | :heavy_minus_sign: | N/A | iPhone | +| `Platform` | **string* | :heavy_minus_sign: | N/A | iOS | +| `ClientIdentifier` | **string* | :heavy_minus_sign: | N/A | | +| `CreatedAt` | **float64* | :heavy_minus_sign: | N/A | 1654131230 | \ No newline at end of file diff --git a/docs/models/operations/director.md b/docs/models/operations/director.md new file mode 100644 index 0000000..277faf6 --- /dev/null +++ b/docs/models/operations/director.md @@ -0,0 +1,8 @@ +# Director + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Peyton Reed | \ No newline at end of file diff --git a/docs/models/operations/directory.md b/docs/models/operations/directory.md new file mode 100644 index 0000000..c2f7033 --- /dev/null +++ b/docs/models/operations/directory.md @@ -0,0 +1,10 @@ +# Directory + + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `Count` | **float64* | :heavy_minus_sign: | N/A | +| `Key` | **string* | :heavy_minus_sign: | N/A | +| `Title` | **string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/download.md b/docs/models/operations/download.md new file mode 100644 index 0000000..c5fc1e8 --- /dev/null +++ b/docs/models/operations/download.md @@ -0,0 +1,11 @@ +# Download + +Indicate that you want to start download any updates found. + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `DownloadZero` | 0 | +| `DownloadOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/enablepapertrailresponse.md b/docs/models/operations/enablepapertrailresponse.md new file mode 100644 index 0000000..6baff18 --- /dev/null +++ b/docs/models/operations/enablepapertrailresponse.md @@ -0,0 +1,10 @@ +# EnablePaperTrailResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/force.md b/docs/models/operations/force.md new file mode 100644 index 0000000..6588b91 --- /dev/null +++ b/docs/models/operations/force.md @@ -0,0 +1,13 @@ +# Force + +force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. +The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. + + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `ForceZero` | 0 | +| `ForceOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/genre.md b/docs/models/operations/genre.md new file mode 100644 index 0000000..1ab109c --- /dev/null +++ b/docs/models/operations/genre.md @@ -0,0 +1,8 @@ +# Genre + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Comedy | \ No newline at end of file diff --git a/docs/models/operations/getavailableclientsmediacontainer.md b/docs/models/operations/getavailableclientsmediacontainer.md new file mode 100644 index 0000000..7165205 --- /dev/null +++ b/docs/models/operations/getavailableclientsmediacontainer.md @@ -0,0 +1,9 @@ +# GetAvailableClientsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `Server` | [][operations.Server](../../models/operations/server.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getavailableclientsresponse.md b/docs/models/operations/getavailableclientsresponse.md new file mode 100644 index 0000000..7ce46d9 --- /dev/null +++ b/docs/models/operations/getavailableclientsresponse.md @@ -0,0 +1,11 @@ +# GetAvailableClientsResponse + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `ResponseBodies` | [][operations.ResponseBody](../../models/operations/responsebody.md) | :heavy_minus_sign: | Available Clients | \ No newline at end of file diff --git a/docs/models/operations/getbutlertasksresponse.md b/docs/models/operations/getbutlertasksresponse.md new file mode 100644 index 0000000..67ecfa6 --- /dev/null +++ b/docs/models/operations/getbutlertasksresponse.md @@ -0,0 +1,11 @@ +# GetButlerTasksResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetButlerTasksResponseBody](../../models/operations/getbutlertasksresponsebody.md) | :heavy_minus_sign: | All butler tasks | \ No newline at end of file diff --git a/docs/models/operations/getbutlertasksresponsebody.md b/docs/models/operations/getbutlertasksresponsebody.md new file mode 100644 index 0000000..71b5e2c --- /dev/null +++ b/docs/models/operations/getbutlertasksresponsebody.md @@ -0,0 +1,10 @@ +# GetButlerTasksResponseBody + +All butler tasks + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ButlerTasks` | [*operations.ButlerTasks](../../models/operations/butlertasks.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getcommonlibraryitemsrequest.md b/docs/models/operations/getcommonlibraryitemsrequest.md new file mode 100644 index 0000000..2015782 --- /dev/null +++ b/docs/models/operations/getcommonlibraryitemsrequest.md @@ -0,0 +1,10 @@ +# GetCommonLibraryItemsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `Type` | *float64* | :heavy_check_mark: | item type | +| `Filter` | **string* | :heavy_minus_sign: | the filter parameter | \ No newline at end of file diff --git a/docs/models/operations/getcommonlibraryitemsresponse.md b/docs/models/operations/getcommonlibraryitemsresponse.md new file mode 100644 index 0000000..80735e7 --- /dev/null +++ b/docs/models/operations/getcommonlibraryitemsresponse.md @@ -0,0 +1,10 @@ +# GetCommonLibraryItemsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getdevicesmediacontainer.md b/docs/models/operations/getdevicesmediacontainer.md new file mode 100644 index 0000000..6b35d1a --- /dev/null +++ b/docs/models/operations/getdevicesmediacontainer.md @@ -0,0 +1,10 @@ +# GetDevicesMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 151 | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.system.devices | +| `Device` | [][operations.Device](../../models/operations/device.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getdevicesresponse.md b/docs/models/operations/getdevicesresponse.md new file mode 100644 index 0000000..334fa77 --- /dev/null +++ b/docs/models/operations/getdevicesresponse.md @@ -0,0 +1,11 @@ +# GetDevicesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetDevicesResponseBody](../../models/operations/getdevicesresponsebody.md) | :heavy_minus_sign: | Devices | \ No newline at end of file diff --git a/docs/models/operations/getdevicesresponsebody.md b/docs/models/operations/getdevicesresponsebody.md new file mode 100644 index 0000000..ababa00 --- /dev/null +++ b/docs/models/operations/getdevicesresponsebody.md @@ -0,0 +1,10 @@ +# GetDevicesResponseBody + +Devices + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetDevicesMediaContainer](../../models/operations/getdevicesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getfilehashrequest.md b/docs/models/operations/getfilehashrequest.md new file mode 100644 index 0000000..afa48f9 --- /dev/null +++ b/docs/models/operations/getfilehashrequest.md @@ -0,0 +1,9 @@ +# GetFileHashRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `URL` | *string* | :heavy_check_mark: | This is the path to the local file, must be prefixed by `file://` | file://C:\Image.png&type=13 | +| `Type` | **float64* | :heavy_minus_sign: | Item type | | \ No newline at end of file diff --git a/docs/models/operations/getfilehashresponse.md b/docs/models/operations/getfilehashresponse.md new file mode 100644 index 0000000..14fc3f1 --- /dev/null +++ b/docs/models/operations/getfilehashresponse.md @@ -0,0 +1,10 @@ +# GetFileHashResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getglobalhubsrequest.md b/docs/models/operations/getglobalhubsrequest.md new file mode 100644 index 0000000..2399934 --- /dev/null +++ b/docs/models/operations/getglobalhubsrequest.md @@ -0,0 +1,9 @@ +# GetGlobalHubsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Count` | **float64* | :heavy_minus_sign: | The number of items to return with each hub. | +| `OnlyTransient` | [*operations.OnlyTransient](../../models/operations/onlytransient.md) | :heavy_minus_sign: | 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). | \ No newline at end of file diff --git a/docs/models/operations/getglobalhubsresponse.md b/docs/models/operations/getglobalhubsresponse.md new file mode 100644 index 0000000..821f4d1 --- /dev/null +++ b/docs/models/operations/getglobalhubsresponse.md @@ -0,0 +1,10 @@ +# GetGlobalHubsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getlatestlibraryitemsrequest.md b/docs/models/operations/getlatestlibraryitemsrequest.md new file mode 100644 index 0000000..139df5c --- /dev/null +++ b/docs/models/operations/getlatestlibraryitemsrequest.md @@ -0,0 +1,10 @@ +# GetLatestLibraryItemsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `Type` | *float64* | :heavy_check_mark: | item type | +| `Filter` | **string* | :heavy_minus_sign: | the filter parameter | \ No newline at end of file diff --git a/docs/models/operations/getlatestlibraryitemsresponse.md b/docs/models/operations/getlatestlibraryitemsresponse.md new file mode 100644 index 0000000..d7463dd --- /dev/null +++ b/docs/models/operations/getlatestlibraryitemsresponse.md @@ -0,0 +1,10 @@ +# GetLatestLibraryItemsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getlibrariesresponse.md b/docs/models/operations/getlibrariesresponse.md new file mode 100644 index 0000000..09cdb3f --- /dev/null +++ b/docs/models/operations/getlibrariesresponse.md @@ -0,0 +1,10 @@ +# GetLibrariesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsrequest.md b/docs/models/operations/getlibraryhubsrequest.md new file mode 100644 index 0000000..9a27f8c --- /dev/null +++ b/docs/models/operations/getlibraryhubsrequest.md @@ -0,0 +1,10 @@ +# GetLibraryHubsRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `Count` | **float64* | :heavy_minus_sign: | The number of items to return with each hub. | +| `OnlyTransient` | [*operations.QueryParamOnlyTransient](../../models/operations/queryparamonlytransient.md) | :heavy_minus_sign: | 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). | \ No newline at end of file diff --git a/docs/models/operations/getlibraryhubsresponse.md b/docs/models/operations/getlibraryhubsresponse.md new file mode 100644 index 0000000..92a0dcc --- /dev/null +++ b/docs/models/operations/getlibraryhubsresponse.md @@ -0,0 +1,10 @@ +# GetLibraryHubsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsrequest.md b/docs/models/operations/getlibraryitemsrequest.md new file mode 100644 index 0000000..e05bf42 --- /dev/null +++ b/docs/models/operations/getlibraryitemsrequest.md @@ -0,0 +1,10 @@ +# GetLibraryItemsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `Type` | **float64* | :heavy_minus_sign: | item type | +| `Filter` | **string* | :heavy_minus_sign: | the filter parameter | \ No newline at end of file diff --git a/docs/models/operations/getlibraryitemsresponse.md b/docs/models/operations/getlibraryitemsresponse.md new file mode 100644 index 0000000..12b7561 --- /dev/null +++ b/docs/models/operations/getlibraryitemsresponse.md @@ -0,0 +1,10 @@ +# GetLibraryItemsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getlibraryrequest.md b/docs/models/operations/getlibraryrequest.md new file mode 100644 index 0000000..10942cd --- /dev/null +++ b/docs/models/operations/getlibraryrequest.md @@ -0,0 +1,9 @@ +# GetLibraryRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | 1000 | +| `IncludeDetails` | [*operations.IncludeDetails](../../models/operations/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | \ No newline at end of file diff --git a/docs/models/operations/getlibraryresponse.md b/docs/models/operations/getlibraryresponse.md new file mode 100644 index 0000000..d043007 --- /dev/null +++ b/docs/models/operations/getlibraryresponse.md @@ -0,0 +1,10 @@ +# GetLibraryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenrequest.md b/docs/models/operations/getmetadatachildrenrequest.md new file mode 100644 index 0000000..4db830d --- /dev/null +++ b/docs/models/operations/getmetadatachildrenrequest.md @@ -0,0 +1,8 @@ +# GetMetadataChildrenRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `RatingKey` | *float64* | :heavy_check_mark: | the id of the library item to return the children of. | \ No newline at end of file diff --git a/docs/models/operations/getmetadatachildrenresponse.md b/docs/models/operations/getmetadatachildrenresponse.md new file mode 100644 index 0000000..09dd250 --- /dev/null +++ b/docs/models/operations/getmetadatachildrenresponse.md @@ -0,0 +1,10 @@ +# GetMetadataChildrenResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getmetadatarequest.md b/docs/models/operations/getmetadatarequest.md new file mode 100644 index 0000000..23c6eb8 --- /dev/null +++ b/docs/models/operations/getmetadatarequest.md @@ -0,0 +1,8 @@ +# GetMetadataRequest + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `RatingKey` | *float64* | :heavy_check_mark: | the id of the library item to return the children of. | \ No newline at end of file diff --git a/docs/models/operations/getmetadataresponse.md b/docs/models/operations/getmetadataresponse.md new file mode 100644 index 0000000..7aee541 --- /dev/null +++ b/docs/models/operations/getmetadataresponse.md @@ -0,0 +1,10 @@ +# GetMetadataResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getmyplexaccountresponse.md b/docs/models/operations/getmyplexaccountresponse.md new file mode 100644 index 0000000..260b526 --- /dev/null +++ b/docs/models/operations/getmyplexaccountresponse.md @@ -0,0 +1,11 @@ +# GetMyPlexAccountResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetMyPlexAccountResponseBody](../../models/operations/getmyplexaccountresponsebody.md) | :heavy_minus_sign: | MyPlex Account | \ No newline at end of file diff --git a/docs/models/operations/getmyplexaccountresponsebody.md b/docs/models/operations/getmyplexaccountresponsebody.md new file mode 100644 index 0000000..52f0908 --- /dev/null +++ b/docs/models/operations/getmyplexaccountresponsebody.md @@ -0,0 +1,10 @@ +# GetMyPlexAccountResponseBody + +MyPlex Account + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `MyPlex` | [*operations.MyPlex](../../models/operations/myplex.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getondeckmedia.md b/docs/models/operations/getondeckmedia.md new file mode 100644 index 0000000..d773382 --- /dev/null +++ b/docs/models/operations/getondeckmedia.md @@ -0,0 +1,22 @@ +# GetOnDeckMedia + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 80994 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 420080 | +| `Bitrate` | **float64* | :heavy_minus_sign: | N/A | 1046 | +| `Width` | **float64* | :heavy_minus_sign: | N/A | 1920 | +| `Height` | **float64* | :heavy_minus_sign: | N/A | 1080 | +| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 1.78 | +| `AudioChannels` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | aac | +| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | hevc | +| `VideoResolution` | **string* | :heavy_minus_sign: | N/A | 1080 | +| `Container` | **string* | :heavy_minus_sign: | N/A | mkv | +| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | PAL | +| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | +| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main | +| `Part` | [][operations.GetOnDeckPart](../../models/operations/getondeckpart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getondeckmediacontainer.md b/docs/models/operations/getondeckmediacontainer.md new file mode 100644 index 0000000..8bb8233 --- /dev/null +++ b/docs/models/operations/getondeckmediacontainer.md @@ -0,0 +1,14 @@ +# GetOnDeckMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 16 | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `MediaTagVersion` | **float64* | :heavy_minus_sign: | N/A | 1680021154 | +| `MixedParents` | **bool* | :heavy_minus_sign: | N/A | | +| `Metadata` | [][operations.GetOnDeckMetadata](../../models/operations/getondeckmetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getondeckmetadata.md b/docs/models/operations/getondeckmetadata.md new file mode 100644 index 0000000..2dae45b --- /dev/null +++ b/docs/models/operations/getondeckmetadata.md @@ -0,0 +1,43 @@ +# GetOnDeckMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | | +| `LibrarySectionID` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | TV Shows | +| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | N/A | 4bb2521c-8ba9-459b-aaee-8ab8bc35eabd | +| `RatingKey` | **float64* | :heavy_minus_sign: | N/A | 49564 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49564 | +| `ParentRatingKey` | **float64* | :heavy_minus_sign: | N/A | 49557 | +| `GrandparentRatingKey` | **float64* | :heavy_minus_sign: | N/A | 49556 | +| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://episode/5ea7d7402e7ab10042e74d4f | +| `ParentGUID` | **string* | :heavy_minus_sign: | N/A | plex://season/602e754d67f4c8002ce54b3d | +| `GrandparentGUID` | **string* | :heavy_minus_sign: | N/A | plex://show/5d9c090e705e7a001e6e94d8 | +| `Type` | **string* | :heavy_minus_sign: | N/A | episode | +| `Title` | **string* | :heavy_minus_sign: | N/A | Circus | +| `GrandparentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49556 | +| `ParentKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49557 | +| `LibrarySectionKey` | **string* | :heavy_minus_sign: | N/A | /library/sections/2 | +| `GrandparentTitle` | **string* | :heavy_minus_sign: | N/A | Bluey (2018) | +| `ParentTitle` | **string* | :heavy_minus_sign: | N/A | Season 2 | +| `ContentRating` | **string* | :heavy_minus_sign: | N/A | TV-Y | +| `Summary` | **string* | :heavy_minus_sign: | N/A | Bluey is the ringmaster in a game of circus with her friends but Hercules wants to play his motorcycle game instead. Luckily Bluey has a solution to keep everyone happy. | +| `Index` | **float64* | :heavy_minus_sign: | N/A | 33 | +| `ParentIndex` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `LastViewedAt` | **float64* | :heavy_minus_sign: | N/A | 1681908352 | +| `Year` | **float64* | :heavy_minus_sign: | N/A | 2018 | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49564/thumb/1654258204 | +| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49556/art/1680939546 | +| `ParentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49557/thumb/1654258204 | +| `GrandparentThumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49556/thumb/1680939546 | +| `GrandparentArt` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49556/art/1680939546 | +| `GrandparentTheme` | **string* | :heavy_minus_sign: | N/A | /library/metadata/49556/theme/1680939546 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 420080 | +| `OriginallyAvailableAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | 2020-10-31 00:00:00 +0000 UTC | +| `AddedAt` | **float64* | :heavy_minus_sign: | N/A | 1654258196 | +| `UpdatedAt` | **float64* | :heavy_minus_sign: | N/A | 1654258204 | +| `Media` | [][operations.GetOnDeckMedia](../../models/operations/getondeckmedia.md) | :heavy_minus_sign: | N/A | | +| `Guids` | [][operations.Guids](../../models/operations/guids.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getondeckpart.md b/docs/models/operations/getondeckpart.md new file mode 100644 index 0000000..bc91918 --- /dev/null +++ b/docs/models/operations/getondeckpart.md @@ -0,0 +1,16 @@ +# GetOnDeckPart + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 80994 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/80994/1655007810/file.mkv | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 420080 | +| `File` | **string* | :heavy_minus_sign: | N/A | /tvshows/Bluey (2018)/Bluey (2018) - S02E33 - Circus.mkv | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 55148931 | +| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | +| `Container` | **string* | :heavy_minus_sign: | N/A | mkv | +| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main | +| `Stream` | [][operations.Stream](../../models/operations/stream.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getondeckresponse.md b/docs/models/operations/getondeckresponse.md new file mode 100644 index 0000000..0df972d --- /dev/null +++ b/docs/models/operations/getondeckresponse.md @@ -0,0 +1,11 @@ +# GetOnDeckResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetOnDeckResponseBody](../../models/operations/getondeckresponsebody.md) | :heavy_minus_sign: | The on Deck content | \ No newline at end of file diff --git a/docs/models/operations/getondeckresponsebody.md b/docs/models/operations/getondeckresponsebody.md new file mode 100644 index 0000000..8134ee9 --- /dev/null +++ b/docs/models/operations/getondeckresponsebody.md @@ -0,0 +1,10 @@ +# GetOnDeckResponseBody + +The on Deck content + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetOnDeckMediaContainer](../../models/operations/getondeckmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsrequest.md b/docs/models/operations/getplaylistcontentsrequest.md new file mode 100644 index 0000000..afa2ce8 --- /dev/null +++ b/docs/models/operations/getplaylistcontentsrequest.md @@ -0,0 +1,9 @@ +# GetPlaylistContentsRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | +| `Type` | *float64* | :heavy_check_mark: | the metadata type of the item to return | \ No newline at end of file diff --git a/docs/models/operations/getplaylistcontentsresponse.md b/docs/models/operations/getplaylistcontentsresponse.md new file mode 100644 index 0000000..7807247 --- /dev/null +++ b/docs/models/operations/getplaylistcontentsresponse.md @@ -0,0 +1,10 @@ +# GetPlaylistContentsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getplaylistrequest.md b/docs/models/operations/getplaylistrequest.md new file mode 100644 index 0000000..4415f1b --- /dev/null +++ b/docs/models/operations/getplaylistrequest.md @@ -0,0 +1,8 @@ +# GetPlaylistRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | \ No newline at end of file diff --git a/docs/models/operations/getplaylistresponse.md b/docs/models/operations/getplaylistresponse.md new file mode 100644 index 0000000..2b44dff --- /dev/null +++ b/docs/models/operations/getplaylistresponse.md @@ -0,0 +1,10 @@ +# GetPlaylistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getplaylistsrequest.md b/docs/models/operations/getplaylistsrequest.md new file mode 100644 index 0000000..522c518 --- /dev/null +++ b/docs/models/operations/getplaylistsrequest.md @@ -0,0 +1,9 @@ +# GetPlaylistsRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `PlaylistType` | [*operations.PlaylistType](../../models/operations/playlisttype.md) | :heavy_minus_sign: | limit to a type of playlist. | +| `Smart` | [*operations.QueryParamSmart](../../models/operations/queryparamsmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). | \ No newline at end of file diff --git a/docs/models/operations/getplaylistsresponse.md b/docs/models/operations/getplaylistsresponse.md new file mode 100644 index 0000000..5d8c612 --- /dev/null +++ b/docs/models/operations/getplaylistsresponse.md @@ -0,0 +1,10 @@ +# GetPlaylistsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedmediacontainer.md b/docs/models/operations/getrecentlyaddedmediacontainer.md new file mode 100644 index 0000000..a5acdbb --- /dev/null +++ b/docs/models/operations/getrecentlyaddedmediacontainer.md @@ -0,0 +1,14 @@ +# GetRecentlyAddedMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 50 | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `MediaTagVersion` | **float64* | :heavy_minus_sign: | N/A | 1680021154 | +| `MixedParents` | **bool* | :heavy_minus_sign: | N/A | | +| `Metadata` | [][operations.Metadata](../../models/operations/metadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedresponse.md b/docs/models/operations/getrecentlyaddedresponse.md new file mode 100644 index 0000000..efa850f --- /dev/null +++ b/docs/models/operations/getrecentlyaddedresponse.md @@ -0,0 +1,11 @@ +# GetRecentlyAddedResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetRecentlyAddedResponseBody](../../models/operations/getrecentlyaddedresponsebody.md) | :heavy_minus_sign: | The recently added content | \ No newline at end of file diff --git a/docs/models/operations/getrecentlyaddedresponsebody.md b/docs/models/operations/getrecentlyaddedresponsebody.md new file mode 100644 index 0000000..7a1f3be --- /dev/null +++ b/docs/models/operations/getrecentlyaddedresponsebody.md @@ -0,0 +1,10 @@ +# GetRecentlyAddedResponseBody + +The recently added content + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetRecentlyAddedMediaContainer](../../models/operations/getrecentlyaddedmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getresizedphotorequest.md b/docs/models/operations/getresizedphotorequest.md new file mode 100644 index 0000000..01f81f1 --- /dev/null +++ b/docs/models/operations/getresizedphotorequest.md @@ -0,0 +1,14 @@ +# GetResizedPhotoRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `Width` | *float64* | :heavy_check_mark: | The width for the resized photo | 110 | +| `Height` | *float64* | :heavy_check_mark: | The height for the resized photo | 165 | +| `Opacity` | *int64* | :heavy_check_mark: | The opacity for the resized photo | | +| `Blur` | *float64* | :heavy_check_mark: | The width for the resized photo | 0 | +| `MinSize` | [operations.MinSize](../../models/operations/minsize.md) | :heavy_check_mark: | images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. | | +| `Upscale` | [operations.Upscale](../../models/operations/upscale.md) | :heavy_check_mark: | allow images to be resized beyond native dimensions. | | +| `URL` | *string* | :heavy_check_mark: | path to image within Plex | /library/metadata/49564/thumb/1654258204 | \ No newline at end of file diff --git a/docs/models/operations/getresizedphotoresponse.md b/docs/models/operations/getresizedphotoresponse.md new file mode 100644 index 0000000..ce8e6dc --- /dev/null +++ b/docs/models/operations/getresizedphotoresponse.md @@ -0,0 +1,10 @@ +# GetResizedPhotoResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultscountry.md b/docs/models/operations/getsearchresultscountry.md new file mode 100644 index 0000000..058a20d --- /dev/null +++ b/docs/models/operations/getsearchresultscountry.md @@ -0,0 +1,8 @@ +# GetSearchResultsCountry + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | United States of America | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsdirector.md b/docs/models/operations/getsearchresultsdirector.md new file mode 100644 index 0000000..dbd2668 --- /dev/null +++ b/docs/models/operations/getsearchresultsdirector.md @@ -0,0 +1,8 @@ +# GetSearchResultsDirector + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Brian De Palma | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsgenre.md b/docs/models/operations/getsearchresultsgenre.md new file mode 100644 index 0000000..cd364c6 --- /dev/null +++ b/docs/models/operations/getsearchresultsgenre.md @@ -0,0 +1,8 @@ +# GetSearchResultsGenre + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Action | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsmedia.md b/docs/models/operations/getsearchresultsmedia.md new file mode 100644 index 0000000..1a15f87 --- /dev/null +++ b/docs/models/operations/getsearchresultsmedia.md @@ -0,0 +1,22 @@ +# GetSearchResultsMedia + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 26610 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 6612628 | +| `Bitrate` | **float64* | :heavy_minus_sign: | N/A | 4751 | +| `Width` | **float64* | :heavy_minus_sign: | N/A | 1916 | +| `Height` | **float64* | :heavy_minus_sign: | N/A | 796 | +| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 2.35 | +| `AudioChannels` | **float64* | :heavy_minus_sign: | N/A | 6 | +| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | aac | +| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | hevc | +| `VideoResolution` | **float64* | :heavy_minus_sign: | N/A | 1080 | +| `Container` | **string* | :heavy_minus_sign: | N/A | mkv | +| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p | +| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | +| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 | +| `Part` | [][operations.GetSearchResultsPart](../../models/operations/getsearchresultspart.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsmediacontainer.md b/docs/models/operations/getsearchresultsmediacontainer.md new file mode 100644 index 0000000..1364cb5 --- /dev/null +++ b/docs/models/operations/getsearchresultsmediacontainer.md @@ -0,0 +1,13 @@ +# GetSearchResultsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 26 | +| `Identifier` | **string* | :heavy_minus_sign: | N/A | com.plexapp.plugins.library | +| `MediaTagPrefix` | **string* | :heavy_minus_sign: | N/A | /system/bundle/media/flags/ | +| `MediaTagVersion` | **float64* | :heavy_minus_sign: | N/A | 1680021154 | +| `Metadata` | [][operations.GetSearchResultsMetadata](../../models/operations/getsearchresultsmetadata.md) | :heavy_minus_sign: | N/A | | +| `Provider` | [][operations.Provider](../../models/operations/provider.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsmetadata.md b/docs/models/operations/getsearchresultsmetadata.md new file mode 100644 index 0000000..9d49381 --- /dev/null +++ b/docs/models/operations/getsearchresultsmetadata.md @@ -0,0 +1,41 @@ +# GetSearchResultsMetadata + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | | +| `LibrarySectionID` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Movies | +| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `Personal` | **bool* | :heavy_minus_sign: | N/A | | +| `SourceTitle` | **string* | :heavy_minus_sign: | N/A | Hera | +| `RatingKey` | **float64* | :heavy_minus_sign: | N/A | 10398 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/10398 | +| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://movie/5d7768284de0ee001fcc8f52 | +| `Studio` | **string* | :heavy_minus_sign: | N/A | Paramount | +| `Type` | **string* | :heavy_minus_sign: | N/A | movie | +| `Title` | **string* | :heavy_minus_sign: | N/A | Mission: Impossible | +| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 | +| `Summary` | **string* | :heavy_minus_sign: | N/A | When Ethan Hunt the leader of a crack espionage team whose perilous operation has gone awry with no explanation discovers that a mole has penetrated the CIA he's surprised to learn that he's the No. 1 suspect. To clear his name Hunt now must ferret out the real double agent and in the process even the score. | +| `Rating` | **float64* | :heavy_minus_sign: | N/A | 6.6 | +| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 7.1 | +| `Year` | **float64* | :heavy_minus_sign: | N/A | 1996 | +| `Tagline` | **string* | :heavy_minus_sign: | N/A | Expect the impossible. | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/10398/thumb/1679505055 | +| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/10398/art/1679505055 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 6612628 | +| `OriginallyAvailableAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | 1996-05-22 00:00:00 +0000 UTC | +| `AddedAt` | **float64* | :heavy_minus_sign: | N/A | 1589234571 | +| `UpdatedAt` | **float64* | :heavy_minus_sign: | N/A | 1679505055 | +| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `ChapterSource` | **string* | :heavy_minus_sign: | N/A | media | +| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/10501 | +| `RatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.ripe | +| `Media` | [][operations.GetSearchResultsMedia](../../models/operations/getsearchresultsmedia.md) | :heavy_minus_sign: | N/A | | +| `Genre` | [][operations.GetSearchResultsGenre](../../models/operations/getsearchresultsgenre.md) | :heavy_minus_sign: | N/A | | +| `Director` | [][operations.GetSearchResultsDirector](../../models/operations/getsearchresultsdirector.md) | :heavy_minus_sign: | N/A | | +| `Writer` | [][operations.GetSearchResultsWriter](../../models/operations/getsearchresultswriter.md) | :heavy_minus_sign: | N/A | | +| `Country` | [][operations.GetSearchResultsCountry](../../models/operations/getsearchresultscountry.md) | :heavy_minus_sign: | N/A | | +| `Role` | [][operations.GetSearchResultsRole](../../models/operations/getsearchresultsrole.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultspart.md b/docs/models/operations/getsearchresultspart.md new file mode 100644 index 0000000..bcaf866 --- /dev/null +++ b/docs/models/operations/getsearchresultspart.md @@ -0,0 +1,15 @@ +# GetSearchResultsPart + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 26610 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/26610/1589234571/file.mkv | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 6612628 | +| `File` | **string* | :heavy_minus_sign: | N/A | /movies/Mission Impossible (1996)/Mission Impossible (1996) Bluray-1080p.mkv | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 3926903851 | +| `AudioProfile` | **string* | :heavy_minus_sign: | N/A | lc | +| `Container` | **string* | :heavy_minus_sign: | N/A | mkv | +| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | main 10 | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsrequest.md b/docs/models/operations/getsearchresultsrequest.md new file mode 100644 index 0000000..7318f58 --- /dev/null +++ b/docs/models/operations/getsearchresultsrequest.md @@ -0,0 +1,8 @@ +# GetSearchResultsRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `Query` | *string* | :heavy_check_mark: | The search query string to use | 110 | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsresponse.md b/docs/models/operations/getsearchresultsresponse.md new file mode 100644 index 0000000..34dfeec --- /dev/null +++ b/docs/models/operations/getsearchresultsresponse.md @@ -0,0 +1,11 @@ +# GetSearchResultsResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetSearchResultsResponseBody](../../models/operations/getsearchresultsresponsebody.md) | :heavy_minus_sign: | Search Results | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsresponsebody.md b/docs/models/operations/getsearchresultsresponsebody.md new file mode 100644 index 0000000..39a7a54 --- /dev/null +++ b/docs/models/operations/getsearchresultsresponsebody.md @@ -0,0 +1,10 @@ +# GetSearchResultsResponseBody + +Search Results + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetSearchResultsMediaContainer](../../models/operations/getsearchresultsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultsrole.md b/docs/models/operations/getsearchresultsrole.md new file mode 100644 index 0000000..7d66cdf --- /dev/null +++ b/docs/models/operations/getsearchresultsrole.md @@ -0,0 +1,8 @@ +# GetSearchResultsRole + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Tom Cruise | \ No newline at end of file diff --git a/docs/models/operations/getsearchresultswriter.md b/docs/models/operations/getsearchresultswriter.md new file mode 100644 index 0000000..c710954 --- /dev/null +++ b/docs/models/operations/getsearchresultswriter.md @@ -0,0 +1,8 @@ +# GetSearchResultsWriter + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | David Koepp | \ No newline at end of file diff --git a/docs/models/operations/getserveractivitiesmediacontainer.md b/docs/models/operations/getserveractivitiesmediacontainer.md new file mode 100644 index 0000000..eb6b965 --- /dev/null +++ b/docs/models/operations/getserveractivitiesmediacontainer.md @@ -0,0 +1,9 @@ +# GetServerActivitiesMediaContainer + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| `Size` | **float64* | :heavy_minus_sign: | N/A | +| `Activity` | [][operations.Activity](../../models/operations/activity.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserveractivitiesresponse.md b/docs/models/operations/getserveractivitiesresponse.md new file mode 100644 index 0000000..00c9121 --- /dev/null +++ b/docs/models/operations/getserveractivitiesresponse.md @@ -0,0 +1,11 @@ +# GetServerActivitiesResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetServerActivitiesResponseBody](../../models/operations/getserveractivitiesresponsebody.md) | :heavy_minus_sign: | The Server Activities | \ No newline at end of file diff --git a/docs/models/operations/getserveractivitiesresponsebody.md b/docs/models/operations/getserveractivitiesresponsebody.md new file mode 100644 index 0000000..292690e --- /dev/null +++ b/docs/models/operations/getserveractivitiesresponsebody.md @@ -0,0 +1,10 @@ +# GetServerActivitiesResponseBody + +The Server Activities + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetServerActivitiesMediaContainer](../../models/operations/getserveractivitiesmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getservercapabilitiesresponse.md b/docs/models/operations/getservercapabilitiesresponse.md new file mode 100644 index 0000000..72b5bae --- /dev/null +++ b/docs/models/operations/getservercapabilitiesresponse.md @@ -0,0 +1,11 @@ +# GetServerCapabilitiesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetServerCapabilitiesResponseBody](../../models/operations/getservercapabilitiesresponsebody.md) | :heavy_minus_sign: | The Server Capabilities | \ No newline at end of file diff --git a/docs/models/operations/getservercapabilitiesresponsebody.md b/docs/models/operations/getservercapabilitiesresponsebody.md new file mode 100644 index 0000000..6f47930 --- /dev/null +++ b/docs/models/operations/getservercapabilitiesresponsebody.md @@ -0,0 +1,10 @@ +# GetServerCapabilitiesResponseBody + +The Server Capabilities + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `MediaContainer` | [*operations.MediaContainer](../../models/operations/mediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserveridentitymediacontainer.md b/docs/models/operations/getserveridentitymediacontainer.md new file mode 100644 index 0000000..e78030c --- /dev/null +++ b/docs/models/operations/getserveridentitymediacontainer.md @@ -0,0 +1,11 @@ +# GetServerIdentityMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 0 | +| `Claimed` | **bool* | :heavy_minus_sign: | N/A | | +| `MachineIdentifier` | **string* | :heavy_minus_sign: | N/A | 96f2fe7a78c9dc1f16a16bedbe90f98149be16b4 | +| `Version` | **string* | :heavy_minus_sign: | N/A | 1.31.3.6868-28fc46b27 | \ No newline at end of file diff --git a/docs/models/operations/getserveridentityresponse.md b/docs/models/operations/getserveridentityresponse.md new file mode 100644 index 0000000..bb09028 --- /dev/null +++ b/docs/models/operations/getserveridentityresponse.md @@ -0,0 +1,11 @@ +# GetServerIdentityResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetServerIdentityResponseBody](../../models/operations/getserveridentityresponsebody.md) | :heavy_minus_sign: | The Transcode Sessions | \ No newline at end of file diff --git a/docs/models/operations/getserveridentityresponsebody.md b/docs/models/operations/getserveridentityresponsebody.md new file mode 100644 index 0000000..b7842cd --- /dev/null +++ b/docs/models/operations/getserveridentityresponsebody.md @@ -0,0 +1,10 @@ +# GetServerIdentityResponseBody + +The Transcode Sessions + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetServerIdentityMediaContainer](../../models/operations/getserveridentitymediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserverlistmediacontainer.md b/docs/models/operations/getserverlistmediacontainer.md new file mode 100644 index 0000000..d405779 --- /dev/null +++ b/docs/models/operations/getserverlistmediacontainer.md @@ -0,0 +1,9 @@ +# GetServerListMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `Server` | [][operations.GetServerListServer](../../models/operations/getserverlistserver.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/getserverlistresponse.md b/docs/models/operations/getserverlistresponse.md new file mode 100644 index 0000000..8bfdbb9 --- /dev/null +++ b/docs/models/operations/getserverlistresponse.md @@ -0,0 +1,11 @@ +# GetServerListResponse + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetServerListResponseBody](../../models/operations/getserverlistresponsebody.md) | :heavy_minus_sign: | List of Servers | \ No newline at end of file diff --git a/docs/models/operations/getserverlistresponsebody.md b/docs/models/operations/getserverlistresponsebody.md new file mode 100644 index 0000000..1dd4f09 --- /dev/null +++ b/docs/models/operations/getserverlistresponsebody.md @@ -0,0 +1,10 @@ +# GetServerListResponseBody + +List of Servers + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetServerListMediaContainer](../../models/operations/getserverlistmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getserverlistserver.md b/docs/models/operations/getserverlistserver.md new file mode 100644 index 0000000..9a00599 --- /dev/null +++ b/docs/models/operations/getserverlistserver.md @@ -0,0 +1,13 @@ +# GetServerListServer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | Hera | +| `Host` | **string* | :heavy_minus_sign: | N/A | 10.10.10.47 | +| `Address` | **string* | :heavy_minus_sign: | N/A | 10.10.10.47 | +| `Port` | **float64* | :heavy_minus_sign: | N/A | 32400 | +| `MachineIdentifier` | **string* | :heavy_minus_sign: | N/A | 96f2fe7a78c9dc1f16a16bedbe90f98149be16b4 | +| `Version` | **string* | :heavy_minus_sign: | N/A | 1.31.3.6868-28fc46b27 | \ No newline at end of file diff --git a/docs/models/operations/getserverpreferencesresponse.md b/docs/models/operations/getserverpreferencesresponse.md new file mode 100644 index 0000000..d035686 --- /dev/null +++ b/docs/models/operations/getserverpreferencesresponse.md @@ -0,0 +1,10 @@ +# GetServerPreferencesResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getsessionhistoryresponse.md b/docs/models/operations/getsessionhistoryresponse.md new file mode 100644 index 0000000..3e63308 --- /dev/null +++ b/docs/models/operations/getsessionhistoryresponse.md @@ -0,0 +1,10 @@ +# GetSessionHistoryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getsessionsresponse.md b/docs/models/operations/getsessionsresponse.md new file mode 100644 index 0000000..86a2b9d --- /dev/null +++ b/docs/models/operations/getsessionsresponse.md @@ -0,0 +1,10 @@ +# GetSessionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationrequest.md b/docs/models/operations/getsourceconnectioninformationrequest.md new file mode 100644 index 0000000..e5439ac --- /dev/null +++ b/docs/models/operations/getsourceconnectioninformationrequest.md @@ -0,0 +1,8 @@ +# GetSourceConnectionInformationRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `Source` | *string* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier | \ No newline at end of file diff --git a/docs/models/operations/getsourceconnectioninformationresponse.md b/docs/models/operations/getsourceconnectioninformationresponse.md new file mode 100644 index 0000000..17e0fc7 --- /dev/null +++ b/docs/models/operations/getsourceconnectioninformationresponse.md @@ -0,0 +1,10 @@ +# GetSourceConnectionInformationResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/gettimelinerequest.md b/docs/models/operations/gettimelinerequest.md new file mode 100644 index 0000000..400478f --- /dev/null +++ b/docs/models/operations/gettimelinerequest.md @@ -0,0 +1,17 @@ +# GetTimelineRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `RatingKey` | *float64* | :heavy_check_mark: | The rating key of the media item | +| `Key` | *string* | :heavy_check_mark: | The key of the media item to get the timeline for | +| `State` | [operations.State](../../models/operations/state.md) | :heavy_check_mark: | The state of the media item | +| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | +| `Time` | *float64* | :heavy_check_mark: | The time of the media item | +| `Duration` | *float64* | :heavy_check_mark: | The duration of the media item | +| `Context` | *string* | :heavy_check_mark: | The context of the media item | +| `PlayQueueItemID` | *float64* | :heavy_check_mark: | The play queue item ID of the media item | +| `PlayBackTime` | *float64* | :heavy_check_mark: | The playback time of the media item | +| `Row` | *float64* | :heavy_check_mark: | The row of the media item | \ No newline at end of file diff --git a/docs/models/operations/gettimelineresponse.md b/docs/models/operations/gettimelineresponse.md new file mode 100644 index 0000000..1e7bd7b --- /dev/null +++ b/docs/models/operations/gettimelineresponse.md @@ -0,0 +1,10 @@ +# GetTimelineResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/gettranscodesessionsmediacontainer.md b/docs/models/operations/gettranscodesessionsmediacontainer.md new file mode 100644 index 0000000..8fc23d6 --- /dev/null +++ b/docs/models/operations/gettranscodesessionsmediacontainer.md @@ -0,0 +1,9 @@ +# GetTranscodeSessionsMediaContainer + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `TranscodeSession` | [][operations.TranscodeSession](../../models/operations/transcodesession.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/gettranscodesessionsresponse.md b/docs/models/operations/gettranscodesessionsresponse.md new file mode 100644 index 0000000..9fbca5a --- /dev/null +++ b/docs/models/operations/gettranscodesessionsresponse.md @@ -0,0 +1,11 @@ +# GetTranscodeSessionsResponse + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | +| `Object` | [*operations.GetTranscodeSessionsResponseBody](../../models/operations/gettranscodesessionsresponsebody.md) | :heavy_minus_sign: | The Transcode Sessions | \ No newline at end of file diff --git a/docs/models/operations/gettranscodesessionsresponsebody.md b/docs/models/operations/gettranscodesessionsresponsebody.md new file mode 100644 index 0000000..3207969 --- /dev/null +++ b/docs/models/operations/gettranscodesessionsresponsebody.md @@ -0,0 +1,10 @@ +# GetTranscodeSessionsResponseBody + +The Transcode Sessions + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetTranscodeSessionsMediaContainer](../../models/operations/gettranscodesessionsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenrequest.md b/docs/models/operations/gettransienttokenrequest.md new file mode 100644 index 0000000..ab59f6d --- /dev/null +++ b/docs/models/operations/gettransienttokenrequest.md @@ -0,0 +1,9 @@ +# GetTransientTokenRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Type` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | +| `Scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | \ No newline at end of file diff --git a/docs/models/operations/gettransienttokenresponse.md b/docs/models/operations/gettransienttokenresponse.md new file mode 100644 index 0000000..5bad74c --- /dev/null +++ b/docs/models/operations/gettransienttokenresponse.md @@ -0,0 +1,10 @@ +# GetTransientTokenResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/getupdatestatusresponse.md b/docs/models/operations/getupdatestatusresponse.md new file mode 100644 index 0000000..a8fa277 --- /dev/null +++ b/docs/models/operations/getupdatestatusresponse.md @@ -0,0 +1,10 @@ +# GetUpdateStatusResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/guids.md b/docs/models/operations/guids.md new file mode 100644 index 0000000..4cf163a --- /dev/null +++ b/docs/models/operations/guids.md @@ -0,0 +1,8 @@ +# Guids + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `ID` | **string* | :heavy_minus_sign: | N/A | imdb://tt13303712 | \ No newline at end of file diff --git a/docs/models/operations/includedetails.md b/docs/models/operations/includedetails.md new file mode 100644 index 0000000..e870da0 --- /dev/null +++ b/docs/models/operations/includedetails.md @@ -0,0 +1,13 @@ +# IncludeDetails + +Whether or not to include details for a section (types, filters, and sorts). +Only exists for backwards compatibility, media providers other than the server libraries have it on always. + + + +## Values + +| Name | Value | +| -------------------- | -------------------- | +| `IncludeDetailsZero` | 0 | +| `IncludeDetailsOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/level.md b/docs/models/operations/level.md new file mode 100644 index 0000000..7df5cc1 --- /dev/null +++ b/docs/models/operations/level.md @@ -0,0 +1,20 @@ +# Level + +An integer log level to write to the PMS log with. +0: Error +1: Warning +2: Info +3: Debug +4: Verbose + + + +## Values + +| Name | Value | +| ------------ | ------------ | +| `LevelZero` | 0 | +| `LevelOne` | 1 | +| `LevelTwo` | 2 | +| `LevelThree` | 3 | +| `LevelFour` | 4 | \ No newline at end of file diff --git a/docs/models/operations/loglinerequest.md b/docs/models/operations/loglinerequest.md new file mode 100644 index 0000000..ad94711 --- /dev/null +++ b/docs/models/operations/loglinerequest.md @@ -0,0 +1,10 @@ +# LogLineRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `Level` | [operations.Level](../../models/operations/level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
| | +| `Message` | *string* | :heavy_check_mark: | The text of the message to write to the log. | | +| `Source` | *string* | :heavy_check_mark: | a string indicating the source of the message. | | \ No newline at end of file diff --git a/docs/models/operations/loglineresponse.md b/docs/models/operations/loglineresponse.md new file mode 100644 index 0000000..d2b0d39 --- /dev/null +++ b/docs/models/operations/loglineresponse.md @@ -0,0 +1,10 @@ +# LogLineResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/logmultilineresponse.md b/docs/models/operations/logmultilineresponse.md new file mode 100644 index 0000000..cfab4ae --- /dev/null +++ b/docs/models/operations/logmultilineresponse.md @@ -0,0 +1,10 @@ +# LogMultiLineResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/markplayedrequest.md b/docs/models/operations/markplayedrequest.md new file mode 100644 index 0000000..f4b1048 --- /dev/null +++ b/docs/models/operations/markplayedrequest.md @@ -0,0 +1,8 @@ +# MarkPlayedRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Key` | *float64* | :heavy_check_mark: | The media key to mark as played | 59398 | \ No newline at end of file diff --git a/docs/models/operations/markplayedresponse.md b/docs/models/operations/markplayedresponse.md new file mode 100644 index 0000000..482d178 --- /dev/null +++ b/docs/models/operations/markplayedresponse.md @@ -0,0 +1,10 @@ +# MarkPlayedResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/markunplayedrequest.md b/docs/models/operations/markunplayedrequest.md new file mode 100644 index 0000000..fe10f9a --- /dev/null +++ b/docs/models/operations/markunplayedrequest.md @@ -0,0 +1,8 @@ +# MarkUnplayedRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +| `Key` | *float64* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 | \ No newline at end of file diff --git a/docs/models/operations/markunplayedresponse.md b/docs/models/operations/markunplayedresponse.md new file mode 100644 index 0000000..b9ef2f4 --- /dev/null +++ b/docs/models/operations/markunplayedresponse.md @@ -0,0 +1,10 @@ +# MarkUnplayedResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/media.md b/docs/models/operations/media.md new file mode 100644 index 0000000..98b32ba --- /dev/null +++ b/docs/models/operations/media.md @@ -0,0 +1,23 @@ +# Media + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 120345 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 7474422 | +| `Bitrate` | **float64* | :heavy_minus_sign: | N/A | 3623 | +| `Width` | **float64* | :heavy_minus_sign: | N/A | 1920 | +| `Height` | **float64* | :heavy_minus_sign: | N/A | 804 | +| `AspectRatio` | **float64* | :heavy_minus_sign: | N/A | 2.35 | +| `AudioChannels` | **float64* | :heavy_minus_sign: | N/A | 6 | +| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | ac3 | +| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | h264 | +| `VideoResolution` | **float64* | :heavy_minus_sign: | N/A | 1080 | +| `Container` | **string* | :heavy_minus_sign: | N/A | mp4 | +| `VideoFrameRate` | **string* | :heavy_minus_sign: | N/A | 24p | +| `OptimizedForStreaming` | **float64* | :heavy_minus_sign: | N/A | 0 | +| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | | +| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | high | +| `Part` | [][operations.Part](../../models/operations/part.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/mediacontainer.md b/docs/models/operations/mediacontainer.md new file mode 100644 index 0000000..feaf0f8 --- /dev/null +++ b/docs/models/operations/mediacontainer.md @@ -0,0 +1,58 @@ +# MediaContainer + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `Size` | **float64* | :heavy_minus_sign: | N/A | +| `AllowCameraUpload` | **bool* | :heavy_minus_sign: | N/A | +| `AllowChannelAccess` | **bool* | :heavy_minus_sign: | N/A | +| `AllowMediaDeletion` | **bool* | :heavy_minus_sign: | N/A | +| `AllowSharing` | **bool* | :heavy_minus_sign: | N/A | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | +| `AllowTuners` | **bool* | :heavy_minus_sign: | N/A | +| `BackgroundProcessing` | **bool* | :heavy_minus_sign: | N/A | +| `Certificate` | **bool* | :heavy_minus_sign: | N/A | +| `CompanionProxy` | **bool* | :heavy_minus_sign: | N/A | +| `CountryCode` | **string* | :heavy_minus_sign: | N/A | +| `Diagnostics` | **string* | :heavy_minus_sign: | N/A | +| `EventStream` | **bool* | :heavy_minus_sign: | N/A | +| `FriendlyName` | **string* | :heavy_minus_sign: | N/A | +| `HubSearch` | **bool* | :heavy_minus_sign: | N/A | +| `ItemClusters` | **bool* | :heavy_minus_sign: | N/A | +| `Livetv` | **float64* | :heavy_minus_sign: | N/A | +| `MachineIdentifier` | **string* | :heavy_minus_sign: | N/A | +| `MediaProviders` | **bool* | :heavy_minus_sign: | N/A | +| `Multiuser` | **bool* | :heavy_minus_sign: | N/A | +| `MusicAnalysis` | **float64* | :heavy_minus_sign: | N/A | +| `MyPlex` | **bool* | :heavy_minus_sign: | N/A | +| `MyPlexMappingState` | **string* | :heavy_minus_sign: | N/A | +| `MyPlexSigninState` | **string* | :heavy_minus_sign: | N/A | +| `MyPlexSubscription` | **bool* | :heavy_minus_sign: | N/A | +| `MyPlexUsername` | **string* | :heavy_minus_sign: | N/A | +| `OfflineTranscode` | **float64* | :heavy_minus_sign: | N/A | +| `OwnerFeatures` | **string* | :heavy_minus_sign: | N/A | +| `PhotoAutoTag` | **bool* | :heavy_minus_sign: | N/A | +| `Platform` | **string* | :heavy_minus_sign: | N/A | +| `PlatformVersion` | **string* | :heavy_minus_sign: | N/A | +| `PluginHost` | **bool* | :heavy_minus_sign: | N/A | +| `PushNotifications` | **bool* | :heavy_minus_sign: | N/A | +| `ReadOnlyLibraries` | **bool* | :heavy_minus_sign: | N/A | +| `StreamingBrainABRVersion` | **float64* | :heavy_minus_sign: | N/A | +| `StreamingBrainVersion` | **float64* | :heavy_minus_sign: | N/A | +| `Sync` | **bool* | :heavy_minus_sign: | N/A | +| `TranscoderActiveVideoSessions` | **float64* | :heavy_minus_sign: | N/A | +| `TranscoderAudio` | **bool* | :heavy_minus_sign: | N/A | +| `TranscoderLyrics` | **bool* | :heavy_minus_sign: | N/A | +| `TranscoderPhoto` | **bool* | :heavy_minus_sign: | N/A | +| `TranscoderSubtitles` | **bool* | :heavy_minus_sign: | N/A | +| `TranscoderVideo` | **bool* | :heavy_minus_sign: | N/A | +| `TranscoderVideoBitrates` | **string* | :heavy_minus_sign: | N/A | +| `TranscoderVideoQualities` | **string* | :heavy_minus_sign: | N/A | +| `TranscoderVideoResolutions` | **string* | :heavy_minus_sign: | N/A | +| `UpdatedAt` | **float64* | :heavy_minus_sign: | N/A | +| `Updater` | **bool* | :heavy_minus_sign: | N/A | +| `Version` | **string* | :heavy_minus_sign: | N/A | +| `VoiceSearch` | **bool* | :heavy_minus_sign: | N/A | +| `Directory` | [][operations.Directory](../../models/operations/directory.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/metadata.md b/docs/models/operations/metadata.md new file mode 100644 index 0000000..5928fb4 --- /dev/null +++ b/docs/models/operations/metadata.md @@ -0,0 +1,39 @@ +# Metadata + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AllowSync` | **bool* | :heavy_minus_sign: | N/A | | +| `LibrarySectionID` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `LibrarySectionTitle` | **string* | :heavy_minus_sign: | N/A | Movies | +| `LibrarySectionUUID` | **string* | :heavy_minus_sign: | N/A | 322a231a-b7f7-49f5-920f-14c61199cd30 | +| `RatingKey` | **float64* | :heavy_minus_sign: | N/A | 59398 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/metadata/59398 | +| `GUID` | **string* | :heavy_minus_sign: | N/A | plex://movie/5e161a83bea6ac004126e148 | +| `Studio` | **string* | :heavy_minus_sign: | N/A | Marvel Studios | +| `Type` | **string* | :heavy_minus_sign: | N/A | movie | +| `Title` | **string* | :heavy_minus_sign: | N/A | Ant-Man and the Wasp: Quantumania | +| `ContentRating` | **string* | :heavy_minus_sign: | N/A | PG-13 | +| `Summary` | **string* | :heavy_minus_sign: | N/A | Scott Lang and Hope Van Dyne along with Hank Pym and Janet Van Dyne explore the Quantum Realm where they interact with strange creatures and embark on an adventure that goes beyond the limits of what they thought was possible. | +| `Rating` | **float64* | :heavy_minus_sign: | N/A | 4.7 | +| `AudienceRating` | **float64* | :heavy_minus_sign: | N/A | 8.3 | +| `Year` | **float64* | :heavy_minus_sign: | N/A | 2023 | +| `Tagline` | **string* | :heavy_minus_sign: | N/A | Witness the beginning of a new dynasty. | +| `Thumb` | **string* | :heavy_minus_sign: | N/A | /library/metadata/59398/thumb/1681888010 | +| `Art` | **string* | :heavy_minus_sign: | N/A | /library/metadata/59398/art/1681888010 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 7474422 | +| `OriginallyAvailableAt` | [*time.Time](https://pkg.go.dev/time#Time) | :heavy_minus_sign: | N/A | 2023-02-15 00:00:00 +0000 UTC | +| `AddedAt` | **float64* | :heavy_minus_sign: | N/A | 1681803215 | +| `UpdatedAt` | **float64* | :heavy_minus_sign: | N/A | 1681888010 | +| `AudienceRatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.upright | +| `ChapterSource` | **string* | :heavy_minus_sign: | N/A | media | +| `PrimaryExtraKey` | **string* | :heavy_minus_sign: | N/A | /library/metadata/59399 | +| `RatingImage` | **string* | :heavy_minus_sign: | N/A | rottentomatoes://image.rating.rotten | +| `Media` | [][operations.Media](../../models/operations/media.md) | :heavy_minus_sign: | N/A | | +| `Genre` | [][operations.Genre](../../models/operations/genre.md) | :heavy_minus_sign: | N/A | | +| `Director` | [][operations.Director](../../models/operations/director.md) | :heavy_minus_sign: | N/A | | +| `Writer` | [][operations.Writer](../../models/operations/writer.md) | :heavy_minus_sign: | N/A | | +| `Country` | [][operations.Country](../../models/operations/country.md) | :heavy_minus_sign: | N/A | | +| `Role` | [][operations.Role](../../models/operations/role.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/operations/minsize.md b/docs/models/operations/minsize.md new file mode 100644 index 0000000..c34949d --- /dev/null +++ b/docs/models/operations/minsize.md @@ -0,0 +1,11 @@ +# MinSize + +images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `MinSizeZero` | 0 | +| `MinSizeOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/myplex.md b/docs/models/operations/myplex.md new file mode 100644 index 0000000..9fb5227 --- /dev/null +++ b/docs/models/operations/myplex.md @@ -0,0 +1,19 @@ +# MyPlex + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AuthToken` | **string* | :heavy_minus_sign: | N/A | Z5v-PrNASDFpsaCi3CPK7 | +| `Username` | **string* | :heavy_minus_sign: | N/A | example.email@mail.com | +| `MappingState` | **string* | :heavy_minus_sign: | N/A | mapped | +| `MappingError` | **string* | :heavy_minus_sign: | N/A | | +| `SignInState` | **string* | :heavy_minus_sign: | N/A | ok | +| `PublicAddress` | **string* | :heavy_minus_sign: | N/A | 140.20.68.140 | +| `PublicPort` | **float64* | :heavy_minus_sign: | N/A | 32400 | +| `PrivateAddress` | **string* | :heavy_minus_sign: | N/A | 10.10.10.47 | +| `PrivatePort` | **float64* | :heavy_minus_sign: | N/A | 32400 | +| `SubscriptionFeatures` | **string* | :heavy_minus_sign: | N/A | federated-auth,hardware_transcoding,home,hwtranscode,item_clusters,kevin-bacon,livetv,loudness,lyrics,music-analysis,music_videos,pass,photo_autotags,photos-v5,photosV6-edit,photosV6-tv-albums,premium_music_metadata,radio,server-manager,session_bandwidth_restrictions,session_kick,shared-radio,sync,trailers,tuner-sharing,type-first,unsupportedtuners,webhooks | +| `SubscriptionActive` | **bool* | :heavy_minus_sign: | N/A | | +| `SubscriptionState` | **string* | :heavy_minus_sign: | N/A | Active | \ No newline at end of file diff --git a/docs/models/operations/onlytransient.md b/docs/models/operations/onlytransient.md new file mode 100644 index 0000000..821597b --- /dev/null +++ b/docs/models/operations/onlytransient.md @@ -0,0 +1,11 @@ +# OnlyTransient + +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). + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `OnlyTransientZero` | 0 | +| `OnlyTransientOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/part.md b/docs/models/operations/part.md new file mode 100644 index 0000000..1ae9532 --- /dev/null +++ b/docs/models/operations/part.md @@ -0,0 +1,17 @@ +# Part + + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 120353 | +| `Key` | **string* | :heavy_minus_sign: | N/A | /library/parts/120353/1681803203/file.mp4 | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 7474422 | +| `File` | **string* | :heavy_minus_sign: | N/A | /movies/Ant-Man and the Wasp Quantumania (2023)/Ant-Man.and.the.Wasp.Quantumania.2023.1080p.mp4 | +| `Size` | **float64* | :heavy_minus_sign: | N/A | 3395307162 | +| `Container` | **string* | :heavy_minus_sign: | N/A | mp4 | +| `Has64bitOffsets` | **bool* | :heavy_minus_sign: | N/A | | +| `HasThumbnail` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `OptimizedForStreaming` | **bool* | :heavy_minus_sign: | N/A | | +| `VideoProfile` | **string* | :heavy_minus_sign: | N/A | high | \ No newline at end of file diff --git a/docs/models/operations/pathparamtaskname.md b/docs/models/operations/pathparamtaskname.md new file mode 100644 index 0000000..af025a7 --- /dev/null +++ b/docs/models/operations/pathparamtaskname.md @@ -0,0 +1,23 @@ +# PathParamTaskName + +The name of the task to be started. + + +## Values + +| Name | Value | +| -------------------------------------------- | -------------------------------------------- | +| `PathParamTaskNameBackupDatabase` | BackupDatabase | +| `PathParamTaskNameBuildGracenoteCollections` | BuildGracenoteCollections | +| `PathParamTaskNameCheckForUpdates` | CheckForUpdates | +| `PathParamTaskNameCleanOldBundles` | CleanOldBundles | +| `PathParamTaskNameCleanOldCacheFiles` | CleanOldCacheFiles | +| `PathParamTaskNameDeepMediaAnalysis` | DeepMediaAnalysis | +| `PathParamTaskNameGenerateAutoTags` | GenerateAutoTags | +| `PathParamTaskNameGenerateChapterThumbs` | GenerateChapterThumbs | +| `PathParamTaskNameGenerateMediaIndexFiles` | GenerateMediaIndexFiles | +| `PathParamTaskNameOptimizeDatabase` | OptimizeDatabase | +| `PathParamTaskNameRefreshLibraries` | RefreshLibraries | +| `PathParamTaskNameRefreshLocalMedia` | RefreshLocalMedia | +| `PathParamTaskNameRefreshPeriodicMetadata` | RefreshPeriodicMetadata | +| `PathParamTaskNameUpgradeMediaAnalysis` | UpgradeMediaAnalysis | \ No newline at end of file diff --git a/docs/models/operations/performsearchrequest.md b/docs/models/operations/performsearchrequest.md new file mode 100644 index 0000000..6eaa10c --- /dev/null +++ b/docs/models/operations/performsearchrequest.md @@ -0,0 +1,10 @@ +# PerformSearchRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Query` | *string* | :heavy_check_mark: | The query term | arnold | +| `SectionID` | **float64* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | | +| `Limit` | **float64* | :heavy_minus_sign: | The number of items to return per hub | 5 | \ No newline at end of file diff --git a/docs/models/operations/performsearchresponse.md b/docs/models/operations/performsearchresponse.md new file mode 100644 index 0000000..3cbad9c --- /dev/null +++ b/docs/models/operations/performsearchresponse.md @@ -0,0 +1,10 @@ +# PerformSearchResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/performvoicesearchrequest.md b/docs/models/operations/performvoicesearchrequest.md new file mode 100644 index 0000000..8447212 --- /dev/null +++ b/docs/models/operations/performvoicesearchrequest.md @@ -0,0 +1,10 @@ +# PerformVoiceSearchRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `Query` | *string* | :heavy_check_mark: | The query term | dead+poop | +| `SectionID` | **float64* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | | +| `Limit` | **float64* | :heavy_minus_sign: | The number of items to return per hub | 5 | \ No newline at end of file diff --git a/docs/models/operations/performvoicesearchresponse.md b/docs/models/operations/performvoicesearchresponse.md new file mode 100644 index 0000000..cf7d06b --- /dev/null +++ b/docs/models/operations/performvoicesearchresponse.md @@ -0,0 +1,10 @@ +# PerformVoiceSearchResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/playlisttype.md b/docs/models/operations/playlisttype.md new file mode 100644 index 0000000..ab5ca88 --- /dev/null +++ b/docs/models/operations/playlisttype.md @@ -0,0 +1,12 @@ +# PlaylistType + +limit to a type of playlist. + + +## Values + +| Name | Value | +| ------------------- | ------------------- | +| `PlaylistTypeAudio` | audio | +| `PlaylistTypeVideo` | video | +| `PlaylistTypePhoto` | photo | \ No newline at end of file diff --git a/docs/models/operations/provider.md b/docs/models/operations/provider.md new file mode 100644 index 0000000..464aaf1 --- /dev/null +++ b/docs/models/operations/provider.md @@ -0,0 +1,10 @@ +# Provider + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | /system/search | +| `Title` | **string* | :heavy_minus_sign: | N/A | Local Network | +| `Type` | **string* | :heavy_minus_sign: | N/A | mixed | \ No newline at end of file diff --git a/docs/models/operations/queryparamonlytransient.md b/docs/models/operations/queryparamonlytransient.md new file mode 100644 index 0000000..ed114a5 --- /dev/null +++ b/docs/models/operations/queryparamonlytransient.md @@ -0,0 +1,11 @@ +# QueryParamOnlyTransient + +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). + + +## Values + +| Name | Value | +| ----------------------------- | ----------------------------- | +| `QueryParamOnlyTransientZero` | 0 | +| `QueryParamOnlyTransientOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamsmart.md b/docs/models/operations/queryparamsmart.md new file mode 100644 index 0000000..cfa97c1 --- /dev/null +++ b/docs/models/operations/queryparamsmart.md @@ -0,0 +1,11 @@ +# QueryParamSmart + +type of playlists to return (default is all). + + +## Values + +| Name | Value | +| --------------------- | --------------------- | +| `QueryParamSmartZero` | 0 | +| `QueryParamSmartOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/queryparamtype.md b/docs/models/operations/queryparamtype.md new file mode 100644 index 0000000..20f3653 --- /dev/null +++ b/docs/models/operations/queryparamtype.md @@ -0,0 +1,10 @@ +# QueryParamType + +`delegation` - This is the only supported `type` parameter. + + +## Values + +| Name | Value | +| -------------------------- | -------------------------- | +| `QueryParamTypeDelegation` | delegation | \ No newline at end of file diff --git a/docs/models/operations/refreshlibraryrequest.md b/docs/models/operations/refreshlibraryrequest.md new file mode 100644 index 0000000..aaa03d8 --- /dev/null +++ b/docs/models/operations/refreshlibraryrequest.md @@ -0,0 +1,8 @@ +# RefreshLibraryRequest + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `SectionID` | *float64* | :heavy_check_mark: | the Id of the library to refresh | \ No newline at end of file diff --git a/docs/models/operations/refreshlibraryresponse.md b/docs/models/operations/refreshlibraryresponse.md new file mode 100644 index 0000000..92d8634 --- /dev/null +++ b/docs/models/operations/refreshlibraryresponse.md @@ -0,0 +1,10 @@ +# RefreshLibraryResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/responsebody.md b/docs/models/operations/responsebody.md new file mode 100644 index 0000000..3f24231 --- /dev/null +++ b/docs/models/operations/responsebody.md @@ -0,0 +1,8 @@ +# ResponseBody + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `MediaContainer` | [*operations.GetAvailableClientsMediaContainer](../../models/operations/getavailableclientsmediacontainer.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/role.md b/docs/models/operations/role.md new file mode 100644 index 0000000..bd0479f --- /dev/null +++ b/docs/models/operations/role.md @@ -0,0 +1,8 @@ +# Role + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Paul Rudd | \ No newline at end of file diff --git a/docs/models/operations/scope.md b/docs/models/operations/scope.md new file mode 100644 index 0000000..40d9585 --- /dev/null +++ b/docs/models/operations/scope.md @@ -0,0 +1,10 @@ +# Scope + +`all` - This is the only supported `scope` parameter. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `ScopeAll` | all | \ No newline at end of file diff --git a/docs/models/operations/server.md b/docs/models/operations/server.md new file mode 100644 index 0000000..8cc2dba --- /dev/null +++ b/docs/models/operations/server.md @@ -0,0 +1,18 @@ +# Server + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `Name` | **string* | :heavy_minus_sign: | N/A | iPad | +| `Host` | **string* | :heavy_minus_sign: | N/A | 10.10.10.102 | +| `Address` | **string* | :heavy_minus_sign: | N/A | 10.10.10.102 | +| `Port` | **float64* | :heavy_minus_sign: | N/A | 32500 | +| `MachineIdentifier` | **string* | :heavy_minus_sign: | N/A | A2E901F8-E016-43A7-ADFB-EF8CA8A4AC05 | +| `Version` | **string* | :heavy_minus_sign: | N/A | 8.17 | +| `Protocol` | **string* | :heavy_minus_sign: | N/A | plex | +| `Product` | **string* | :heavy_minus_sign: | N/A | Plex for iOS | +| `DeviceClass` | **string* | :heavy_minus_sign: | N/A | tablet | +| `ProtocolVersion` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `ProtocolCapabilities` | **string* | :heavy_minus_sign: | N/A | playback,playqueues,timeline,provider-playback | \ No newline at end of file diff --git a/docs/models/operations/skip.md b/docs/models/operations/skip.md new file mode 100644 index 0000000..c44166a --- /dev/null +++ b/docs/models/operations/skip.md @@ -0,0 +1,11 @@ +# Skip + +Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. + + +## Values + +| Name | Value | +| ---------- | ---------- | +| `SkipZero` | 0 | +| `SkipOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/smart.md b/docs/models/operations/smart.md new file mode 100644 index 0000000..a090f94 --- /dev/null +++ b/docs/models/operations/smart.md @@ -0,0 +1,11 @@ +# Smart + +whether the playlist is smart or not + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `SmartZero` | 0 | +| `SmartOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/startalltasksresponse.md b/docs/models/operations/startalltasksresponse.md new file mode 100644 index 0000000..d1eccb1 --- /dev/null +++ b/docs/models/operations/startalltasksresponse.md @@ -0,0 +1,10 @@ +# StartAllTasksResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/starttaskrequest.md b/docs/models/operations/starttaskrequest.md new file mode 100644 index 0000000..1be0bc7 --- /dev/null +++ b/docs/models/operations/starttaskrequest.md @@ -0,0 +1,8 @@ +# StartTaskRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `TaskName` | [operations.TaskName](../../models/operations/taskname.md) | :heavy_check_mark: | the name of the task to be started. | \ No newline at end of file diff --git a/docs/models/operations/starttaskresponse.md b/docs/models/operations/starttaskresponse.md new file mode 100644 index 0000000..6d0ec21 --- /dev/null +++ b/docs/models/operations/starttaskresponse.md @@ -0,0 +1,10 @@ +# StartTaskResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/startuniversaltranscoderequest.md b/docs/models/operations/startuniversaltranscoderequest.md new file mode 100644 index 0000000..a0bc909 --- /dev/null +++ b/docs/models/operations/startuniversaltranscoderequest.md @@ -0,0 +1,23 @@ +# StartUniversalTranscodeRequest + + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| `HasMDE` | *float64* | :heavy_check_mark: | Whether the media item has MDE | +| `Path` | *string* | :heavy_check_mark: | The path to the media item to transcode | +| `MediaIndex` | *float64* | :heavy_check_mark: | The index of the media item to transcode | +| `PartIndex` | *float64* | :heavy_check_mark: | The index of the part to transcode | +| `Protocol` | *string* | :heavy_check_mark: | The protocol to use for the transcode session | +| `FastSeek` | **float64* | :heavy_minus_sign: | Whether to use fast seek or not | +| `DirectPlay` | **float64* | :heavy_minus_sign: | Whether to use direct play or not | +| `DirectStream` | **float64* | :heavy_minus_sign: | Whether to use direct stream or not | +| `SubtitleSize` | **float64* | :heavy_minus_sign: | The size of the subtitles | +| `Subtites` | **string* | :heavy_minus_sign: | The subtitles | +| `AudioBoost` | **float64* | :heavy_minus_sign: | The audio boost | +| `Location` | **string* | :heavy_minus_sign: | The location of the transcode session | +| `MediaBufferSize` | **float64* | :heavy_minus_sign: | The size of the media buffer | +| `Session` | **string* | :heavy_minus_sign: | The session ID | +| `AddDebugOverlay` | **float64* | :heavy_minus_sign: | Whether to add a debug overlay or not | +| `AutoAdjustQuality` | **float64* | :heavy_minus_sign: | Whether to auto adjust quality or not | \ No newline at end of file diff --git a/docs/models/operations/startuniversaltranscoderesponse.md b/docs/models/operations/startuniversaltranscoderesponse.md new file mode 100644 index 0000000..1f5064b --- /dev/null +++ b/docs/models/operations/startuniversaltranscoderesponse.md @@ -0,0 +1,10 @@ +# StartUniversalTranscodeResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/state.md b/docs/models/operations/state.md new file mode 100644 index 0000000..93e2776 --- /dev/null +++ b/docs/models/operations/state.md @@ -0,0 +1,12 @@ +# State + +The state of the media item + + +## Values + +| Name | Value | +| -------------- | -------------- | +| `StatePlaying` | playing | +| `StatePaused` | paused | +| `StateStopped` | stopped | \ No newline at end of file diff --git a/docs/models/operations/stopalltasksresponse.md b/docs/models/operations/stopalltasksresponse.md new file mode 100644 index 0000000..96f14ee --- /dev/null +++ b/docs/models/operations/stopalltasksresponse.md @@ -0,0 +1,10 @@ +# StopAllTasksResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/stoptaskrequest.md b/docs/models/operations/stoptaskrequest.md new file mode 100644 index 0000000..1f6b005 --- /dev/null +++ b/docs/models/operations/stoptaskrequest.md @@ -0,0 +1,8 @@ +# StopTaskRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `TaskName` | [operations.PathParamTaskName](../../models/operations/pathparamtaskname.md) | :heavy_check_mark: | The name of the task to be started. | \ No newline at end of file diff --git a/docs/models/operations/stoptaskresponse.md b/docs/models/operations/stoptaskresponse.md new file mode 100644 index 0000000..56756f9 --- /dev/null +++ b/docs/models/operations/stoptaskresponse.md @@ -0,0 +1,10 @@ +# StopTaskResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/stoptranscodesessionrequest.md b/docs/models/operations/stoptranscodesessionrequest.md new file mode 100644 index 0000000..d694f48 --- /dev/null +++ b/docs/models/operations/stoptranscodesessionrequest.md @@ -0,0 +1,8 @@ +# StopTranscodeSessionRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| `SessionKey` | *string* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep | \ No newline at end of file diff --git a/docs/models/operations/stoptranscodesessionresponse.md b/docs/models/operations/stoptranscodesessionresponse.md new file mode 100644 index 0000000..79f4d0a --- /dev/null +++ b/docs/models/operations/stoptranscodesessionresponse.md @@ -0,0 +1,10 @@ +# StopTranscodeSessionResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/stream.md b/docs/models/operations/stream.md new file mode 100644 index 0000000..94f0fa3 --- /dev/null +++ b/docs/models/operations/stream.md @@ -0,0 +1,30 @@ +# Stream + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `ID` | **float64* | :heavy_minus_sign: | N/A | 211234 | +| `StreamType` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `Default` | **bool* | :heavy_minus_sign: | N/A | | +| `Codec` | **string* | :heavy_minus_sign: | N/A | hevc | +| `Index` | **float64* | :heavy_minus_sign: | N/A | 0 | +| `Bitrate` | **float64* | :heavy_minus_sign: | N/A | 918 | +| `Language` | **string* | :heavy_minus_sign: | N/A | English | +| `LanguageTag` | **string* | :heavy_minus_sign: | N/A | en | +| `LanguageCode` | **string* | :heavy_minus_sign: | N/A | eng | +| `BitDepth` | **float64* | :heavy_minus_sign: | N/A | 8 | +| `ChromaLocation` | **string* | :heavy_minus_sign: | N/A | left | +| `ChromaSubsampling` | **string* | :heavy_minus_sign: | N/A | 4:2:0 | +| `CodedHeight` | **float64* | :heavy_minus_sign: | N/A | 1080 | +| `CodedWidth` | **float64* | :heavy_minus_sign: | N/A | 1920 | +| `ColorRange` | **string* | :heavy_minus_sign: | N/A | tv | +| `FrameRate` | **float64* | :heavy_minus_sign: | N/A | 25 | +| `Height` | **float64* | :heavy_minus_sign: | N/A | 1080 | +| `Level` | **float64* | :heavy_minus_sign: | N/A | 120 | +| `Profile` | **string* | :heavy_minus_sign: | N/A | main | +| `RefFrames` | **float64* | :heavy_minus_sign: | N/A | 1 | +| `Width` | **float64* | :heavy_minus_sign: | N/A | 1920 | +| `DisplayTitle` | **string* | :heavy_minus_sign: | N/A | 1080p (HEVC Main) | +| `ExtendedDisplayTitle` | **string* | :heavy_minus_sign: | N/A | 1080p (HEVC Main) | \ No newline at end of file diff --git a/docs/models/operations/taskname.md b/docs/models/operations/taskname.md new file mode 100644 index 0000000..ef800bd --- /dev/null +++ b/docs/models/operations/taskname.md @@ -0,0 +1,23 @@ +# TaskName + +the name of the task to be started. + + +## Values + +| Name | Value | +| ----------------------------------- | ----------------------------------- | +| `TaskNameBackupDatabase` | BackupDatabase | +| `TaskNameBuildGracenoteCollections` | BuildGracenoteCollections | +| `TaskNameCheckForUpdates` | CheckForUpdates | +| `TaskNameCleanOldBundles` | CleanOldBundles | +| `TaskNameCleanOldCacheFiles` | CleanOldCacheFiles | +| `TaskNameDeepMediaAnalysis` | DeepMediaAnalysis | +| `TaskNameGenerateAutoTags` | GenerateAutoTags | +| `TaskNameGenerateChapterThumbs` | GenerateChapterThumbs | +| `TaskNameGenerateMediaIndexFiles` | GenerateMediaIndexFiles | +| `TaskNameOptimizeDatabase` | OptimizeDatabase | +| `TaskNameRefreshLibraries` | RefreshLibraries | +| `TaskNameRefreshLocalMedia` | RefreshLocalMedia | +| `TaskNameRefreshPeriodicMetadata` | RefreshPeriodicMetadata | +| `TaskNameUpgradeMediaAnalysis` | UpgradeMediaAnalysis | \ No newline at end of file diff --git a/docs/models/operations/tonight.md b/docs/models/operations/tonight.md new file mode 100644 index 0000000..5968d95 --- /dev/null +++ b/docs/models/operations/tonight.md @@ -0,0 +1,11 @@ +# Tonight + +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 + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `TonightZero` | 0 | +| `TonightOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/transcodesession.md b/docs/models/operations/transcodesession.md new file mode 100644 index 0000000..44873f2 --- /dev/null +++ b/docs/models/operations/transcodesession.md @@ -0,0 +1,29 @@ +# TranscodeSession + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | ------------------------ | +| `Key` | **string* | :heavy_minus_sign: | N/A | zz7llzqlx8w9vnrsbnwhbmep | +| `Throttled` | **bool* | :heavy_minus_sign: | N/A | | +| `Complete` | **bool* | :heavy_minus_sign: | N/A | | +| `Progress` | **float64* | :heavy_minus_sign: | N/A | 0.4000000059604645 | +| `Size` | **float64* | :heavy_minus_sign: | N/A | -22 | +| `Speed` | **float64* | :heavy_minus_sign: | N/A | 22.399999618530273 | +| `Error` | **bool* | :heavy_minus_sign: | N/A | | +| `Duration` | **float64* | :heavy_minus_sign: | N/A | 2561768 | +| `Context` | **string* | :heavy_minus_sign: | N/A | streaming | +| `SourceVideoCodec` | **string* | :heavy_minus_sign: | N/A | h264 | +| `SourceAudioCodec` | **string* | :heavy_minus_sign: | N/A | ac3 | +| `VideoDecision` | **string* | :heavy_minus_sign: | N/A | transcode | +| `AudioDecision` | **string* | :heavy_minus_sign: | N/A | transcode | +| `Protocol` | **string* | :heavy_minus_sign: | N/A | http | +| `Container` | **string* | :heavy_minus_sign: | N/A | mkv | +| `VideoCodec` | **string* | :heavy_minus_sign: | N/A | h264 | +| `AudioCodec` | **string* | :heavy_minus_sign: | N/A | opus | +| `AudioChannels` | **float64* | :heavy_minus_sign: | N/A | 2 | +| `TranscodeHwRequested` | **bool* | :heavy_minus_sign: | N/A | | +| `TimeStamp` | **float64* | :heavy_minus_sign: | N/A | 1.6818695357764285e+09 | +| `MaxOffsetAvailable` | **float64* | :heavy_minus_sign: | N/A | 861.778 | +| `MinOffsetAvailable` | **float64* | :heavy_minus_sign: | N/A | 0 | \ No newline at end of file diff --git a/docs/models/operations/type.md b/docs/models/operations/type.md new file mode 100644 index 0000000..ecf08d5 --- /dev/null +++ b/docs/models/operations/type.md @@ -0,0 +1,12 @@ +# Type + +type of playlist to create + + +## Values + +| Name | Value | +| ----------- | ----------- | +| `TypeAudio` | audio | +| `TypeVideo` | video | +| `TypePhoto` | photo | \ No newline at end of file diff --git a/docs/models/operations/updateplaylistrequest.md b/docs/models/operations/updateplaylistrequest.md new file mode 100644 index 0000000..9e3d12e --- /dev/null +++ b/docs/models/operations/updateplaylistrequest.md @@ -0,0 +1,8 @@ +# UpdatePlaylistRequest + + +## Fields + +| Field | Type | Required | Description | +| ---------------------- | ---------------------- | ---------------------- | ---------------------- | +| `PlaylistID` | *float64* | :heavy_check_mark: | the ID of the playlist | \ No newline at end of file diff --git a/docs/models/operations/updateplaylistresponse.md b/docs/models/operations/updateplaylistresponse.md new file mode 100644 index 0000000..1c8dba4 --- /dev/null +++ b/docs/models/operations/updateplaylistresponse.md @@ -0,0 +1,10 @@ +# UpdatePlaylistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/updateplayprogressrequest.md b/docs/models/operations/updateplayprogressrequest.md new file mode 100644 index 0000000..3dbfc3c --- /dev/null +++ b/docs/models/operations/updateplayprogressrequest.md @@ -0,0 +1,10 @@ +# UpdatePlayProgressRequest + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `Key` | *string* | :heavy_check_mark: | the media key | +| `Time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | +| `State` | *string* | :heavy_check_mark: | The playback state of the media item. | \ No newline at end of file diff --git a/docs/models/operations/updateplayprogressresponse.md b/docs/models/operations/updateplayprogressresponse.md new file mode 100644 index 0000000..5e31258 --- /dev/null +++ b/docs/models/operations/updateplayprogressresponse.md @@ -0,0 +1,10 @@ +# UpdatePlayProgressResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/uploadplaylistrequest.md b/docs/models/operations/uploadplaylistrequest.md new file mode 100644 index 0000000..760871b --- /dev/null +++ b/docs/models/operations/uploadplaylistrequest.md @@ -0,0 +1,9 @@ +# UploadPlaylistRequest + + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `Path` | *string* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
| /home/barkley/playlist.m3u | +| `Force` | [operations.Force](../../models/operations/force.md) | :heavy_check_mark: | force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | \ No newline at end of file diff --git a/docs/models/operations/uploadplaylistresponse.md b/docs/models/operations/uploadplaylistresponse.md new file mode 100644 index 0000000..b593cf1 --- /dev/null +++ b/docs/models/operations/uploadplaylistresponse.md @@ -0,0 +1,10 @@ +# UploadPlaylistResponse + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation | +| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/operations/upscale.md b/docs/models/operations/upscale.md new file mode 100644 index 0000000..30574a0 --- /dev/null +++ b/docs/models/operations/upscale.md @@ -0,0 +1,11 @@ +# Upscale + +allow images to be resized beyond native dimensions. + + +## Values + +| Name | Value | +| ------------- | ------------- | +| `UpscaleZero` | 0 | +| `UpscaleOne` | 1 | \ No newline at end of file diff --git a/docs/models/operations/writer.md b/docs/models/operations/writer.md new file mode 100644 index 0000000..4ef9e25 --- /dev/null +++ b/docs/models/operations/writer.md @@ -0,0 +1,8 @@ +# Writer + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | +| `Tag` | **string* | :heavy_minus_sign: | N/A | Jeff Loveness | \ No newline at end of file diff --git a/docs/models/sdkerrors/addplaylistcontentserrors.md b/docs/models/sdkerrors/addplaylistcontentserrors.md new file mode 100644 index 0000000..a1afd8a --- /dev/null +++ b/docs/models/sdkerrors/addplaylistcontentserrors.md @@ -0,0 +1,10 @@ +# AddPlaylistContentsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/addplaylistcontentsresponsebody.md b/docs/models/sdkerrors/addplaylistcontentsresponsebody.md new file mode 100644 index 0000000..93a8338 --- /dev/null +++ b/docs/models/sdkerrors/addplaylistcontentsresponsebody.md @@ -0,0 +1,11 @@ +# AddPlaylistContentsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.AddPlaylistContentsErrors](../../models/sdkerrors/addplaylistcontentserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/applyupdateserrors.md b/docs/models/sdkerrors/applyupdateserrors.md new file mode 100644 index 0000000..5fa1fc4 --- /dev/null +++ b/docs/models/sdkerrors/applyupdateserrors.md @@ -0,0 +1,10 @@ +# ApplyUpdatesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/applyupdatesresponsebody.md b/docs/models/sdkerrors/applyupdatesresponsebody.md new file mode 100644 index 0000000..3d8d4b9 --- /dev/null +++ b/docs/models/sdkerrors/applyupdatesresponsebody.md @@ -0,0 +1,11 @@ +# ApplyUpdatesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.ApplyUpdatesErrors](../../models/sdkerrors/applyupdateserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/cancelserveractivitieserrors.md b/docs/models/sdkerrors/cancelserveractivitieserrors.md new file mode 100644 index 0000000..0630a47 --- /dev/null +++ b/docs/models/sdkerrors/cancelserveractivitieserrors.md @@ -0,0 +1,10 @@ +# CancelServerActivitiesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/cancelserveractivitiesresponsebody.md b/docs/models/sdkerrors/cancelserveractivitiesresponsebody.md new file mode 100644 index 0000000..f2ed161 --- /dev/null +++ b/docs/models/sdkerrors/cancelserveractivitiesresponsebody.md @@ -0,0 +1,11 @@ +# CancelServerActivitiesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.CancelServerActivitiesErrors](../../models/sdkerrors/cancelserveractivitieserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/checkforupdateserrors.md b/docs/models/sdkerrors/checkforupdateserrors.md new file mode 100644 index 0000000..9c13e85 --- /dev/null +++ b/docs/models/sdkerrors/checkforupdateserrors.md @@ -0,0 +1,10 @@ +# CheckForUpdatesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/checkforupdatesresponsebody.md b/docs/models/sdkerrors/checkforupdatesresponsebody.md new file mode 100644 index 0000000..548d0dc --- /dev/null +++ b/docs/models/sdkerrors/checkforupdatesresponsebody.md @@ -0,0 +1,11 @@ +# CheckForUpdatesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.CheckForUpdatesErrors](../../models/sdkerrors/checkforupdateserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/clearplaylistcontentserrors.md b/docs/models/sdkerrors/clearplaylistcontentserrors.md new file mode 100644 index 0000000..94c6f96 --- /dev/null +++ b/docs/models/sdkerrors/clearplaylistcontentserrors.md @@ -0,0 +1,10 @@ +# ClearPlaylistContentsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/clearplaylistcontentsresponsebody.md b/docs/models/sdkerrors/clearplaylistcontentsresponsebody.md new file mode 100644 index 0000000..df0b78d --- /dev/null +++ b/docs/models/sdkerrors/clearplaylistcontentsresponsebody.md @@ -0,0 +1,11 @@ +# ClearPlaylistContentsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.ClearPlaylistContentsErrors](../../models/sdkerrors/clearplaylistcontentserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/createplaylisterrors.md b/docs/models/sdkerrors/createplaylisterrors.md new file mode 100644 index 0000000..fa2a38d --- /dev/null +++ b/docs/models/sdkerrors/createplaylisterrors.md @@ -0,0 +1,10 @@ +# CreatePlaylistErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/createplaylistresponsebody.md b/docs/models/sdkerrors/createplaylistresponsebody.md new file mode 100644 index 0000000..e229fd9 --- /dev/null +++ b/docs/models/sdkerrors/createplaylistresponsebody.md @@ -0,0 +1,11 @@ +# CreatePlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.CreatePlaylistErrors](../../models/sdkerrors/createplaylisterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/deletelibraryerrors.md b/docs/models/sdkerrors/deletelibraryerrors.md new file mode 100644 index 0000000..6818889 --- /dev/null +++ b/docs/models/sdkerrors/deletelibraryerrors.md @@ -0,0 +1,10 @@ +# DeleteLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/deletelibraryresponsebody.md b/docs/models/sdkerrors/deletelibraryresponsebody.md new file mode 100644 index 0000000..282ad40 --- /dev/null +++ b/docs/models/sdkerrors/deletelibraryresponsebody.md @@ -0,0 +1,11 @@ +# DeleteLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.DeleteLibraryErrors](../../models/sdkerrors/deletelibraryerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/deleteplaylisterrors.md b/docs/models/sdkerrors/deleteplaylisterrors.md new file mode 100644 index 0000000..78ff713 --- /dev/null +++ b/docs/models/sdkerrors/deleteplaylisterrors.md @@ -0,0 +1,10 @@ +# DeletePlaylistErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/deleteplaylistresponsebody.md b/docs/models/sdkerrors/deleteplaylistresponsebody.md new file mode 100644 index 0000000..03fb748 --- /dev/null +++ b/docs/models/sdkerrors/deleteplaylistresponsebody.md @@ -0,0 +1,11 @@ +# DeletePlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.DeletePlaylistErrors](../../models/sdkerrors/deleteplaylisterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/enablepapertrailerrors.md b/docs/models/sdkerrors/enablepapertrailerrors.md new file mode 100644 index 0000000..173d7cb --- /dev/null +++ b/docs/models/sdkerrors/enablepapertrailerrors.md @@ -0,0 +1,10 @@ +# EnablePaperTrailErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/enablepapertrailresponsebody.md b/docs/models/sdkerrors/enablepapertrailresponsebody.md new file mode 100644 index 0000000..4d21e7b --- /dev/null +++ b/docs/models/sdkerrors/enablepapertrailresponsebody.md @@ -0,0 +1,11 @@ +# EnablePaperTrailResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.EnablePaperTrailErrors](../../models/sdkerrors/enablepapertrailerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/errors.md b/docs/models/sdkerrors/errors.md new file mode 100644 index 0000000..ccc4d42 --- /dev/null +++ b/docs/models/sdkerrors/errors.md @@ -0,0 +1,10 @@ +# Errors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getavailableclientserrors.md b/docs/models/sdkerrors/getavailableclientserrors.md new file mode 100644 index 0000000..0bfbee3 --- /dev/null +++ b/docs/models/sdkerrors/getavailableclientserrors.md @@ -0,0 +1,10 @@ +# GetAvailableClientsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getavailableclientsresponsebody.md b/docs/models/sdkerrors/getavailableclientsresponsebody.md new file mode 100644 index 0000000..9876384 --- /dev/null +++ b/docs/models/sdkerrors/getavailableclientsresponsebody.md @@ -0,0 +1,11 @@ +# GetAvailableClientsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetAvailableClientsErrors](../../models/sdkerrors/getavailableclientserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbutlertaskserrors.md b/docs/models/sdkerrors/getbutlertaskserrors.md new file mode 100644 index 0000000..095b651 --- /dev/null +++ b/docs/models/sdkerrors/getbutlertaskserrors.md @@ -0,0 +1,10 @@ +# GetButlerTasksErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getbutlertasksresponsebody.md b/docs/models/sdkerrors/getbutlertasksresponsebody.md new file mode 100644 index 0000000..2889afe --- /dev/null +++ b/docs/models/sdkerrors/getbutlertasksresponsebody.md @@ -0,0 +1,11 @@ +# GetButlerTasksResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetButlerTasksErrors](../../models/sdkerrors/getbutlertaskserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getcommonlibraryitemserrors.md b/docs/models/sdkerrors/getcommonlibraryitemserrors.md new file mode 100644 index 0000000..5a42f2a --- /dev/null +++ b/docs/models/sdkerrors/getcommonlibraryitemserrors.md @@ -0,0 +1,10 @@ +# GetCommonLibraryItemsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getcommonlibraryitemsresponsebody.md b/docs/models/sdkerrors/getcommonlibraryitemsresponsebody.md new file mode 100644 index 0000000..aab78ec --- /dev/null +++ b/docs/models/sdkerrors/getcommonlibraryitemsresponsebody.md @@ -0,0 +1,11 @@ +# GetCommonLibraryItemsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetCommonLibraryItemsErrors](../../models/sdkerrors/getcommonlibraryitemserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getdeviceserrors.md b/docs/models/sdkerrors/getdeviceserrors.md new file mode 100644 index 0000000..39444d1 --- /dev/null +++ b/docs/models/sdkerrors/getdeviceserrors.md @@ -0,0 +1,10 @@ +# GetDevicesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getdevicesresponsebody.md b/docs/models/sdkerrors/getdevicesresponsebody.md new file mode 100644 index 0000000..b633bd3 --- /dev/null +++ b/docs/models/sdkerrors/getdevicesresponsebody.md @@ -0,0 +1,11 @@ +# GetDevicesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetDevicesErrors](../../models/sdkerrors/getdeviceserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getfilehasherrors.md b/docs/models/sdkerrors/getfilehasherrors.md new file mode 100644 index 0000000..26561a0 --- /dev/null +++ b/docs/models/sdkerrors/getfilehasherrors.md @@ -0,0 +1,10 @@ +# GetFileHashErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getfilehashresponsebody.md b/docs/models/sdkerrors/getfilehashresponsebody.md new file mode 100644 index 0000000..e865f2d --- /dev/null +++ b/docs/models/sdkerrors/getfilehashresponsebody.md @@ -0,0 +1,11 @@ +# GetFileHashResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetFileHashErrors](../../models/sdkerrors/getfilehasherrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getglobalhubserrors.md b/docs/models/sdkerrors/getglobalhubserrors.md new file mode 100644 index 0000000..8f3fe21 --- /dev/null +++ b/docs/models/sdkerrors/getglobalhubserrors.md @@ -0,0 +1,10 @@ +# GetGlobalHubsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getglobalhubsresponsebody.md b/docs/models/sdkerrors/getglobalhubsresponsebody.md new file mode 100644 index 0000000..9f5c172 --- /dev/null +++ b/docs/models/sdkerrors/getglobalhubsresponsebody.md @@ -0,0 +1,11 @@ +# GetGlobalHubsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetGlobalHubsErrors](../../models/sdkerrors/getglobalhubserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlatestlibraryitemserrors.md b/docs/models/sdkerrors/getlatestlibraryitemserrors.md new file mode 100644 index 0000000..0663a36 --- /dev/null +++ b/docs/models/sdkerrors/getlatestlibraryitemserrors.md @@ -0,0 +1,10 @@ +# GetLatestLibraryItemsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlatestlibraryitemsresponsebody.md b/docs/models/sdkerrors/getlatestlibraryitemsresponsebody.md new file mode 100644 index 0000000..a38e709 --- /dev/null +++ b/docs/models/sdkerrors/getlatestlibraryitemsresponsebody.md @@ -0,0 +1,11 @@ +# GetLatestLibraryItemsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetLatestLibraryItemsErrors](../../models/sdkerrors/getlatestlibraryitemserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibrarieserrors.md b/docs/models/sdkerrors/getlibrarieserrors.md new file mode 100644 index 0000000..2c63951 --- /dev/null +++ b/docs/models/sdkerrors/getlibrarieserrors.md @@ -0,0 +1,10 @@ +# GetLibrariesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibrariesresponsebody.md b/docs/models/sdkerrors/getlibrariesresponsebody.md new file mode 100644 index 0000000..510bdd5 --- /dev/null +++ b/docs/models/sdkerrors/getlibrariesresponsebody.md @@ -0,0 +1,11 @@ +# GetLibrariesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetLibrariesErrors](../../models/sdkerrors/getlibrarieserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryerrors.md b/docs/models/sdkerrors/getlibraryerrors.md new file mode 100644 index 0000000..44566f1 --- /dev/null +++ b/docs/models/sdkerrors/getlibraryerrors.md @@ -0,0 +1,10 @@ +# GetLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryhubserrors.md b/docs/models/sdkerrors/getlibraryhubserrors.md new file mode 100644 index 0000000..af9cd79 --- /dev/null +++ b/docs/models/sdkerrors/getlibraryhubserrors.md @@ -0,0 +1,10 @@ +# GetLibraryHubsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryhubsresponsebody.md b/docs/models/sdkerrors/getlibraryhubsresponsebody.md new file mode 100644 index 0000000..464ab2c --- /dev/null +++ b/docs/models/sdkerrors/getlibraryhubsresponsebody.md @@ -0,0 +1,11 @@ +# GetLibraryHubsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetLibraryHubsErrors](../../models/sdkerrors/getlibraryhubserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryitemserrors.md b/docs/models/sdkerrors/getlibraryitemserrors.md new file mode 100644 index 0000000..21428b6 --- /dev/null +++ b/docs/models/sdkerrors/getlibraryitemserrors.md @@ -0,0 +1,10 @@ +# GetLibraryItemsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryitemsresponsebody.md b/docs/models/sdkerrors/getlibraryitemsresponsebody.md new file mode 100644 index 0000000..292d36b --- /dev/null +++ b/docs/models/sdkerrors/getlibraryitemsresponsebody.md @@ -0,0 +1,11 @@ +# GetLibraryItemsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetLibraryItemsErrors](../../models/sdkerrors/getlibraryitemserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getlibraryresponsebody.md b/docs/models/sdkerrors/getlibraryresponsebody.md new file mode 100644 index 0000000..fec3991 --- /dev/null +++ b/docs/models/sdkerrors/getlibraryresponsebody.md @@ -0,0 +1,11 @@ +# GetLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetLibraryErrors](../../models/sdkerrors/getlibraryerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmetadatachildrenerrors.md b/docs/models/sdkerrors/getmetadatachildrenerrors.md new file mode 100644 index 0000000..ef2be3a --- /dev/null +++ b/docs/models/sdkerrors/getmetadatachildrenerrors.md @@ -0,0 +1,10 @@ +# GetMetadataChildrenErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmetadatachildrenresponsebody.md b/docs/models/sdkerrors/getmetadatachildrenresponsebody.md new file mode 100644 index 0000000..298ded2 --- /dev/null +++ b/docs/models/sdkerrors/getmetadatachildrenresponsebody.md @@ -0,0 +1,11 @@ +# GetMetadataChildrenResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetMetadataChildrenErrors](../../models/sdkerrors/getmetadatachildrenerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmetadataerrors.md b/docs/models/sdkerrors/getmetadataerrors.md new file mode 100644 index 0000000..af6b73f --- /dev/null +++ b/docs/models/sdkerrors/getmetadataerrors.md @@ -0,0 +1,10 @@ +# GetMetadataErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmetadataresponsebody.md b/docs/models/sdkerrors/getmetadataresponsebody.md new file mode 100644 index 0000000..375d3c9 --- /dev/null +++ b/docs/models/sdkerrors/getmetadataresponsebody.md @@ -0,0 +1,11 @@ +# GetMetadataResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetMetadataErrors](../../models/sdkerrors/getmetadataerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmyplexaccounterrors.md b/docs/models/sdkerrors/getmyplexaccounterrors.md new file mode 100644 index 0000000..569c34c --- /dev/null +++ b/docs/models/sdkerrors/getmyplexaccounterrors.md @@ -0,0 +1,10 @@ +# GetMyPlexAccountErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getmyplexaccountresponsebody.md b/docs/models/sdkerrors/getmyplexaccountresponsebody.md new file mode 100644 index 0000000..518c6a9 --- /dev/null +++ b/docs/models/sdkerrors/getmyplexaccountresponsebody.md @@ -0,0 +1,11 @@ +# GetMyPlexAccountResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetMyPlexAccountErrors](../../models/sdkerrors/getmyplexaccounterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getondeckerrors.md b/docs/models/sdkerrors/getondeckerrors.md new file mode 100644 index 0000000..46fc174 --- /dev/null +++ b/docs/models/sdkerrors/getondeckerrors.md @@ -0,0 +1,10 @@ +# GetOnDeckErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getondeckresponsebody.md b/docs/models/sdkerrors/getondeckresponsebody.md new file mode 100644 index 0000000..1755c26 --- /dev/null +++ b/docs/models/sdkerrors/getondeckresponsebody.md @@ -0,0 +1,11 @@ +# GetOnDeckResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetOnDeckErrors](../../models/sdkerrors/getondeckerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistcontentserrors.md b/docs/models/sdkerrors/getplaylistcontentserrors.md new file mode 100644 index 0000000..154a798 --- /dev/null +++ b/docs/models/sdkerrors/getplaylistcontentserrors.md @@ -0,0 +1,10 @@ +# GetPlaylistContentsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistcontentsresponsebody.md b/docs/models/sdkerrors/getplaylistcontentsresponsebody.md new file mode 100644 index 0000000..d96ede8 --- /dev/null +++ b/docs/models/sdkerrors/getplaylistcontentsresponsebody.md @@ -0,0 +1,11 @@ +# GetPlaylistContentsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetPlaylistContentsErrors](../../models/sdkerrors/getplaylistcontentserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylisterrors.md b/docs/models/sdkerrors/getplaylisterrors.md new file mode 100644 index 0000000..e6da41c --- /dev/null +++ b/docs/models/sdkerrors/getplaylisterrors.md @@ -0,0 +1,10 @@ +# GetPlaylistErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistresponsebody.md b/docs/models/sdkerrors/getplaylistresponsebody.md new file mode 100644 index 0000000..cde9b0c --- /dev/null +++ b/docs/models/sdkerrors/getplaylistresponsebody.md @@ -0,0 +1,11 @@ +# GetPlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetPlaylistErrors](../../models/sdkerrors/getplaylisterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistserrors.md b/docs/models/sdkerrors/getplaylistserrors.md new file mode 100644 index 0000000..d60cc1c --- /dev/null +++ b/docs/models/sdkerrors/getplaylistserrors.md @@ -0,0 +1,10 @@ +# GetPlaylistsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getplaylistsresponsebody.md b/docs/models/sdkerrors/getplaylistsresponsebody.md new file mode 100644 index 0000000..8a04444 --- /dev/null +++ b/docs/models/sdkerrors/getplaylistsresponsebody.md @@ -0,0 +1,11 @@ +# GetPlaylistsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetPlaylistsErrors](../../models/sdkerrors/getplaylistserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getrecentlyaddederrors.md b/docs/models/sdkerrors/getrecentlyaddederrors.md new file mode 100644 index 0000000..13dddec --- /dev/null +++ b/docs/models/sdkerrors/getrecentlyaddederrors.md @@ -0,0 +1,10 @@ +# GetRecentlyAddedErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getrecentlyaddedresponsebody.md b/docs/models/sdkerrors/getrecentlyaddedresponsebody.md new file mode 100644 index 0000000..aa93aa9 --- /dev/null +++ b/docs/models/sdkerrors/getrecentlyaddedresponsebody.md @@ -0,0 +1,11 @@ +# GetRecentlyAddedResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetRecentlyAddedErrors](../../models/sdkerrors/getrecentlyaddederrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getresizedphotoerrors.md b/docs/models/sdkerrors/getresizedphotoerrors.md new file mode 100644 index 0000000..e992723 --- /dev/null +++ b/docs/models/sdkerrors/getresizedphotoerrors.md @@ -0,0 +1,10 @@ +# GetResizedPhotoErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getresizedphotoresponsebody.md b/docs/models/sdkerrors/getresizedphotoresponsebody.md new file mode 100644 index 0000000..689504b --- /dev/null +++ b/docs/models/sdkerrors/getresizedphotoresponsebody.md @@ -0,0 +1,11 @@ +# GetResizedPhotoResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetResizedPhotoErrors](../../models/sdkerrors/getresizedphotoerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchresultserrors.md b/docs/models/sdkerrors/getsearchresultserrors.md new file mode 100644 index 0000000..170d6e8 --- /dev/null +++ b/docs/models/sdkerrors/getsearchresultserrors.md @@ -0,0 +1,10 @@ +# GetSearchResultsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsearchresultsresponsebody.md b/docs/models/sdkerrors/getsearchresultsresponsebody.md new file mode 100644 index 0000000..9375474 --- /dev/null +++ b/docs/models/sdkerrors/getsearchresultsresponsebody.md @@ -0,0 +1,11 @@ +# GetSearchResultsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetSearchResultsErrors](../../models/sdkerrors/getsearchresultserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserveractivitieserrors.md b/docs/models/sdkerrors/getserveractivitieserrors.md new file mode 100644 index 0000000..7ff91f1 --- /dev/null +++ b/docs/models/sdkerrors/getserveractivitieserrors.md @@ -0,0 +1,10 @@ +# GetServerActivitiesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserveractivitiesresponsebody.md b/docs/models/sdkerrors/getserveractivitiesresponsebody.md new file mode 100644 index 0000000..a8d69ce --- /dev/null +++ b/docs/models/sdkerrors/getserveractivitiesresponsebody.md @@ -0,0 +1,11 @@ +# GetServerActivitiesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetServerActivitiesErrors](../../models/sdkerrors/getserveractivitieserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getservercapabilitiesresponsebody.md b/docs/models/sdkerrors/getservercapabilitiesresponsebody.md new file mode 100644 index 0000000..da5999e --- /dev/null +++ b/docs/models/sdkerrors/getservercapabilitiesresponsebody.md @@ -0,0 +1,11 @@ +# GetServerCapabilitiesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `Errors` | [][sdkerrors.Errors](../../models/sdkerrors/errors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserveridentityerrors.md b/docs/models/sdkerrors/getserveridentityerrors.md new file mode 100644 index 0000000..d464d18 --- /dev/null +++ b/docs/models/sdkerrors/getserveridentityerrors.md @@ -0,0 +1,10 @@ +# GetServerIdentityErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserveridentityresponsebody.md b/docs/models/sdkerrors/getserveridentityresponsebody.md new file mode 100644 index 0000000..7c8ef7b --- /dev/null +++ b/docs/models/sdkerrors/getserveridentityresponsebody.md @@ -0,0 +1,11 @@ +# GetServerIdentityResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetServerIdentityErrors](../../models/sdkerrors/getserveridentityerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverlisterrors.md b/docs/models/sdkerrors/getserverlisterrors.md new file mode 100644 index 0000000..8766c12 --- /dev/null +++ b/docs/models/sdkerrors/getserverlisterrors.md @@ -0,0 +1,10 @@ +# GetServerListErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverlistresponsebody.md b/docs/models/sdkerrors/getserverlistresponsebody.md new file mode 100644 index 0000000..76a4a87 --- /dev/null +++ b/docs/models/sdkerrors/getserverlistresponsebody.md @@ -0,0 +1,11 @@ +# GetServerListResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetServerListErrors](../../models/sdkerrors/getserverlisterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverpreferenceserrors.md b/docs/models/sdkerrors/getserverpreferenceserrors.md new file mode 100644 index 0000000..182afd2 --- /dev/null +++ b/docs/models/sdkerrors/getserverpreferenceserrors.md @@ -0,0 +1,10 @@ +# GetServerPreferencesErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getserverpreferencesresponsebody.md b/docs/models/sdkerrors/getserverpreferencesresponsebody.md new file mode 100644 index 0000000..51f8887 --- /dev/null +++ b/docs/models/sdkerrors/getserverpreferencesresponsebody.md @@ -0,0 +1,11 @@ +# GetServerPreferencesResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetServerPreferencesErrors](../../models/sdkerrors/getserverpreferenceserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionhistoryerrors.md b/docs/models/sdkerrors/getsessionhistoryerrors.md new file mode 100644 index 0000000..e7bc3d9 --- /dev/null +++ b/docs/models/sdkerrors/getsessionhistoryerrors.md @@ -0,0 +1,10 @@ +# GetSessionHistoryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionhistoryresponsebody.md b/docs/models/sdkerrors/getsessionhistoryresponsebody.md new file mode 100644 index 0000000..a72d6dd --- /dev/null +++ b/docs/models/sdkerrors/getsessionhistoryresponsebody.md @@ -0,0 +1,11 @@ +# GetSessionHistoryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetSessionHistoryErrors](../../models/sdkerrors/getsessionhistoryerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionserrors.md b/docs/models/sdkerrors/getsessionserrors.md new file mode 100644 index 0000000..351b4c3 --- /dev/null +++ b/docs/models/sdkerrors/getsessionserrors.md @@ -0,0 +1,10 @@ +# GetSessionsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsessionsresponsebody.md b/docs/models/sdkerrors/getsessionsresponsebody.md new file mode 100644 index 0000000..d7a2679 --- /dev/null +++ b/docs/models/sdkerrors/getsessionsresponsebody.md @@ -0,0 +1,11 @@ +# GetSessionsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetSessionsErrors](../../models/sdkerrors/getsessionserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsourceconnectioninformationerrors.md b/docs/models/sdkerrors/getsourceconnectioninformationerrors.md new file mode 100644 index 0000000..dc5b988 --- /dev/null +++ b/docs/models/sdkerrors/getsourceconnectioninformationerrors.md @@ -0,0 +1,10 @@ +# GetSourceConnectionInformationErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getsourceconnectioninformationresponsebody.md b/docs/models/sdkerrors/getsourceconnectioninformationresponsebody.md new file mode 100644 index 0000000..2f0138b --- /dev/null +++ b/docs/models/sdkerrors/getsourceconnectioninformationresponsebody.md @@ -0,0 +1,11 @@ +# GetSourceConnectionInformationResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetSourceConnectionInformationErrors](../../models/sdkerrors/getsourceconnectioninformationerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettimelineerrors.md b/docs/models/sdkerrors/gettimelineerrors.md new file mode 100644 index 0000000..0d10670 --- /dev/null +++ b/docs/models/sdkerrors/gettimelineerrors.md @@ -0,0 +1,10 @@ +# GetTimelineErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettimelineresponsebody.md b/docs/models/sdkerrors/gettimelineresponsebody.md new file mode 100644 index 0000000..c65bca1 --- /dev/null +++ b/docs/models/sdkerrors/gettimelineresponsebody.md @@ -0,0 +1,11 @@ +# GetTimelineResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetTimelineErrors](../../models/sdkerrors/gettimelineerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettranscodesessionserrors.md b/docs/models/sdkerrors/gettranscodesessionserrors.md new file mode 100644 index 0000000..8396f89 --- /dev/null +++ b/docs/models/sdkerrors/gettranscodesessionserrors.md @@ -0,0 +1,10 @@ +# GetTranscodeSessionsErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettranscodesessionsresponsebody.md b/docs/models/sdkerrors/gettranscodesessionsresponsebody.md new file mode 100644 index 0000000..d994522 --- /dev/null +++ b/docs/models/sdkerrors/gettranscodesessionsresponsebody.md @@ -0,0 +1,11 @@ +# GetTranscodeSessionsResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetTranscodeSessionsErrors](../../models/sdkerrors/gettranscodesessionserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettransienttokenerrors.md b/docs/models/sdkerrors/gettransienttokenerrors.md new file mode 100644 index 0000000..9998026 --- /dev/null +++ b/docs/models/sdkerrors/gettransienttokenerrors.md @@ -0,0 +1,10 @@ +# GetTransientTokenErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/gettransienttokenresponsebody.md b/docs/models/sdkerrors/gettransienttokenresponsebody.md new file mode 100644 index 0000000..c5f037f --- /dev/null +++ b/docs/models/sdkerrors/gettransienttokenresponsebody.md @@ -0,0 +1,11 @@ +# GetTransientTokenResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.GetTransientTokenErrors](../../models/sdkerrors/gettransienttokenerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/getupdatestatuserrors.md b/docs/models/sdkerrors/getupdatestatuserrors.md new file mode 100644 index 0000000..f0be32d --- /dev/null +++ b/docs/models/sdkerrors/getupdatestatuserrors.md @@ -0,0 +1,10 @@ +# GetUpdateStatusErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/getupdatestatusresponsebody.md b/docs/models/sdkerrors/getupdatestatusresponsebody.md new file mode 100644 index 0000000..7d914a6 --- /dev/null +++ b/docs/models/sdkerrors/getupdatestatusresponsebody.md @@ -0,0 +1,11 @@ +# GetUpdateStatusResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.GetUpdateStatusErrors](../../models/sdkerrors/getupdatestatuserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/loglineerrors.md b/docs/models/sdkerrors/loglineerrors.md new file mode 100644 index 0000000..9ecfeb5 --- /dev/null +++ b/docs/models/sdkerrors/loglineerrors.md @@ -0,0 +1,10 @@ +# LogLineErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/loglineresponsebody.md b/docs/models/sdkerrors/loglineresponsebody.md new file mode 100644 index 0000000..adb3357 --- /dev/null +++ b/docs/models/sdkerrors/loglineresponsebody.md @@ -0,0 +1,11 @@ +# LogLineResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | -------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.LogLineErrors](../../models/sdkerrors/loglineerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/logmultilineerrors.md b/docs/models/sdkerrors/logmultilineerrors.md new file mode 100644 index 0000000..d1324d3 --- /dev/null +++ b/docs/models/sdkerrors/logmultilineerrors.md @@ -0,0 +1,10 @@ +# LogMultiLineErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/logmultilineresponsebody.md b/docs/models/sdkerrors/logmultilineresponsebody.md new file mode 100644 index 0000000..8dee57d --- /dev/null +++ b/docs/models/sdkerrors/logmultilineresponsebody.md @@ -0,0 +1,11 @@ +# LogMultiLineResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.LogMultiLineErrors](../../models/sdkerrors/logmultilineerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/markplayederrors.md b/docs/models/sdkerrors/markplayederrors.md new file mode 100644 index 0000000..478979c --- /dev/null +++ b/docs/models/sdkerrors/markplayederrors.md @@ -0,0 +1,10 @@ +# MarkPlayedErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/markplayedresponsebody.md b/docs/models/sdkerrors/markplayedresponsebody.md new file mode 100644 index 0000000..f264a8e --- /dev/null +++ b/docs/models/sdkerrors/markplayedresponsebody.md @@ -0,0 +1,11 @@ +# MarkPlayedResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.MarkPlayedErrors](../../models/sdkerrors/markplayederrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/markunplayederrors.md b/docs/models/sdkerrors/markunplayederrors.md new file mode 100644 index 0000000..eb3f42e --- /dev/null +++ b/docs/models/sdkerrors/markunplayederrors.md @@ -0,0 +1,10 @@ +# MarkUnplayedErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/markunplayedresponsebody.md b/docs/models/sdkerrors/markunplayedresponsebody.md new file mode 100644 index 0000000..aeebdbb --- /dev/null +++ b/docs/models/sdkerrors/markunplayedresponsebody.md @@ -0,0 +1,11 @@ +# MarkUnplayedResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.MarkUnplayedErrors](../../models/sdkerrors/markunplayederrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/performsearcherrors.md b/docs/models/sdkerrors/performsearcherrors.md new file mode 100644 index 0000000..3a0bff8 --- /dev/null +++ b/docs/models/sdkerrors/performsearcherrors.md @@ -0,0 +1,10 @@ +# PerformSearchErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/performsearchresponsebody.md b/docs/models/sdkerrors/performsearchresponsebody.md new file mode 100644 index 0000000..922640b --- /dev/null +++ b/docs/models/sdkerrors/performsearchresponsebody.md @@ -0,0 +1,11 @@ +# PerformSearchResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.PerformSearchErrors](../../models/sdkerrors/performsearcherrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/performvoicesearcherrors.md b/docs/models/sdkerrors/performvoicesearcherrors.md new file mode 100644 index 0000000..2b29a7e --- /dev/null +++ b/docs/models/sdkerrors/performvoicesearcherrors.md @@ -0,0 +1,10 @@ +# PerformVoiceSearchErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/performvoicesearchresponsebody.md b/docs/models/sdkerrors/performvoicesearchresponsebody.md new file mode 100644 index 0000000..e7b1102 --- /dev/null +++ b/docs/models/sdkerrors/performvoicesearchresponsebody.md @@ -0,0 +1,11 @@ +# PerformVoiceSearchResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.PerformVoiceSearchErrors](../../models/sdkerrors/performvoicesearcherrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/refreshlibraryerrors.md b/docs/models/sdkerrors/refreshlibraryerrors.md new file mode 100644 index 0000000..a9948b9 --- /dev/null +++ b/docs/models/sdkerrors/refreshlibraryerrors.md @@ -0,0 +1,10 @@ +# RefreshLibraryErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/refreshlibraryresponsebody.md b/docs/models/sdkerrors/refreshlibraryresponsebody.md new file mode 100644 index 0000000..2a52552 --- /dev/null +++ b/docs/models/sdkerrors/refreshlibraryresponsebody.md @@ -0,0 +1,11 @@ +# RefreshLibraryResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.RefreshLibraryErrors](../../models/sdkerrors/refreshlibraryerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/startalltaskserrors.md b/docs/models/sdkerrors/startalltaskserrors.md new file mode 100644 index 0000000..bf93806 --- /dev/null +++ b/docs/models/sdkerrors/startalltaskserrors.md @@ -0,0 +1,10 @@ +# StartAllTasksErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/startalltasksresponsebody.md b/docs/models/sdkerrors/startalltasksresponsebody.md new file mode 100644 index 0000000..bc2b7f1 --- /dev/null +++ b/docs/models/sdkerrors/startalltasksresponsebody.md @@ -0,0 +1,11 @@ +# StartAllTasksResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.StartAllTasksErrors](../../models/sdkerrors/startalltaskserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/starttaskerrors.md b/docs/models/sdkerrors/starttaskerrors.md new file mode 100644 index 0000000..a8bbf2a --- /dev/null +++ b/docs/models/sdkerrors/starttaskerrors.md @@ -0,0 +1,10 @@ +# StartTaskErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/starttaskresponsebody.md b/docs/models/sdkerrors/starttaskresponsebody.md new file mode 100644 index 0000000..e502eef --- /dev/null +++ b/docs/models/sdkerrors/starttaskresponsebody.md @@ -0,0 +1,11 @@ +# StartTaskResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.StartTaskErrors](../../models/sdkerrors/starttaskerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/startuniversaltranscodeerrors.md b/docs/models/sdkerrors/startuniversaltranscodeerrors.md new file mode 100644 index 0000000..99f47d7 --- /dev/null +++ b/docs/models/sdkerrors/startuniversaltranscodeerrors.md @@ -0,0 +1,10 @@ +# StartUniversalTranscodeErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/startuniversaltranscoderesponsebody.md b/docs/models/sdkerrors/startuniversaltranscoderesponsebody.md new file mode 100644 index 0000000..0d297e4 --- /dev/null +++ b/docs/models/sdkerrors/startuniversaltranscoderesponsebody.md @@ -0,0 +1,11 @@ +# StartUniversalTranscodeResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.StartUniversalTranscodeErrors](../../models/sdkerrors/startuniversaltranscodeerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/stopalltaskserrors.md b/docs/models/sdkerrors/stopalltaskserrors.md new file mode 100644 index 0000000..a735b0c --- /dev/null +++ b/docs/models/sdkerrors/stopalltaskserrors.md @@ -0,0 +1,10 @@ +# StopAllTasksErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stopalltasksresponsebody.md b/docs/models/sdkerrors/stopalltasksresponsebody.md new file mode 100644 index 0000000..f545559 --- /dev/null +++ b/docs/models/sdkerrors/stopalltasksresponsebody.md @@ -0,0 +1,11 @@ +# StopAllTasksResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.StopAllTasksErrors](../../models/sdkerrors/stopalltaskserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptaskerrors.md b/docs/models/sdkerrors/stoptaskerrors.md new file mode 100644 index 0000000..af6ed53 --- /dev/null +++ b/docs/models/sdkerrors/stoptaskerrors.md @@ -0,0 +1,10 @@ +# StopTaskErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptaskresponsebody.md b/docs/models/sdkerrors/stoptaskresponsebody.md new file mode 100644 index 0000000..ecd2b8b --- /dev/null +++ b/docs/models/sdkerrors/stoptaskresponsebody.md @@ -0,0 +1,11 @@ +# StopTaskResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.StopTaskErrors](../../models/sdkerrors/stoptaskerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptranscodesessionerrors.md b/docs/models/sdkerrors/stoptranscodesessionerrors.md new file mode 100644 index 0000000..aa4c27c --- /dev/null +++ b/docs/models/sdkerrors/stoptranscodesessionerrors.md @@ -0,0 +1,10 @@ +# StopTranscodeSessionErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/stoptranscodesessionresponsebody.md b/docs/models/sdkerrors/stoptranscodesessionresponsebody.md new file mode 100644 index 0000000..cb9e2d4 --- /dev/null +++ b/docs/models/sdkerrors/stoptranscodesessionresponsebody.md @@ -0,0 +1,11 @@ +# StopTranscodeSessionResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.StopTranscodeSessionErrors](../../models/sdkerrors/stoptranscodesessionerrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplaylisterrors.md b/docs/models/sdkerrors/updateplaylisterrors.md new file mode 100644 index 0000000..005e500 --- /dev/null +++ b/docs/models/sdkerrors/updateplaylisterrors.md @@ -0,0 +1,10 @@ +# UpdatePlaylistErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplaylistresponsebody.md b/docs/models/sdkerrors/updateplaylistresponsebody.md new file mode 100644 index 0000000..c1719e7 --- /dev/null +++ b/docs/models/sdkerrors/updateplaylistresponsebody.md @@ -0,0 +1,11 @@ +# UpdatePlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.UpdatePlaylistErrors](../../models/sdkerrors/updateplaylisterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplayprogresserrors.md b/docs/models/sdkerrors/updateplayprogresserrors.md new file mode 100644 index 0000000..82fca4b --- /dev/null +++ b/docs/models/sdkerrors/updateplayprogresserrors.md @@ -0,0 +1,10 @@ +# UpdatePlayProgressErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/updateplayprogressresponsebody.md b/docs/models/sdkerrors/updateplayprogressresponsebody.md new file mode 100644 index 0000000..d0fae51 --- /dev/null +++ b/docs/models/sdkerrors/updateplayprogressresponsebody.md @@ -0,0 +1,11 @@ +# UpdatePlayProgressResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `Errors` | [][sdkerrors.UpdatePlayProgressErrors](../../models/sdkerrors/updateplayprogresserrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/models/sdkerrors/uploadplaylisterrors.md b/docs/models/sdkerrors/uploadplaylisterrors.md new file mode 100644 index 0000000..4229b53 --- /dev/null +++ b/docs/models/sdkerrors/uploadplaylisterrors.md @@ -0,0 +1,10 @@ +# UploadPlaylistErrors + + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `Code` | **float64* | :heavy_minus_sign: | N/A | 1001 | +| `Message` | **string* | :heavy_minus_sign: | N/A | User could not be authenticated | +| `Status` | **float64* | :heavy_minus_sign: | N/A | 401 | \ No newline at end of file diff --git a/docs/models/sdkerrors/uploadplaylistresponsebody.md b/docs/models/sdkerrors/uploadplaylistresponsebody.md new file mode 100644 index 0000000..8874f82 --- /dev/null +++ b/docs/models/sdkerrors/uploadplaylistresponsebody.md @@ -0,0 +1,11 @@ +# UploadPlaylistResponseBody + +Unauthorized - Returned if the X-Plex-Token is missing from the header or query. + + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `Errors` | [][sdkerrors.UploadPlaylistErrors](../../models/sdkerrors/uploadplaylisterrors.md) | :heavy_minus_sign: | N/A | +| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing | \ No newline at end of file diff --git a/docs/sdks/activities/README.md b/docs/sdks/activities/README.md new file mode 100644 index 0000000..2a3e6c7 --- /dev/null +++ b/docs/sdks/activities/README.md @@ -0,0 +1,119 @@ +# Activities +(*Activities*) + +## Overview + +Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. +Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. +Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: +- They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. +- They must contain an `type` which is used by clients to distinguish the specific activity. +- They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) +- The may contain a `Response` object which attributes which represent the result of the asynchronous operation. + + +### Available Operations + +* [GetServerActivities](#getserveractivities) - Get Server Activities +* [CancelServerActivities](#cancelserveractivities) - Cancel Server Activities + +## GetServerActivities + +Get Server Activities + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Activities.GetServerActivities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetServerActivitiesResponse](../../models/operations/getserveractivitiesresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.GetServerActivitiesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## CancelServerActivities + +Cancel Server Activities + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var activityUUID string = "string" + + ctx := context.Background() + res, err := s.Activities.CancelServerActivities(ctx, activityUUID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `activityUUID` | *string* | :heavy_check_mark: | The UUID of the activity to cancel. | + + +### Response + +**[*operations.CancelServerActivitiesResponse](../../models/operations/cancelserveractivitiesresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| sdkerrors.CancelServerActivitiesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/butler/README.md b/docs/sdks/butler/README.md new file mode 100644 index 0000000..b13e0e0 --- /dev/null +++ b/docs/sdks/butler/README.md @@ -0,0 +1,281 @@ +# Butler +(*Butler*) + +## Overview + +Butler is the task manager of the Plex Media Server Ecosystem. + + +### Available Operations + +* [GetButlerTasks](#getbutlertasks) - Get Butler tasks +* [StartAllTasks](#startalltasks) - Start all Butler tasks +* [StopAllTasks](#stopalltasks) - Stop all Butler tasks +* [StartTask](#starttask) - Start a single Butler task +* [StopTask](#stoptask) - Stop a single Butler task + +## GetButlerTasks + +Returns a list of butler tasks + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Butler.GetButlerTasks(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetButlerTasksResponse](../../models/operations/getbutlertasksresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.GetButlerTasksResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## StartAllTasks + +This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: +1. Any tasks not scheduled to run on the current day will be skipped. +2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. +3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. +4. If we are outside the configured window, the task will start immediately. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Butler.StartAllTasks(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.StartAllTasksResponse](../../models/operations/startalltasksresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| sdkerrors.StartAllTasksResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## StopAllTasks + +This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Butler.StopAllTasks(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.StopAllTasksResponse](../../models/operations/stopalltasksresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| sdkerrors.StopAllTasksResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## StartTask + +This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: +1. Any tasks not scheduled to run on the current day will be skipped. +2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately. +3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window. +4. If we are outside the configured window, the task will start immediately. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var taskName operations.TaskName = operations.TaskNameCleanOldBundles + + ctx := context.Background() + res, err := s.Butler.StartTask(ctx, taskName) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `taskName` | [operations.TaskName](../../models/operations/taskname.md) | :heavy_check_mark: | the name of the task to be started. | + + +### Response + +**[*operations.StartTaskResponse](../../models/operations/starttaskresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.StartTaskResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## StopTask + +This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var taskName operations.PathParamTaskName = operations.PathParamTaskNameBackupDatabase + + ctx := context.Background() + res, err := s.Butler.StopTask(ctx, taskName) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `taskName` | [operations.PathParamTaskName](../../models/operations/pathparamtaskname.md) | :heavy_check_mark: | The name of the task to be started. | + + +### Response + +**[*operations.StopTaskResponse](../../models/operations/stoptaskresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------ | ------------------------------ | ------------------------------ | +| sdkerrors.StopTaskResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/hubs/README.md b/docs/sdks/hubs/README.md new file mode 100644 index 0000000..0d6e3a6 --- /dev/null +++ b/docs/sdks/hubs/README.md @@ -0,0 +1,130 @@ +# Hubs +(*Hubs*) + +## Overview + +Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. + + +### Available Operations + +* [GetGlobalHubs](#getglobalhubs) - Get Global Hubs +* [GetLibraryHubs](#getlibraryhubs) - Get library specific hubs + +## GetGlobalHubs + +Get Global Hubs filtered by the parameters provided. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var count *float64 = 1262.49 + + var onlyTransient *operations.OnlyTransient = operations.OnlyTransientOne + + ctx := context.Background() + res, err := s.Hubs.GetGlobalHubs(ctx, count, onlyTransient) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `count` | **float64* | :heavy_minus_sign: | The number of items to return with each hub. | +| `onlyTransient` | [*operations.OnlyTransient](../../models/operations/onlytransient.md) | :heavy_minus_sign: | 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). | + + +### Response + +**[*operations.GetGlobalHubsResponse](../../models/operations/getglobalhubsresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| sdkerrors.GetGlobalHubsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetLibraryHubs + +This endpoint will return a list of library specific hubs + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 6728.76 + + var count *float64 = 9010.22 + + var onlyTransient *operations.QueryParamOnlyTransient = operations.QueryParamOnlyTransientZero + + ctx := context.Background() + res, err := s.Hubs.GetLibraryHubs(ctx, sectionID, count, onlyTransient) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `count` | **float64* | :heavy_minus_sign: | The number of items to return with each hub. | +| `onlyTransient` | [*operations.QueryParamOnlyTransient](../../models/operations/queryparamonlytransient.md) | :heavy_minus_sign: | 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). | + + +### Response + +**[*operations.GetLibraryHubsResponse](../../models/operations/getlibraryhubsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.GetLibraryHubsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/library/README.md b/docs/sdks/library/README.md new file mode 100644 index 0000000..7abc712 --- /dev/null +++ b/docs/sdks/library/README.md @@ -0,0 +1,702 @@ +# Library +(*Library*) + +## Overview + +API Calls interacting with Plex Media Server Libraries + + +### Available Operations + +* [GetFileHash](#getfilehash) - Get Hash Value +* [GetRecentlyAdded](#getrecentlyadded) - Get Recently Added +* [GetLibraries](#getlibraries) - Get All Libraries +* [GetLibrary](#getlibrary) - Get Library Details +* [DeleteLibrary](#deletelibrary) - Delete Library Section +* [GetLibraryItems](#getlibraryitems) - Get Library Items +* [RefreshLibrary](#refreshlibrary) - Refresh Library +* [GetLatestLibraryItems](#getlatestlibraryitems) - Get Latest Library Items +* [GetCommonLibraryItems](#getcommonlibraryitems) - Get Common Library Items +* [GetMetadata](#getmetadata) - Get Items Metadata +* [GetMetadataChildren](#getmetadatachildren) - Get Items Children +* [GetOnDeck](#getondeck) - Get On Deck + +## GetFileHash + +This resource returns hash values for local files + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var url_ string = "file://C:\Image.png&type=13" + + var type_ *float64 = 4462.17 + + ctx := context.Background() + res, err := s.Library.GetFileHash(ctx, url_, type_) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `url_` | *string* | :heavy_check_mark: | This is the path to the local file, must be prefixed by `file://` | file://C:\Image.png&type=13 | +| `type_` | **float64* | :heavy_minus_sign: | Item type | | + + +### Response + +**[*operations.GetFileHashResponse](../../models/operations/getfilehashresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| sdkerrors.GetFileHashResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetRecentlyAdded + +This endpoint will return the recently added content. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Library.GetRecentlyAdded(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetRecentlyAddedResponse](../../models/operations/getrecentlyaddedresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.GetRecentlyAddedResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetLibraries + +A library section (commonly referred to as just a library) is a collection of media. +Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. +For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat. + +Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. +This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Library.GetLibraries(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetLibrariesResponse](../../models/operations/getlibrariesresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| sdkerrors.GetLibrariesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetLibrary + +Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are: + +- A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here: + - Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users. + - Secondary: These are marked with `secondary="1"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation. + - Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search="1"` which used to be used to allow clients to build search dialogs on the fly. +- A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains: + - `key`: This provides the root endpoint returning the actual media list for the type. + - `type`: This is the metadata type for the type (if a standard Plex type). + - `title`: The title for for the content of this type (e.g. "Movies"). +- Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API. + - `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with. + - `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter. + - `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element. + - `title`: The title for the filter. +- Each `Sort` object contains a description of the sort field. + - `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending). + - `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort. + - `title`: The title of the field. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 1000 + + var includeDetails *operations.IncludeDetails = operations.IncludeDetailsZero + + ctx := context.Background() + res, err := s.Library.GetLibrary(ctx, sectionID, includeDetails) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | 1000 | +| `includeDetails` | [*operations.IncludeDetails](../../models/operations/includedetails.md) | :heavy_minus_sign: | Whether or not to include details for a section (types, filters, and sorts).
Only exists for backwards compatibility, media providers other than the server libraries have it on always.
| | + + +### Response + +**[*operations.GetLibraryResponse](../../models/operations/getlibraryresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| sdkerrors.GetLibraryResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## DeleteLibrary + +Delate a library using a specific section + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 1000 + + ctx := context.Background() + res, err := s.Library.DeleteLibrary(ctx, sectionID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | 1000 | + + +### Response + +**[*operations.DeleteLibraryResponse](../../models/operations/deletelibraryresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| sdkerrors.DeleteLibraryResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetLibraryItems + +This endpoint will return a list of library items filtered by the filter and type provided + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 4510.92 + + var type_ *float64 = 760.66 + + var filter *string = "string" + + ctx := context.Background() + res, err := s.Library.GetLibraryItems(ctx, sectionID, type_, filter) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `type_` | **float64* | :heavy_minus_sign: | item type | +| `filter` | **string* | :heavy_minus_sign: | the filter parameter | + + +### Response + +**[*operations.GetLibraryItemsResponse](../../models/operations/getlibraryitemsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.GetLibraryItemsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## RefreshLibrary + +This endpoint Refreshes the library. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 934.16 + + ctx := context.Background() + res, err := s.Library.RefreshLibrary(ctx, sectionID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to refresh | + + +### Response + +**[*operations.RefreshLibraryResponse](../../models/operations/refreshlibraryresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.RefreshLibraryResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetLatestLibraryItems + +This endpoint will return a list of the latest library items filtered by the filter and type provided + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 7171.54 + + var type_ float64 = 8015.12 + + var filter *string = "string" + + ctx := context.Background() + res, err := s.Library.GetLatestLibraryItems(ctx, sectionID, type_, filter) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `type_` | *float64* | :heavy_check_mark: | item type | +| `filter` | **string* | :heavy_minus_sign: | the filter parameter | + + +### Response + +**[*operations.GetLatestLibraryItemsResponse](../../models/operations/getlatestlibraryitemsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| sdkerrors.GetLatestLibraryItemsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetCommonLibraryItems + +Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sectionID float64 = 2710.37 + + var type_ float64 = 2760.31 + + var filter *string = "string" + + ctx := context.Background() + res, err := s.Library.GetCommonLibraryItems(ctx, sectionID, type_, filter) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `sectionID` | *float64* | :heavy_check_mark: | the Id of the library to query | +| `type_` | *float64* | :heavy_check_mark: | item type | +| `filter` | **string* | :heavy_minus_sign: | the filter parameter | + + +### Response + +**[*operations.GetCommonLibraryItemsResponse](../../models/operations/getcommonlibraryitemsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| sdkerrors.GetCommonLibraryItemsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetMetadata + +This endpoint will return the metadata of a library item specified with the ratingKey. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var ratingKey float64 = 8382.31 + + ctx := context.Background() + res, err := s.Library.GetMetadata(ctx, ratingKey) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `ratingKey` | *float64* | :heavy_check_mark: | the id of the library item to return the children of. | + + +### Response + +**[*operations.GetMetadataResponse](../../models/operations/getmetadataresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| sdkerrors.GetMetadataResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetMetadataChildren + +This endpoint will return the children of of a library item specified with the ratingKey. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var ratingKey float64 = 1539.14 + + ctx := context.Background() + res, err := s.Library.GetMetadataChildren(ctx, ratingKey) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `ratingKey` | *float64* | :heavy_check_mark: | the id of the library item to return the children of. | + + +### Response + +**[*operations.GetMetadataChildrenResponse](../../models/operations/getmetadatachildrenresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.GetMetadataChildrenResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetOnDeck + +This endpoint will return the on deck content. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Library.GetOnDeck(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetOnDeckResponse](../../models/operations/getondeckresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------- | ------------------------------- | ------------------------------- | +| sdkerrors.GetOnDeckResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/log/README.md b/docs/sdks/log/README.md new file mode 100644 index 0000000..f63860d --- /dev/null +++ b/docs/sdks/log/README.md @@ -0,0 +1,174 @@ +# Log +(*Log*) + +## Overview + +Submit logs to the Log Handler for Plex Media Server + + +### Available Operations + +* [LogLine](#logline) - Logging a single line message. +* [LogMultiLine](#logmultiline) - Logging a multi-line message +* [EnablePaperTrail](#enablepapertrail) - Enabling Papertrail + +## LogLine + +This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var level operations.Level = operations.LevelThree + + var message string = "string" + + var source string = "string" + + ctx := context.Background() + res, err := s.Log.LogLine(ctx, level, message, source) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `level` | [operations.Level](../../models/operations/level.md) | :heavy_check_mark: | An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
| | +| `message` | *string* | :heavy_check_mark: | The text of the message to write to the log. | | +| `source` | *string* | :heavy_check_mark: | a string indicating the source of the message. | | + + +### Response + +**[*operations.LogLineResponse](../../models/operations/loglineresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| sdkerrors.LogLineResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## LogMultiLine + +This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Log.LogMultiLine(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.LogMultiLineResponse](../../models/operations/logmultilineresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| sdkerrors.LogMultiLineResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## EnablePaperTrail + +This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Log.EnablePaperTrail(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.EnablePaperTrailResponse](../../models/operations/enablepapertrailresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.EnablePaperTrailResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/media/README.md b/docs/sdks/media/README.md new file mode 100644 index 0000000..a90e78e --- /dev/null +++ b/docs/sdks/media/README.md @@ -0,0 +1,179 @@ +# Media +(*Media*) + +## Overview + +API Calls interacting with Plex Media Server Media + + +### Available Operations + +* [MarkPlayed](#markplayed) - Mark Media Played +* [MarkUnplayed](#markunplayed) - Mark Media Unplayed +* [UpdatePlayProgress](#updateplayprogress) - Update Media Play Progress + +## MarkPlayed + +This will mark the provided media key as Played. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var key float64 = 59398 + + ctx := context.Background() + res, err := s.Media.MarkPlayed(ctx, key) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `key` | *float64* | :heavy_check_mark: | The media key to mark as played | 59398 | + + +### Response + +**[*operations.MarkPlayedResponse](../../models/operations/markplayedresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| sdkerrors.MarkPlayedResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## MarkUnplayed + +This will mark the provided media key as Unplayed. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var key float64 = 59398 + + ctx := context.Background() + res, err := s.Media.MarkUnplayed(ctx, key) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `key` | *float64* | :heavy_check_mark: | The media key to mark as Unplayed | 59398 | + + +### Response + +**[*operations.MarkUnplayedResponse](../../models/operations/markunplayedresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| sdkerrors.MarkUnplayedResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## UpdatePlayProgress + +This API command can be used to update the play progress of a media item. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var key string = "string" + + var time float64 = 6900.91 + + var state string = "string" + + ctx := context.Background() + res, err := s.Media.UpdatePlayProgress(ctx, key, time, state) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `key` | *string* | :heavy_check_mark: | the media key | +| `time` | *float64* | :heavy_check_mark: | The time, in milliseconds, used to set the media playback progress. | +| `state` | *string* | :heavy_check_mark: | The playback state of the media item. | + + +### Response + +**[*operations.UpdatePlayProgressResponse](../../models/operations/updateplayprogressresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| sdkerrors.UpdatePlayProgressResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/playlists/README.md b/docs/sdks/playlists/README.md new file mode 100644 index 0000000..82946e8 --- /dev/null +++ b/docs/sdks/playlists/README.md @@ -0,0 +1,533 @@ +# Playlists +(*Playlists*) + +## Overview + +Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). +They can be organized in (optionally nesting) folders. +Retrieving a playlist, or its items, will trigger a refresh of its metadata. +This may cause the duration and number of items to change. + + +### Available Operations + +* [CreatePlaylist](#createplaylist) - Create a Playlist +* [GetPlaylists](#getplaylists) - Get All Playlists +* [GetPlaylist](#getplaylist) - Retrieve Playlist +* [DeletePlaylist](#deleteplaylist) - Deletes a Playlist +* [UpdatePlaylist](#updateplaylist) - Update a Playlist +* [GetPlaylistContents](#getplaylistcontents) - Retrieve Playlist Contents +* [ClearPlaylistContents](#clearplaylistcontents) - Delete Playlist Contents +* [AddPlaylistContents](#addplaylistcontents) - Adding to a Playlist +* [UploadPlaylist](#uploadplaylist) - Upload Playlist + +## CreatePlaylist + +Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: +- `uri` - The content URI for what we're playing (e.g. `library://...`). +- `playQueueID` - To create a playlist from an existing play queue. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "github.com/LukeHagar/plexgo/models/operations" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Playlists.CreatePlaylist(ctx, operations.CreatePlaylistRequest{ + Title: "string", + Type: operations.TypePhoto, + Smart: operations.SmartOne, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.CreatePlaylistRequest](../../models/operations/createplaylistrequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.CreatePlaylistResponse](../../models/operations/createplaylistresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.CreatePlaylistResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetPlaylists + +Get All Playlists given the specified filters. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistType *operations.PlaylistType = operations.PlaylistTypeAudio + + var smart *operations.QueryParamSmart = operations.QueryParamSmartZero + + ctx := context.Background() + res, err := s.Playlists.GetPlaylists(ctx, playlistType, smart) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playlistType` | [*operations.PlaylistType](../../models/operations/playlisttype.md) | :heavy_minus_sign: | limit to a type of playlist. | +| `smart` | [*operations.QueryParamSmart](../../models/operations/queryparamsmart.md) | :heavy_minus_sign: | type of playlists to return (default is all). | + + +### Response + +**[*operations.GetPlaylistsResponse](../../models/operations/getplaylistsresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| sdkerrors.GetPlaylistsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetPlaylist + +Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: +Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistID float64 = 4109.48 + + ctx := context.Background() + res, err := s.Playlists.GetPlaylist(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[*operations.GetPlaylistResponse](../../models/operations/getplaylistresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| sdkerrors.GetPlaylistResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## DeletePlaylist + +This endpoint will delete a playlist + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistID float64 = 216.22 + + ctx := context.Background() + res, err := s.Playlists.DeletePlaylist(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[*operations.DeletePlaylistResponse](../../models/operations/deleteplaylistresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.DeletePlaylistResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## UpdatePlaylist + +From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistID float64 = 3915 + + ctx := context.Background() + res, err := s.Playlists.UpdatePlaylist(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[*operations.UpdatePlaylistResponse](../../models/operations/updateplaylistresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.UpdatePlaylistResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetPlaylistContents + +Gets the contents of a playlist. Should be paged by clients via standard mechanisms. +By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. +For example, you could use this to display a list of recently added albums vis a smart playlist. +Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistID float64 = 5004.46 + + var type_ float64 = 9403.59 + + ctx := context.Background() + res, err := s.Playlists.GetPlaylistContents(ctx, playlistID, type_) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | +| `type_` | *float64* | :heavy_check_mark: | the metadata type of the item to return | + + +### Response + +**[*operations.GetPlaylistContentsResponse](../../models/operations/getplaylistcontentsresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.GetPlaylistContentsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## ClearPlaylistContents + +Clears a playlist, only works with dumb playlists. Returns the playlist. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistID float64 = 1893.18 + + ctx := context.Background() + res, err := s.Playlists.ClearPlaylistContents(ctx, playlistID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | + + +### Response + +**[*operations.ClearPlaylistContentsResponse](../../models/operations/clearplaylistcontentsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| sdkerrors.ClearPlaylistContentsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## AddPlaylistContents + +Adds a generator to a playlist, same parameters as the POST above. With a dumb playlist, this adds the specified items to the playlist. +With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var playlistID float64 = 8502.01 + + var uri string = "library://.." + + var playQueueID float64 = 123 + + ctx := context.Background() + res, err := s.Playlists.AddPlaylistContents(ctx, playlistID, uri, playQueueID) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `playlistID` | *float64* | :heavy_check_mark: | the ID of the playlist | | +| `uri` | *string* | :heavy_check_mark: | the content URI for the playlist | library://.. | +| `playQueueID` | *float64* | :heavy_check_mark: | the play queue to add to a playlist | 123 | + + +### Response + +**[*operations.AddPlaylistContentsResponse](../../models/operations/addplaylistcontentsresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.AddPlaylistContentsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## UploadPlaylist + +Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var path string = "/home/barkley/playlist.m3u" + + var force operations.Force = operations.ForceZero + + ctx := context.Background() + res, err := s.Playlists.UploadPlaylist(ctx, path, force) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `path` | *string* | :heavy_check_mark: | absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the `path` argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
| /home/barkley/playlist.m3u | +| `force` | [operations.Force](../../models/operations/force.md) | :heavy_check_mark: | force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
| | + + +### Response + +**[*operations.UploadPlaylistResponse](../../models/operations/uploadplaylistresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | +| sdkerrors.UploadPlaylistResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/plexapi/README.md b/docs/sdks/plexapi/README.md new file mode 100644 index 0000000..8ee580c --- /dev/null +++ b/docs/sdks/plexapi/README.md @@ -0,0 +1,9 @@ +# PlexAPI SDK + + +## Overview + +An Open API Spec for interacting with Plex.tv and Plex Servers + +### Available Operations + diff --git a/docs/sdks/search/README.md b/docs/sdks/search/README.md new file mode 100644 index 0000000..e2df913 --- /dev/null +++ b/docs/sdks/search/README.md @@ -0,0 +1,199 @@ +# Search +(*Search*) + +## Overview + +API Calls that perform search operations with Plex Media Server + + +### Available Operations + +* [PerformSearch](#performsearch) - Perform a search +* [PerformVoiceSearch](#performvoicesearch) - Perform a voice search +* [GetSearchResults](#getsearchresults) - Get Search Results + +## PerformSearch + +This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor). + +In the response's items, the following extra attributes are returned to further describe or disambiguate the result: + +- `reason`: The reason for the result, if not because of a direct search term match; can be either: + - `section`: There are multiple identical results from different sections. + - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language). + - ``: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor` +- `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). +- `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID. + +This request is intended to be very fast, and called as the user types. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var query string = "dylan" + + var sectionID *float64 = 1516.53 + + var limit *float64 = 5 + + ctx := context.Background() + res, err := s.Search.PerformSearch(ctx, query, sectionID, limit) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `query` | *string* | :heavy_check_mark: | The query term | arnold | +| `sectionID` | **float64* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | | +| `limit` | **float64* | :heavy_minus_sign: | The number of items to return per hub | 5 | + + +### Response + +**[*operations.PerformSearchResponse](../../models/operations/performsearchresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| sdkerrors.PerformSearchResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## PerformVoiceSearch + +This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. +It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. +Whenever possible, clients should limit the search to the appropriate type. +Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var query string = "dead+poop" + + var sectionID *float64 = 4094.8 + + var limit *float64 = 5 + + ctx := context.Background() + res, err := s.Search.PerformVoiceSearch(ctx, query, sectionID, limit) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `query` | *string* | :heavy_check_mark: | The query term | dead+poop | +| `sectionID` | **float64* | :heavy_minus_sign: | This gives context to the search, and can result in re-ordering of search result hubs | | +| `limit` | **float64* | :heavy_minus_sign: | The number of items to return per hub | 5 | + + +### Response + +**[*operations.PerformVoiceSearchResponse](../../models/operations/performvoicesearchresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------------- | ---------------------------------------- | ---------------------------------------- | +| sdkerrors.PerformVoiceSearchResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetSearchResults + +This will search the database for the string provided. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var query string = "110" + + ctx := context.Background() + res, err := s.Search.GetSearchResults(ctx, query) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `query` | *string* | :heavy_check_mark: | The search query string to use | 110 | + + +### Response + +**[*operations.GetSearchResultsResponse](../../models/operations/getsearchresultsresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.GetSearchResultsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/security/README.md b/docs/sdks/security/README.md new file mode 100644 index 0000000..24e23af --- /dev/null +++ b/docs/sdks/security/README.md @@ -0,0 +1,125 @@ +# Security +(*Security*) + +## Overview + +API Calls against Security for Plex Media Server + + +### Available Operations + +* [GetTransientToken](#gettransienttoken) - Get a Transient Token. +* [GetSourceConnectionInformation](#getsourceconnectioninformation) - Get Source Connection Information + +## GetTransientToken + +This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var type_ operations.QueryParamType = operations.QueryParamTypeDelegation + + var scope operations.Scope = operations.ScopeAll + + ctx := context.Background() + res, err := s.Security.GetTransientToken(ctx, type_, scope) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `type_` | [operations.QueryParamType](../../models/operations/queryparamtype.md) | :heavy_check_mark: | `delegation` - This is the only supported `type` parameter. | +| `scope` | [operations.Scope](../../models/operations/scope.md) | :heavy_check_mark: | `all` - This is the only supported `scope` parameter. | + + +### Response + +**[*operations.GetTransientTokenResponse](../../models/operations/gettransienttokenresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| sdkerrors.GetTransientTokenResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetSourceConnectionInformation + +If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. +Note: requires Plex Media Server >= 1.15.4. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var source string = "server://client-identifier" + + ctx := context.Background() + res, err := s.Security.GetSourceConnectionInformation(ctx, source) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `source` | *string* | :heavy_check_mark: | The source identifier with an included prefix. | server://client-identifier | + + +### Response + +**[*operations.GetSourceConnectionInformationResponse](../../models/operations/getsourceconnectioninformationresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| sdkerrors.GetSourceConnectionInformationResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/server/README.md b/docs/sdks/server/README.md new file mode 100644 index 0000000..68df5bc --- /dev/null +++ b/docs/sdks/server/README.md @@ -0,0 +1,415 @@ +# Server +(*Server*) + +## Overview + +Operations against the Plex Media Server System. + + +### Available Operations + +* [GetServerCapabilities](#getservercapabilities) - Server Capabilities +* [GetServerPreferences](#getserverpreferences) - Get Server Preferences +* [GetAvailableClients](#getavailableclients) - Get Available Clients +* [GetDevices](#getdevices) - Get Devices +* [GetServerIdentity](#getserveridentity) - Get Server Identity +* [GetMyPlexAccount](#getmyplexaccount) - Get MyPlex Account +* [GetResizedPhoto](#getresizedphoto) - Get a Resized Photo +* [GetServerList](#getserverlist) - Get Server List + +## GetServerCapabilities + +Server Capabilities + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerCapabilities(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetServerCapabilitiesResponse](../../models/operations/getservercapabilitiesresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| sdkerrors.GetServerCapabilitiesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetServerPreferences + +Get Server Preferences + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerPreferences(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetServerPreferencesResponse](../../models/operations/getserverpreferencesresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| sdkerrors.GetServerPreferencesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetAvailableClients + +Get Available Clients + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetAvailableClients(ctx) + if err != nil { + log.Fatal(err) + } + + if res.ResponseBodies != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetAvailableClientsResponse](../../models/operations/getavailableclientsresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| sdkerrors.GetAvailableClientsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetDevices + +Get Devices + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetDevices(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetDevicesResponse](../../models/operations/getdevicesresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| sdkerrors.GetDevicesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetServerIdentity + +Get Server Identity + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerIdentity(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetServerIdentityResponse](../../models/operations/getserveridentityresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| sdkerrors.GetServerIdentityResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetMyPlexAccount + +Returns MyPlex Account Information + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetMyPlexAccount(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetMyPlexAccountResponse](../../models/operations/getmyplexaccountresponse.md), error** +| Error Object | Status Code | Content Type | +| -------------------------------------- | -------------------------------------- | -------------------------------------- | +| sdkerrors.GetMyPlexAccountResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetResizedPhoto + +Plex's Photo transcoder is used throughout the service to serve images at specified sizes. + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "github.com/LukeHagar/plexgo/models/operations" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetResizedPhoto(ctx, operations.GetResizedPhotoRequest{ + Width: 110, + Height: 165, + Opacity: 643869, + Blur: 4000, + MinSize: operations.MinSizeZero, + Upscale: operations.UpscaleZero, + URL: "/library/metadata/49564/thumb/1654258204", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetResizedPhotoRequest](../../models/operations/getresizedphotorequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetResizedPhotoResponse](../../models/operations/getresizedphotoresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.GetResizedPhotoResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetServerList + +Get Server List + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Server.GetServerList(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetServerListResponse](../../models/operations/getserverlistresponse.md), error** +| Error Object | Status Code | Content Type | +| ----------------------------------- | ----------------------------------- | ----------------------------------- | +| sdkerrors.GetServerListResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/sessions/README.md b/docs/sdks/sessions/README.md new file mode 100644 index 0000000..6ec081d --- /dev/null +++ b/docs/sdks/sessions/README.md @@ -0,0 +1,213 @@ +# Sessions +(*Sessions*) + +## Overview + +API Calls that perform search operations with Plex Media Server Sessions + + +### Available Operations + +* [GetSessions](#getsessions) - Get Active Sessions +* [GetSessionHistory](#getsessionhistory) - Get Session History +* [GetTranscodeSessions](#gettranscodesessions) - Get Transcode Sessions +* [StopTranscodeSession](#stoptranscodesession) - Stop a Transcode Session + +## GetSessions + +This will retrieve the "Now Playing" Information of the PMS. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Sessions.GetSessions(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetSessionsResponse](../../models/operations/getsessionsresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| sdkerrors.GetSessionsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetSessionHistory + +This will Retrieve a listing of all history views. + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Sessions.GetSessionHistory(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetSessionHistoryResponse](../../models/operations/getsessionhistoryresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | +| sdkerrors.GetSessionHistoryResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetTranscodeSessions + +Get Transcode Sessions + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Sessions.GetTranscodeSessions(ctx) + if err != nil { + log.Fatal(err) + } + + if res.Object != nil { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetTranscodeSessionsResponse](../../models/operations/gettranscodesessionsresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| sdkerrors.GetTranscodeSessionsResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## StopTranscodeSession + +Stop a Transcode Session + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var sessionKey string = "zz7llzqlx8w9vnrsbnwhbmep" + + ctx := context.Background() + res, err := s.Sessions.StopTranscodeSession(ctx, sessionKey) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | Example | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | | +| `sessionKey` | *string* | :heavy_check_mark: | the Key of the transcode session to stop | zz7llzqlx8w9vnrsbnwhbmep | + + +### Response + +**[*operations.StopTranscodeSessionResponse](../../models/operations/stoptranscodesessionresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| sdkerrors.StopTranscodeSessionResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/updater/README.md b/docs/sdks/updater/README.md new file mode 100644 index 0000000..b47e8fa --- /dev/null +++ b/docs/sdks/updater/README.md @@ -0,0 +1,175 @@ +# Updater +(*Updater*) + +## Overview + +This describes the API for searching and applying updates to the Plex Media Server. +Updates to the status can be observed via the Event API. + + +### Available Operations + +* [GetUpdateStatus](#getupdatestatus) - Querying status of updates +* [CheckForUpdates](#checkforupdates) - Checking for updates +* [ApplyUpdates](#applyupdates) - Apply Updates + +## GetUpdateStatus + +Querying status of updates + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Updater.GetUpdateStatus(ctx) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | + + +### Response + +**[*operations.GetUpdateStatusResponse](../../models/operations/getupdatestatusresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.GetUpdateStatusResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## CheckForUpdates + +Checking for updates + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var download *operations.Download = operations.DownloadOne + + ctx := context.Background() + res, err := s.Updater.CheckForUpdates(ctx, download) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `download` | [*operations.Download](../../models/operations/download.md) | :heavy_minus_sign: | Indicate that you want to start download any updates found. | + + +### Response + +**[*operations.CheckForUpdatesResponse](../../models/operations/checkforupdatesresponse.md), error** +| Error Object | Status Code | Content Type | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | +| sdkerrors.CheckForUpdatesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## ApplyUpdates + +Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed + + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "github.com/LukeHagar/plexgo/models/operations" + "context" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + + var tonight *operations.Tonight = operations.TonightOne + + var skip *operations.Skip = operations.SkipZero + + ctx := context.Background() + res, err := s.Updater.ApplyUpdates(ctx, tonight, skip) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `tonight` | [*operations.Tonight](../../models/operations/tonight.md) | :heavy_minus_sign: | 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 | +| `skip` | [*operations.Skip](../../models/operations/skip.md) | :heavy_minus_sign: | Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. | + + +### Response + +**[*operations.ApplyUpdatesResponse](../../models/operations/applyupdatesresponse.md), error** +| Error Object | Status Code | Content Type | +| ---------------------------------- | ---------------------------------- | ---------------------------------- | +| sdkerrors.ApplyUpdatesResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/docs/sdks/video/README.md b/docs/sdks/video/README.md new file mode 100644 index 0000000..7ca81e4 --- /dev/null +++ b/docs/sdks/video/README.md @@ -0,0 +1,131 @@ +# Video +(*Video*) + +## Overview + +API Calls that perform operations with Plex Media Server Videos + + +### Available Operations + +* [StartUniversalTranscode](#startuniversaltranscode) - Start Universal Transcode +* [GetTimeline](#gettimeline) - Get the timeline for a media item + +## StartUniversalTranscode + +Begin a Universal Transcode Session + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "github.com/LukeHagar/plexgo/models/operations" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Video.StartUniversalTranscode(ctx, operations.StartUniversalTranscodeRequest{ + HasMDE: 8924.99, + Path: "/etc/mail", + MediaIndex: 9962.95, + PartIndex: 1232.82, + Protocol: "string", + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.StartUniversalTranscodeRequest](../../models/operations/startuniversaltranscoderequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.StartUniversalTranscodeResponse](../../models/operations/startuniversaltranscoderesponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | +| sdkerrors.StartUniversalTranscodeResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | + +## GetTimeline + +Get the timeline for a media item + +### Example Usage + +```go +package main + +import( + "github.com/LukeHagar/plexgo/models/components" + "github.com/LukeHagar/plexgo" + "context" + "github.com/LukeHagar/plexgo/models/operations" + "log" + "net/http" +) + +func main() { + s := plexgo.New( + plexgo.WithSecurity(""), + ) + + ctx := context.Background() + res, err := s.Video.GetTimeline(ctx, operations.GetTimelineRequest{ + RatingKey: 716.56, + Key: "", + State: operations.StatePaused, + HasMDE: 7574.33, + Time: 3327.51, + Duration: 7585.39, + Context: "string", + PlayQueueItemID: 1406.21, + PlayBackTime: 2699.34, + Row: 3536.42, + }) + if err != nil { + log.Fatal(err) + } + + if res.StatusCode == http.StatusOK { + // handle response + } +} +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `ctx` | [context.Context](https://pkg.go.dev/context#Context) | :heavy_check_mark: | The context to use for the request. | +| `request` | [operations.GetTimelineRequest](../../models/operations/gettimelinerequest.md) | :heavy_check_mark: | The request object to use for the request. | + + +### Response + +**[*operations.GetTimelineResponse](../../models/operations/gettimelineresponse.md), error** +| Error Object | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| sdkerrors.GetTimelineResponseBody | 401 | application/json | +| sdkerrors.SDKError | 4xx-5xx | */* | diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..8bb3ec8 --- /dev/null +++ b/go.mod @@ -0,0 +1,10 @@ +module github.com/LukeHagar/plexgo + +go 1.14 + +require ( + github.com/cenkalti/backoff/v4 v4.2.0 + github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 + github.com/mitchellh/mapstructure v1.5.0 + github.com/spyzhov/ajson v0.8.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..ae03a47 --- /dev/null +++ b/go.sum @@ -0,0 +1,8 @@ +github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4= +github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= +github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw= +github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ= +github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= +github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/spyzhov/ajson v0.8.0 h1:sFXyMbi4Y/BKjrsfkUZHSjA2JM1184enheSjjoT/zCc= +github.com/spyzhov/ajson v0.8.0/go.mod h1:63V+CGM6f1Bu/p4nLIN8885ojBdt88TbLoSFzyqMuVA= diff --git a/hubs.go b/hubs.go new file mode 100644 index 0000000..71b50f3 --- /dev/null +++ b/hubs.go @@ -0,0 +1,174 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. +type Hubs struct { + sdkConfiguration sdkConfiguration +} + +func newHubs(sdkConfig sdkConfiguration) *Hubs { + return &Hubs{ + sdkConfiguration: sdkConfig, + } +} + +// GetGlobalHubs - Get Global Hubs +// Get Global Hubs filtered by the parameters provided. +func (s *Hubs) GetGlobalHubs(ctx context.Context, count *float64, onlyTransient *operations.OnlyTransient) (*operations.GetGlobalHubsResponse, error) { + request := operations.GetGlobalHubsRequest{ + Count: count, + OnlyTransient: onlyTransient, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/hubs" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetGlobalHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetGlobalHubsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetLibraryHubs - Get library specific hubs +// This endpoint will return a list of library specific hubs +func (s *Hubs) GetLibraryHubs(ctx context.Context, sectionID float64, count *float64, onlyTransient *operations.QueryParamOnlyTransient) (*operations.GetLibraryHubsResponse, error) { + request := operations.GetLibraryHubsRequest{ + SectionID: sectionID, + Count: count, + OnlyTransient: onlyTransient, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/hubs/sections/{sectionId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetLibraryHubsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetLibraryHubsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/internal/utils/contenttype.go b/internal/utils/contenttype.go new file mode 100644 index 0000000..8ed13e2 --- /dev/null +++ b/internal/utils/contenttype.go @@ -0,0 +1,33 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "fmt" + "mime" + "strings" +) + +func MatchContentType(contentType string, pattern string) bool { + if contentType == pattern || pattern == "*" || pattern == "*/*" { + return true + } + + mediaType, _, err := mime.ParseMediaType(contentType) + if err != nil { + return false + } + + if mediaType == pattern { + return true + } + + parts := strings.Split(mediaType, "/") + if len(parts) == 2 { + if fmt.Sprintf("%s/*", parts[0]) == pattern || fmt.Sprintf("*/%s", parts[1]) == pattern { + return true + } + } + + return false +} diff --git a/internal/utils/form.go b/internal/utils/form.go new file mode 100644 index 0000000..89832ea --- /dev/null +++ b/internal/utils/form.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "fmt" + "math/big" + "net/url" + "reflect" + "strings" + "time" + + "github.com/ericlagergren/decimal" + + "github.com/LukeHagar/plexgo/types" +) + +func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, getFieldName func(reflect.StructField) string) url.Values { + + formValues := url.Values{} + + if isNil(objType, objValue) { + return formValues + } + + if objType.Kind() == reflect.Pointer { + objType = objType.Elem() + objValue = objValue.Elem() + } + + switch objType.Kind() { + case reflect.Struct: + switch objValue.Interface().(type) { + case time.Time: + formValues.Add(paramName, valToString(objValue.Interface())) + case types.Date: + formValues.Add(paramName, valToString(objValue.Interface())) + case big.Int: + formValues.Add(paramName, valToString(objValue.Interface())) + case decimal.Big: + formValues.Add(paramName, valToString(objValue.Interface())) + default: + var items []string + + for i := 0; i < objType.NumField(); i++ { + fieldType := objType.Field(i) + valType := objValue.Field(i) + + if isNil(fieldType.Type, valType) { + continue + } + + if valType.Kind() == reflect.Pointer { + valType = valType.Elem() + } + + fieldName := getFieldName(fieldType) + if fieldName == "" { + continue + } + + if explode { + formValues.Add(fieldName, valToString(valType.Interface())) + } else { + items = append(items, fmt.Sprintf("%s%s%s", fieldName, delimiter, valToString(valType.Interface()))) + } + } + + if len(items) > 0 { + formValues.Add(paramName, strings.Join(items, delimiter)) + } + } + case reflect.Map: + items := []string{} + + iter := objValue.MapRange() + for iter.Next() { + if explode { + formValues.Add(iter.Key().String(), valToString(iter.Value().Interface())) + } else { + items = append(items, fmt.Sprintf("%s%s%s", iter.Key().String(), delimiter, valToString(iter.Value().Interface()))) + } + } + + if len(items) > 0 { + formValues.Add(paramName, strings.Join(items, delimiter)) + } + case reflect.Slice, reflect.Array: + values := parseDelimitedArray(explode, objValue, delimiter) + for _, v := range values { + formValues.Add(paramName, v) + } + default: + formValues.Add(paramName, valToString(objValue.Interface())) + } + + return formValues +} + +func parseDelimitedArray(explode bool, objValue reflect.Value, delimiter string) []string { + values := []string{} + items := []string{} + + for i := 0; i < objValue.Len(); i++ { + if explode { + values = append(values, valToString(objValue.Index(i).Interface())) + } else { + items = append(items, valToString(objValue.Index(i).Interface())) + } + } + + if len(items) > 0 { + values = append(values, strings.Join(items, delimiter)) + } + + return values +} diff --git a/internal/utils/headers.go b/internal/utils/headers.go new file mode 100644 index 0000000..0837022 --- /dev/null +++ b/internal/utils/headers.go @@ -0,0 +1,102 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "context" + "fmt" + "net/http" + "reflect" + "strings" +) + +func PopulateHeaders(ctx context.Context, req *http.Request, headers interface{}) { + headerParamsStructType := reflect.TypeOf(headers) + headerParamsValType := reflect.ValueOf(headers) + + for i := 0; i < headerParamsStructType.NumField(); i++ { + fieldType := headerParamsStructType.Field(i) + valType := headerParamsValType.Field(i) + + tag := parseParamTag(headerParamTagKey, fieldType, "simple", false) + if tag == nil { + continue + } + + value := serializeHeader(fieldType.Type, valType, tag.Explode) + if value != "" { + req.Header.Add(tag.ParamName, value) + } + } +} + +func serializeHeader(objType reflect.Type, objValue reflect.Value, explode bool) string { + if isNil(objType, objValue) { + return "" + } + + if objType.Kind() == reflect.Pointer { + objType = objType.Elem() + objValue = objValue.Elem() + } + + switch objType.Kind() { + case reflect.Struct: + items := []string{} + + for i := 0; i < objType.NumField(); i++ { + fieldType := objType.Field(i) + valType := objValue.Field(i) + + if isNil(fieldType.Type, valType) { + continue + } + + if fieldType.Type.Kind() == reflect.Pointer { + valType = valType.Elem() + } + + tag := parseParamTag(headerParamTagKey, fieldType, "simple", false) + if tag == nil { + continue + } + + fieldName := tag.ParamName + + if fieldName == "" { + continue + } + + if explode { + items = append(items, fmt.Sprintf("%s=%s", fieldName, valToString(valType.Interface()))) + } else { + items = append(items, fieldName, valToString(valType.Interface())) + } + } + + return strings.Join(items, ",") + case reflect.Map: + items := []string{} + + iter := objValue.MapRange() + for iter.Next() { + if explode { + items = append(items, fmt.Sprintf("%s=%s", iter.Key().String(), valToString(iter.Value().Interface()))) + } else { + items = append(items, iter.Key().String(), valToString(iter.Value().Interface())) + } + } + + return strings.Join(items, ",") + case reflect.Slice, reflect.Array: + items := []string{} + + for i := 0; i < objValue.Len(); i++ { + items = append(items, valToString(objValue.Index(i).Interface())) + } + + return strings.Join(items, ",") + default: + return valToString(objValue.Interface()) + } +} diff --git a/internal/utils/json.go b/internal/utils/json.go new file mode 100644 index 0000000..fcd3775 --- /dev/null +++ b/internal/utils/json.go @@ -0,0 +1,596 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "bytes" + "encoding/json" + "fmt" + "math/big" + "reflect" + "strings" + "time" + "unsafe" + + "github.com/LukeHagar/plexgo/types" + + "github.com/ericlagergren/decimal" +) + +func MarshalJSON(v interface{}, tag reflect.StructTag, topLevel bool) ([]byte, error) { + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel { + return json.Marshal(v) + } + + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + omitEmpty := false + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag == "omitempty" { + omitEmpty = true + } else { + fieldName = tag + } + } + } + + if isNil(field.Type, fieldVal) && field.Tag.Get("const") == "" { + if omitEmpty { + continue + } + } + + if !field.IsExported() && field.Tag.Get("const") == "" { + continue + } + + additionalProperties := field.Tag.Get("additionalProperties") + if fieldName == "-" && additionalProperties == "" { + continue + } + + if additionalProperties == "true" { + if isNil(field.Type, fieldVal) { + continue + } + fieldVal := trueReflectValue(fieldVal) + if fieldVal.Type().Kind() != reflect.Map { + return nil, fmt.Errorf("additionalProperties must be a map") + } + + for _, key := range fieldVal.MapKeys() { + r, err := marshalValue(fieldVal.MapIndex(key).Interface(), field.Tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + continue + } + + var fv interface{} + + if field.IsExported() { + fv = fieldVal.Interface() + } else { + pt := reflect.New(typ).Elem() + pt.Set(val) + + pf := pt.Field(i) + + fv = reflect.NewAt(pf.Type(), unsafe.Pointer(pf.UnsafeAddr())).Elem().Interface() + } + + r, err := marshalValue(fv, field.Tag) + if err != nil { + return nil, err + } + + out[fieldName] = r + } + + return json.Marshal(out) + default: + return marshalValue(v, tag) + } +} + +func UnmarshalJSON(b []byte, v interface{}, tag reflect.StructTag, topLevel bool, disallowUnknownFields bool) error { + if reflect.TypeOf(v).Kind() != reflect.Ptr { + return fmt.Errorf("v must be a pointer") + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + + switch { + case isModelType(typ): + if topLevel || bytes.Equal(b, []byte("null")) { + d := json.NewDecoder(bytes.NewReader(b)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(v) + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(b, &unmarhsaled); err != nil { + return err + } + + var additionalPropertiesField *reflect.StructField + var additionalPropertiesValue *reflect.Value + + for i := 0; i < typ.NumField(); i++ { + field := typ.Field(i) + fieldVal := val.Field(i) + + fieldName := field.Name + + jsonTag := field.Tag.Get("json") + if jsonTag != "" { + for _, tag := range strings.Split(jsonTag, ",") { + if tag != "omitempty" { + fieldName = tag + } + } + } + + if field.Tag.Get("additionalProperties") == "true" { + additionalPropertiesField = &field + additionalPropertiesValue = &fieldVal + continue + } + + // If we receive a value for a const field ignore it but mark it as unmarshaled + if field.Tag.Get("const") != "" { + if r, ok := unmarhsaled[fieldName]; ok { + val := string(r) + if strings.HasPrefix(val, `"`) && strings.HasSuffix(val, `"`) { + val = val[1 : len(val)-1] + } + if val != field.Tag.Get("const") { + return fmt.Errorf("const field %s does not match expected value %s", fieldName, field.Tag.Get("const")) + } + + delete(unmarhsaled, fieldName) + } + } else if !field.IsExported() { + continue + } + + value, ok := unmarhsaled[fieldName] + if !ok { + defaultTag := field.Tag.Get("default") + if defaultTag != "" { + value = handleDefaultConstValue(defaultTag, fieldVal.Interface(), field.Tag) + ok = true + } + } else { + delete(unmarhsaled, fieldName) + } + + if ok { + if err := unmarshalValue(value, fieldVal, field.Tag, disallowUnknownFields); err != nil { + return err + } + } + } + + keys := make([]string, 0, len(unmarhsaled)) + for k := range unmarhsaled { + keys = append(keys, k) + } + + if len(keys) > 0 { + if disallowUnknownFields && (additionalPropertiesField == nil || additionalPropertiesValue == nil) { + return fmt.Errorf("unknown fields: %v", keys) + } + + if additionalPropertiesField != nil && additionalPropertiesValue != nil { + typeOfMap := additionalPropertiesField.Type + if additionalPropertiesValue.Type().Kind() == reflect.Interface { + typeOfMap = reflect.TypeOf(map[string]interface{}{}) + } else if additionalPropertiesValue.Type().Kind() != reflect.Map { + return fmt.Errorf("additionalProperties must be a map") + } + + mapValue := reflect.MakeMap(typeOfMap) + + for key, value := range unmarhsaled { + val := reflect.New(typeOfMap.Elem()) + + if err := unmarshalValue(value, val, additionalPropertiesField.Tag, disallowUnknownFields); err != nil { + return err + } + + if val.Elem().Type().String() == typeOfMap.Elem().String() { + mapValue.SetMapIndex(reflect.ValueOf(key), val.Elem()) + } else { + mapValue.SetMapIndex(reflect.ValueOf(key), trueReflectValue(val)) + } + + } + if additionalPropertiesValue.Type().Kind() == reflect.Interface { + additionalPropertiesValue.Set(mapValue) + } else { + additionalPropertiesValue.Set(mapValue) + } + } + } + default: + return unmarshalValue(b, reflect.ValueOf(v), tag, disallowUnknownFields) + } + + return nil +} + +func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error) { + constTag := tag.Get("const") + if constTag != "" { + return handleDefaultConstValue(constTag, v, tag), nil + } + + if isNil(reflect.TypeOf(v), reflect.ValueOf(v)) { + defaultTag := tag.Get("default") + if defaultTag != "" { + return handleDefaultConstValue(defaultTag, v, tag), nil + } + + return []byte("null"), nil + } + + typ, val := dereferencePointers(reflect.TypeOf(v), reflect.ValueOf(v)) + switch typ.Kind() { + case reflect.Map: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := map[string]json.RawMessage{} + + for _, key := range val.MapKeys() { + itemVal := val.MapIndex(key) + + if isNil(itemVal.Type(), itemVal) { + out[key.String()] = []byte("null") + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out[key.String()] = r + } + + return json.Marshal(out) + case reflect.Slice, reflect.Array: + if isNil(typ, val) { + return []byte("null"), nil + } + + out := []json.RawMessage{} + + for i := 0; i < val.Len(); i++ { + itemVal := val.Index(i) + + if isNil(itemVal.Type(), itemVal) { + out = append(out, []byte("null")) + continue + } + + r, err := marshalValue(itemVal.Interface(), tag) + if err != nil { + return nil, err + } + + out = append(out, r) + } + + return json.Marshal(out) + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, val.Interface().(time.Time).Format(time.RFC3339Nano))), nil + case reflect.TypeOf(big.Int{}): + format := tag.Get("bigint") + if format == "string" { + b := val.Interface().(big.Int) + return []byte(fmt.Sprintf(`"%s"`, (&b).String())), nil + } + case reflect.TypeOf(decimal.Big{}): + format := tag.Get("decimal") + if format == "number" { + b := val.Interface().(decimal.Big) + f, ok := (&b).Float64() + if ok { + return []byte(b.String()), nil + } + + return []byte(fmt.Sprintf(`%f`, f)), nil + } + } + } + + return json.Marshal(v) +} + +func handleDefaultConstValue(tagValue string, val interface{}, tag reflect.StructTag) json.RawMessage { + if tagValue == "null" { + return []byte("null") + } + + typ := dereferenceTypePointer(reflect.TypeOf(val)) + switch typ { + case reflect.TypeOf(time.Time{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + case reflect.TypeOf(big.Int{}): + bigIntTag := tag.Get("bigint") + if bigIntTag == "string" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(decimal.Big{}): + decimalTag := tag.Get("decimal") + if decimalTag != "number" { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + case reflect.TypeOf(types.Date{}): + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + default: + if typ.Kind() == reflect.String { + return []byte(fmt.Sprintf(`"%s"`, tagValue)) + } + } + + return []byte(tagValue) +} + +func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTag, disallowUnknownFields bool) error { + if bytes.Equal(value, []byte("null")) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + typ := dereferenceTypePointer(v.Type()) + + switch typ.Kind() { + case reflect.Map: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled map[string]json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + m := reflect.MakeMap(typ) + + for k, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + m.SetMapIndex(reflect.ValueOf(k), itemVal.Elem()) + } + + v.Set(m) + return nil + case reflect.Slice, reflect.Array: + if bytes.Equal(value, []byte("null")) || !isComplexValueType(dereferenceTypePointer(typ.Elem())) { + if v.CanAddr() { + return json.Unmarshal(value, v.Addr().Interface()) + } else { + return json.Unmarshal(value, v.Interface()) + } + } + + var unmarhsaled []json.RawMessage + + if err := json.Unmarshal(value, &unmarhsaled); err != nil { + return err + } + + arrVal := v + + for _, value := range unmarhsaled { + itemVal := reflect.New(typ.Elem()) + + if err := unmarshalValue(value, itemVal, tag, disallowUnknownFields); err != nil { + return err + } + + arrVal = reflect.Append(arrVal, itemVal.Elem()) + } + + v.Set(arrVal) + return nil + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + t, err := time.Parse(time.RFC3339Nano, s) + if err != nil { + return fmt.Errorf("failed to parse string as time.Time: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(t)) + return nil + case reflect.TypeOf(big.Int{}): + var b *big.Int + + format := tag.Get("bigint") + if format == "string" { + var s string + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + var ok bool + b, ok = new(big.Int).SetString(s, 10) + if !ok { + return fmt.Errorf("failed to parse string as big.Int") + } + } else { + if err := json.Unmarshal(value, &b); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(b)) + return nil + case reflect.TypeOf(decimal.Big{}): + var d *decimal.Big + format := tag.Get("decimal") + if format == "number" { + var ok bool + d, ok = new(decimal.Big).SetString(string(value)) + if !ok { + return fmt.Errorf("failed to parse number as decimal.Big") + } + } else { + if err := json.Unmarshal(value, &d); err != nil { + return err + } + } + + if v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Ptr { + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + case reflect.TypeOf(types.Date{}): + var s string + + if err := json.Unmarshal(value, &s); err != nil { + return err + } + + d, err := types.DateFromString(s) + if err != nil { + return fmt.Errorf("failed to parse string as types.Date: %w", err) + } + + if v.Kind() == reflect.Ptr { + if v.IsNil() { + v.Set(reflect.New(typ)) + } + v = v.Elem() + } + + v.Set(reflect.ValueOf(d)) + return nil + } + } + + var val interface{} + + if v.CanAddr() { + val = v.Addr().Interface() + } else { + val = v.Interface() + } + + d := json.NewDecoder(bytes.NewReader(value)) + if disallowUnknownFields { + d.DisallowUnknownFields() + } + return d.Decode(val) +} + +func dereferencePointers(typ reflect.Type, val reflect.Value) (reflect.Type, reflect.Value) { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + val = val.Elem() + } else { + return typ, val + } + + return dereferencePointers(typ, val) +} + +func dereferenceTypePointer(typ reflect.Type) reflect.Type { + if typ.Kind() == reflect.Ptr { + typ = typ.Elem() + } else { + return typ + } + + return dereferenceTypePointer(typ) +} + +func isComplexValueType(typ reflect.Type) bool { + switch typ.Kind() { + case reflect.Struct: + switch typ { + case reflect.TypeOf(time.Time{}): + fallthrough + case reflect.TypeOf(big.Int{}): + fallthrough + case reflect.TypeOf(decimal.Big{}): + fallthrough + case reflect.TypeOf(types.Date{}): + return true + } + } + + return false +} + +func isModelType(typ reflect.Type) bool { + if isComplexValueType(typ) { + return false + } + + if typ.Kind() == reflect.Struct { + return true + } + + return false +} diff --git a/internal/utils/pathparams.go b/internal/utils/pathparams.go new file mode 100644 index 0000000..2782862 --- /dev/null +++ b/internal/utils/pathparams.go @@ -0,0 +1,145 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "context" + "fmt" + "math/big" + "net/url" + "reflect" + "strings" + "time" + + "github.com/ericlagergren/decimal" + + "github.com/LukeHagar/plexgo/types" +) + +func GenerateURL(ctx context.Context, serverURL, path string, pathParams interface{}, globals map[string]map[string]map[string]interface{}) (string, error) { + uri := strings.TrimSuffix(serverURL, "/") + path + + pathParamsStructType := reflect.TypeOf(pathParams) + pathParamsValType := reflect.ValueOf(pathParams) + + parsedParameters := map[string]string{} + + for i := 0; i < pathParamsStructType.NumField(); i++ { + fieldType := pathParamsStructType.Field(i) + valType := pathParamsValType.Field(i) + + requestTag := getRequestTag(fieldType) + if requestTag != nil { + continue + } + + ppTag := parseParamTag(pathParamTagKey, fieldType, "simple", false) + if ppTag == nil { + continue + } + + valType = populateFromGlobals(fieldType, valType, "pathParam", globals) + + if ppTag.Serialization != "" { + vals, err := populateSerializedParams(ppTag, fieldType.Type, valType) + if err != nil { + return "", err + } + for k, v := range vals { + parsedParameters[k] = url.PathEscape(v) + } + } else { + // TODO: support other styles + switch ppTag.Style { + case "simple": + simpleParams := getSimplePathParams(ctx, ppTag.ParamName, fieldType.Type, valType, ppTag.Explode) + for k, v := range simpleParams { + parsedParameters[k] = v + } + } + } + } + + // TODO should we handle the case where there are no matching path params? + return ReplaceParameters(uri, parsedParameters), nil +} + +func getSimplePathParams(ctx context.Context, parentName string, objType reflect.Type, objValue reflect.Value, explode bool) map[string]string { + pathParams := make(map[string]string) + + if isNil(objType, objValue) { + return nil + } + + if objType.Kind() == reflect.Ptr { + objType = objType.Elem() + objValue = objValue.Elem() + } + + switch objType.Kind() { + case reflect.Array, reflect.Slice: + if objValue.Len() == 0 { + return nil + } + var ppVals []string + for i := 0; i < objValue.Len(); i++ { + ppVals = append(ppVals, valToString(objValue.Index(i).Interface())) + } + pathParams[parentName] = strings.Join(ppVals, ",") + case reflect.Map: + if objValue.Len() == 0 { + return nil + } + var ppVals []string + objMap := objValue.MapRange() + for objMap.Next() { + if explode { + ppVals = append(ppVals, fmt.Sprintf("%s=%s", objMap.Key().String(), valToString(objMap.Value().Interface()))) + } else { + ppVals = append(ppVals, fmt.Sprintf("%s,%s", objMap.Key().String(), valToString(objMap.Value().Interface()))) + } + } + pathParams[parentName] = strings.Join(ppVals, ",") + case reflect.Struct: + switch objValue.Interface().(type) { + case time.Time: + pathParams[parentName] = valToString(objValue.Interface()) + case types.Date: + pathParams[parentName] = valToString(objValue.Interface()) + case big.Int: + pathParams[parentName] = valToString(objValue.Interface()) + case decimal.Big: + pathParams[parentName] = valToString(objValue.Interface()) + default: + var ppVals []string + for i := 0; i < objType.NumField(); i++ { + fieldType := objType.Field(i) + valType := objValue.Field(i) + + ppTag := parseParamTag(pathParamTagKey, fieldType, "simple", explode) + if ppTag == nil { + continue + } + + if isNil(fieldType.Type, valType) { + continue + } + + if fieldType.Type.Kind() == reflect.Pointer { + valType = valType.Elem() + } + + if explode { + ppVals = append(ppVals, fmt.Sprintf("%s=%s", ppTag.ParamName, valToString(valType.Interface()))) + } else { + ppVals = append(ppVals, fmt.Sprintf("%s,%s", ppTag.ParamName, valToString(valType.Interface()))) + } + } + pathParams[parentName] = strings.Join(ppVals, ",") + } + default: + pathParams[parentName] = valToString(objValue.Interface()) + } + + return pathParams +} diff --git a/internal/utils/queryparams.go b/internal/utils/queryparams.go new file mode 100644 index 0000000..0e94bce --- /dev/null +++ b/internal/utils/queryparams.go @@ -0,0 +1,178 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/url" + "reflect" +) + +func PopulateQueryParams(ctx context.Context, req *http.Request, queryParams interface{}, globals map[string]map[string]map[string]interface{}) error { + queryParamsStructType := reflect.TypeOf(queryParams) + queryParamsValType := reflect.ValueOf(queryParams) + + values := url.Values{} + + for i := 0; i < queryParamsStructType.NumField(); i++ { + fieldType := queryParamsStructType.Field(i) + valType := queryParamsValType.Field(i) + + requestTag := getRequestTag(fieldType) + if requestTag != nil { + continue + } + + qpTag := parseQueryParamTag(fieldType) + if qpTag == nil { + continue + } + + valType = populateFromGlobals(fieldType, valType, "queryParam", globals) + + if qpTag.Serialization != "" { + vals, err := populateSerializedParams(qpTag, fieldType.Type, valType) + if err != nil { + return err + } + for k, v := range vals { + values.Add(k, v) + } + } else { + switch qpTag.Style { + case "deepObject": + vals := populateDeepObjectParams(req, qpTag, fieldType.Type, valType) + for k, v := range vals { + for _, vv := range v { + values.Add(k, vv) + } + } + case "form": + vals := populateFormParams(req, qpTag, fieldType.Type, valType, ",") + for k, v := range vals { + for _, vv := range v { + values.Add(k, vv) + } + } + case "pipeDelimited": + vals := populateFormParams(req, qpTag, fieldType.Type, valType, "|") + for k, v := range vals { + for _, vv := range v { + values.Add(k, vv) + } + } + default: + return fmt.Errorf("unsupported style: %s", qpTag.Style) + } + } + } + + req.URL.RawQuery = values.Encode() + + return nil +} + +func populateSerializedParams(tag *paramTag, objType reflect.Type, objValue reflect.Value) (map[string]string, error) { + if isNil(objType, objValue) { + return nil, nil + } + + if objType.Kind() == reflect.Pointer { + objValue = objValue.Elem() + } + + values := map[string]string{} + + switch tag.Serialization { + case "json": + data, err := json.Marshal(objValue.Interface()) + if err != nil { + return nil, fmt.Errorf("error marshaling json: %v", err) + } + values[tag.ParamName] = string(data) + } + + return values, nil +} + +func populateDeepObjectParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value) url.Values { + values := url.Values{} + + if isNil(objType, objValue) { + return values + } + + if objType.Kind() == reflect.Pointer { + objType = objType.Elem() + objValue = objValue.Elem() + } + + switch objType.Kind() { + case reflect.Struct: + for i := 0; i < objType.NumField(); i++ { + fieldType := objType.Field(i) + valType := objValue.Field(i) + + if isNil(fieldType.Type, valType) { + continue + } + + if fieldType.Type.Kind() == reflect.Pointer { + valType = valType.Elem() + } + + qpTag := parseQueryParamTag(fieldType) + if qpTag == nil { + continue + } + + switch valType.Kind() { + case reflect.Array, reflect.Slice: + for i := 0; i < valType.Len(); i++ { + values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, qpTag.ParamName), valToString(valType.Index(i).Interface())) + } + default: + values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, qpTag.ParamName), valToString(valType.Interface())) + } + } + case reflect.Map: + iter := objValue.MapRange() + for iter.Next() { + switch iter.Value().Kind() { + case reflect.Array, reflect.Slice: + for i := 0; i < iter.Value().Len(); i++ { + values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, iter.Key().String()), valToString(iter.Value().Index(i).Interface())) + } + default: + values.Add(fmt.Sprintf("%s[%s]", tag.ParamName, iter.Key().String()), valToString(iter.Value().Interface())) + } + } + } + + return values +} + +func populateFormParams(req *http.Request, tag *paramTag, objType reflect.Type, objValue reflect.Value, delimiter string) url.Values { + return populateForm(tag.ParamName, tag.Explode, objType, objValue, delimiter, func(fieldType reflect.StructField) string { + qpTag := parseQueryParamTag(fieldType) + if qpTag == nil { + return "" + } + + return qpTag.ParamName + }) +} + +type paramTag struct { + Style string + Explode bool + ParamName string + Serialization string +} + +func parseQueryParamTag(field reflect.StructField) *paramTag { + return parseParamTag(queryParamTagKey, field, "form", true) +} diff --git a/internal/utils/requestbody.go b/internal/utils/requestbody.go new file mode 100644 index 0000000..950f39a --- /dev/null +++ b/internal/utils/requestbody.go @@ -0,0 +1,396 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "bytes" + "context" + "fmt" + "io" + "mime/multipart" + "net/url" + "reflect" + "regexp" +) + +const ( + requestTagKey = "request" + multipartFormTagKey = "multipartForm" + formTagKey = "form" +) + +var ( + jsonEncodingRegex = regexp.MustCompile(`(application|text)\/.*?\+*json.*`) + multipartEncodingRegex = regexp.MustCompile(`multipart\/.*`) + urlEncodedEncodingRegex = regexp.MustCompile(`application\/x-www-form-urlencoded.*`) +) + +func SerializeRequestBody(ctx context.Context, request interface{}, nullable, optional bool, requestFieldName, serializationMethod, tag string) (io.Reader, string, error) { + requestStructType := reflect.TypeOf(request) + requestValType := reflect.ValueOf(request) + + if isNil(requestStructType, requestValType) { + if !nullable && optional { + return nil, "", nil + } + + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType, tag) + } + + if requestStructType.Kind() == reflect.Pointer { + requestStructType = requestStructType.Elem() + requestValType = requestValType.Elem() + } + + if requestStructType.Kind() != reflect.Struct { + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], requestValType, tag) + } + + requestField, ok := requestStructType.FieldByName(requestFieldName) + + if ok { + tag := getRequestTag(requestField) + if tag != nil { + // request object (non-flattened) + requestVal := requestValType.FieldByName(requestFieldName) + if isNil(requestField.Type, requestVal) { + if !nullable && optional { + return nil, "", nil + } + + return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) + } + + return serializeContentType(requestFieldName, tag.MediaType, requestVal, string(requestField.Tag)) + } + } + + // flattened request object + return serializeContentType(requestFieldName, SerializationMethodToContentType[serializationMethod], reflect.ValueOf(request), tag) +} + +func serializeContentType(fieldName string, mediaType string, val reflect.Value, tag string) (*bytes.Buffer, string, error) { + buf := &bytes.Buffer{} + + if isNil(val.Type(), val) { + // TODO: what does a null mean for other content types? Just returning an empty buffer for now + if jsonEncodingRegex.MatchString(mediaType) { + if _, err := buf.Write([]byte("null")); err != nil { + return nil, "", err + } + } + + return buf, mediaType, nil + } + + switch { + case jsonEncodingRegex.MatchString(mediaType): + data, err := MarshalJSON(val.Interface(), reflect.StructTag(tag), true) + if err != nil { + return nil, "", err + } + + if _, err := buf.Write(data); err != nil { + return nil, "", err + } + case multipartEncodingRegex.MatchString(mediaType): + var err error + mediaType, err = encodeMultipartFormData(buf, val.Interface()) + if err != nil { + return nil, "", err + } + case urlEncodedEncodingRegex.MatchString(mediaType): + if err := encodeFormData(fieldName, buf, val.Interface()); err != nil { + return nil, "", err + } + default: + val = reflect.Indirect(val) + + switch { + case val.Type().Kind() == reflect.String: + if _, err := buf.WriteString(valToString(val.Interface())); err != nil { + return nil, "", err + } + case val.Type() == reflect.TypeOf([]byte(nil)): + if _, err := buf.Write(val.Bytes()); err != nil { + return nil, "", err + } + default: + return nil, "", fmt.Errorf("invalid request body type %s for mediaType %s", val.Type(), mediaType) + } + } + + return buf, mediaType, nil +} + +func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { + requestStructType := reflect.TypeOf(data) + requestValType := reflect.ValueOf(data) + + if requestStructType.Kind() == reflect.Pointer { + requestStructType = requestStructType.Elem() + requestValType = requestValType.Elem() + } + + writer := multipart.NewWriter(w) + + for i := 0; i < requestStructType.NumField(); i++ { + field := requestStructType.Field(i) + fieldType := field.Type + valType := requestValType.Field(i) + + if isNil(fieldType, valType) { + continue + } + + if fieldType.Kind() == reflect.Pointer { + fieldType = fieldType.Elem() + valType = valType.Elem() + } + + tag := parseMultipartFormTag(field) + if tag.File { + if err := encodeMultipartFormDataFile(writer, fieldType, valType); err != nil { + writer.Close() + return "", err + } + } else if tag.JSON { + jw, err := writer.CreateFormField(tag.Name) + if err != nil { + writer.Close() + return "", err + } + d, err := MarshalJSON(valType.Interface(), field.Tag, true) + if err != nil { + writer.Close() + return "", err + } + if _, err := jw.Write(d); err != nil { + writer.Close() + return "", err + } + } else { + switch fieldType.Kind() { + case reflect.Slice, reflect.Array: + values := parseDelimitedArray(true, valType, ",") + for _, v := range values { + if err := writer.WriteField(tag.Name+"[]", v); err != nil { + writer.Close() + return "", err + } + } + default: + if err := writer.WriteField(tag.Name, valToString(valType.Interface())); err != nil { + writer.Close() + return "", err + } + } + } + } + + if err := writer.Close(); err != nil { + return "", err + } + + return writer.FormDataContentType(), nil +} + +func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, valType reflect.Value) error { + if fieldType.Kind() != reflect.Struct { + return fmt.Errorf("invalid type %s for multipart/form-data file", valType.Type()) + } + + var fieldName string + var fileName string + var content []byte + + for i := 0; i < fieldType.NumField(); i++ { + field := fieldType.Field(i) + val := valType.Field(i) + + tag := parseMultipartFormTag(field) + if !tag.Content && tag.Name == "" { + continue + } + + if tag.Content { + content = val.Bytes() + } else { + fieldName = tag.Name + fileName = val.String() + } + } + + if fieldName == "" || fileName == "" || content == nil { + return fmt.Errorf("invalid multipart/form-data file") + } + + fw, err := w.CreateFormFile(fieldName, fileName) + if err != nil { + return err + } + if _, err := fw.Write(content); err != nil { + return err + } + + return nil +} + +func encodeFormData(fieldName string, w io.Writer, data interface{}) error { + requestType := reflect.TypeOf(data) + requestValType := reflect.ValueOf(data) + + if requestType.Kind() == reflect.Pointer { + requestType = requestType.Elem() + requestValType = requestValType.Elem() + } + + dataValues := url.Values{} + + switch requestType.Kind() { + case reflect.Struct: + for i := 0; i < requestType.NumField(); i++ { + field := requestType.Field(i) + fieldType := field.Type + valType := requestValType.Field(i) + + if isNil(fieldType, valType) { + continue + } + + if fieldType.Kind() == reflect.Pointer { + fieldType = fieldType.Elem() + valType = valType.Elem() + } + + tag := parseFormTag(field) + if tag.JSON { + data, err := MarshalJSON(valType.Interface(), field.Tag, true) + if err != nil { + return err + } + dataValues.Set(tag.Name, string(data)) + } else { + switch tag.Style { + // TODO: support other styles + case "form": + values := populateForm(tag.Name, tag.Explode, fieldType, valType, ",", func(sf reflect.StructField) string { + tag := parseFormTag(field) + if tag == nil { + return "" + } + + return tag.Name + }) + for k, v := range values { + for _, vv := range v { + dataValues.Add(k, vv) + } + } + } + } + } + case reflect.Map: + for _, k := range requestValType.MapKeys() { + v := requestValType.MapIndex(k) + dataValues.Set(fmt.Sprintf("%v", k.Interface()), valToString(v.Interface())) + } + case reflect.Slice, reflect.Array: + for i := 0; i < requestValType.Len(); i++ { + v := requestValType.Index(i) + dataValues.Set(fieldName, valToString(v.Interface())) + } + } + + if _, err := w.Write([]byte(dataValues.Encode())); err != nil { + return err + } + + return nil +} + +type requestTag struct { + MediaType string +} + +func getRequestTag(field reflect.StructField) *requestTag { + // example `request:"mediaType=multipart/form-data"` + values := parseStructTag(requestTagKey, field) + if values == nil { + return nil + } + + tag := &requestTag{ + MediaType: "application/octet-stream", + } + + for k, v := range values { + switch k { + case "mediaType": + tag.MediaType = v + } + } + + return tag +} + +type multipartFormTag struct { + File bool + Content bool + JSON bool + Name string +} + +func parseMultipartFormTag(field reflect.StructField) *multipartFormTag { + // example `multipartForm:"name=file"` + values := parseStructTag(multipartFormTagKey, field) + + tag := &multipartFormTag{} + + for k, v := range values { + switch k { + case "file": + tag.File = v == "true" + case "content": + tag.Content = v == "true" + case "name": + tag.Name = v + case "json": + tag.JSON = v == "true" + } + } + + return tag +} + +type formTag struct { + Name string + JSON bool + Style string + Explode bool +} + +func parseFormTag(field reflect.StructField) *formTag { + // example `form:"name=propName,style=spaceDelimited,explode"` + values := parseStructTag(formTagKey, field) + + tag := &formTag{ + Style: "form", + Explode: true, + } + + for k, v := range values { + switch k { + case "name": + tag.Name = v + case "json": + tag.JSON = v == "true" + case "style": + tag.Style = v + case "explode": + tag.Explode = v == "true" + } + } + + return tag +} diff --git a/internal/utils/retries.go b/internal/utils/retries.go new file mode 100644 index 0000000..ff39d0d --- /dev/null +++ b/internal/utils/retries.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "context" + "errors" + "fmt" + "net/http" + "net/url" + "strconv" + "strings" + "time" + + "github.com/cenkalti/backoff/v4" +) + +var errRequestFailed = errors.New("request failed") + +type BackoffStrategy struct { + InitialInterval int + MaxInterval int + Exponent float64 + MaxElapsedTime int +} + +type RetryConfig struct { + Strategy string + Backoff *BackoffStrategy + RetryConnectionErrors bool +} + +type Retries struct { + Config *RetryConfig + StatusCodes []string +} + +func Retry(ctx context.Context, r Retries, action func() (*http.Response, error)) (*http.Response, error) { + switch r.Config.Strategy { + case "backoff": + if r.Config.Backoff == nil { + return action() + } + + config := backoff.NewExponentialBackOff() + config.InitialInterval = time.Duration(r.Config.Backoff.InitialInterval) * time.Millisecond + config.MaxInterval = time.Duration(r.Config.Backoff.MaxInterval) * time.Millisecond + config.Multiplier = r.Config.Backoff.Exponent + config.MaxElapsedTime = time.Duration(r.Config.Backoff.MaxElapsedTime) * time.Millisecond + config.Reset() + + var resp *http.Response + + err := backoff.Retry(func() error { + if resp != nil { + resp.Body.Close() + } + + select { + case <-ctx.Done(): + return backoff.Permanent(ctx.Err()) + default: + } + + res, err := action() + if err != nil { + urlError := new(url.Error) + if errors.As(err, &urlError) { + if (urlError.Temporary() || urlError.Timeout()) && r.Config.RetryConnectionErrors { + return err + } + } + + return backoff.Permanent(err) + } + resp = res + if res == nil { + return fmt.Errorf("no response") + } + + for _, code := range r.StatusCodes { + if strings.Contains(strings.ToUpper(code), "X") { + codeRange, err := strconv.Atoi(code[:1]) + if err != nil { + continue + } + + s := res.StatusCode / 100 + + if s >= codeRange && s < codeRange+1 { + return errRequestFailed + } + } else { + parsedCode, err := strconv.Atoi(code) + if err != nil { + continue + } + + if res.StatusCode == parsedCode { + return errRequestFailed + } + } + } + + resp = res + + return nil + }, config) + if err != nil && !errors.Is(err, errRequestFailed) { + return nil, err + } + + return resp, nil + default: + return action() + } +} diff --git a/internal/utils/security.go b/internal/utils/security.go new file mode 100644 index 0000000..fa5eff7 --- /dev/null +++ b/internal/utils/security.go @@ -0,0 +1,298 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "context" + "encoding/base64" + "fmt" + "net/http" + "reflect" + "strings" +) + +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +const ( + securityTagKey = "security" +) + +type securityTag struct { + Option bool + Scheme bool + Name string + Type string + SubType string +} + +type securityConfig struct { + headers map[string]string + queryParams map[string]string +} + +type SecurityClient struct { + HTTPClient + security func(ctx context.Context) (interface{}, error) +} + +func newSecurityClient(client HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient { + return &SecurityClient{ + HTTPClient: client, + security: security, + } +} + +func (c *SecurityClient) Do(req *http.Request) (*http.Response, error) { + securityCtx, err := c.security(req.Context()) + if err != nil { + return nil, err + } + + ctx := securityConfig{ + headers: make(map[string]string), + queryParams: make(map[string]string), + } + parseSecurityStruct(&ctx, securityCtx) + + for k, v := range ctx.headers { + req.Header.Set(k, v) + } + + queryParams := req.URL.Query() + + for k, v := range ctx.queryParams { + queryParams.Add(k, v) + } + + req.URL.RawQuery = queryParams.Encode() + + return c.HTTPClient.Do(req) +} + +func ConfigureSecurityClient(c HTTPClient, security func(ctx context.Context) (interface{}, error)) *SecurityClient { + return newSecurityClient(c, security) +} + +func trueReflectValue(val reflect.Value) reflect.Value { + kind := val.Type().Kind() + for kind == reflect.Interface || kind == reflect.Ptr { + innerVal := val.Elem() + if !innerVal.IsValid() { + break + } + val = innerVal + kind = val.Type().Kind() + } + return val +} + +func parseSecurityStruct(c *securityConfig, security interface{}) { + securityValType := trueReflectValue(reflect.ValueOf(security)) + securityStructType := securityValType.Type() + + if isNil(securityStructType, securityValType) { + return + } + + if securityStructType.Kind() == reflect.Ptr { + securityStructType = securityStructType.Elem() + securityValType = securityValType.Elem() + } + + for i := 0; i < securityStructType.NumField(); i++ { + fieldType := securityStructType.Field(i) + valType := securityValType.Field(i) + + kind := valType.Kind() + + if isNil(fieldType.Type, valType) { + continue + } + + if fieldType.Type.Kind() == reflect.Pointer { + kind = valType.Elem().Kind() + } + + secTag := parseSecurityTag(fieldType) + if secTag != nil { + if secTag.Option { + handleSecurityOption(c, valType.Interface()) + } else if secTag.Scheme { + // Special case for basic auth which could be a flattened struct + if secTag.SubType == "basic" && kind != reflect.Struct { + parseSecurityScheme(c, secTag, security) + } else { + parseSecurityScheme(c, secTag, valType.Interface()) + } + } + } + } +} + +func handleSecurityOption(c *securityConfig, option interface{}) error { + optionValType := trueReflectValue(reflect.ValueOf(option)) + optionStructType := optionValType.Type() + + if isNil(optionStructType, optionValType) { + return nil + } + + for i := 0; i < optionStructType.NumField(); i++ { + fieldType := optionStructType.Field(i) + valType := optionValType.Field(i) + + secTag := parseSecurityTag(fieldType) + if secTag != nil && secTag.Scheme { + parseSecurityScheme(c, secTag, valType.Interface()) + } + } + + return nil +} + +func parseSecurityScheme(client *securityConfig, schemeTag *securityTag, scheme interface{}) { + schemeVal := trueReflectValue(reflect.ValueOf(scheme)) + schemeType := schemeVal.Type() + + if isNil(schemeType, schemeVal) { + return + } + + if schemeType.Kind() == reflect.Struct { + if schemeTag.Type == "http" && schemeTag.SubType == "basic" { + handleBasicAuthScheme(client, schemeVal.Interface()) + return + } + + for i := 0; i < schemeType.NumField(); i++ { + fieldType := schemeType.Field(i) + valType := schemeVal.Field(i) + + if isNil(fieldType.Type, valType) { + continue + } + + if fieldType.Type.Kind() == reflect.Ptr { + valType = valType.Elem() + } + + secTag := parseSecurityTag(fieldType) + if secTag == nil || secTag.Name == "" { + return + } + + parseSecuritySchemeValue(client, schemeTag, secTag, valType.Interface()) + } + } else { + parseSecuritySchemeValue(client, schemeTag, schemeTag, schemeVal.Interface()) + } +} + +func parseSecuritySchemeValue(client *securityConfig, schemeTag *securityTag, secTag *securityTag, val interface{}) { + switch schemeTag.Type { + case "apiKey": + switch schemeTag.SubType { + case "header": + client.headers[secTag.Name] = valToString(val) + case "query": + client.queryParams[secTag.Name] = valToString(val) + case "cookie": + client.headers["Cookie"] = fmt.Sprintf("%s=%s", secTag.Name, valToString(val)) + default: + panic("not supported") + } + case "openIdConnect": + client.headers[secTag.Name] = valToString(val) + case "oauth2": + client.headers[secTag.Name] = valToString(val) + case "http": + switch schemeTag.SubType { + case "bearer": + client.headers[secTag.Name] = prefixBearer(valToString(val)) + default: + panic("not supported") + } + default: + panic("not supported") + } +} + +func prefixBearer(authHeaderValue string) string { + if strings.HasPrefix(strings.ToLower(authHeaderValue), "bearer ") { + return authHeaderValue + } + + return fmt.Sprintf("Bearer %s", authHeaderValue) +} + +func handleBasicAuthScheme(client *securityConfig, scheme interface{}) { + schemeStructType := reflect.TypeOf(scheme) + schemeValType := reflect.ValueOf(scheme) + + var username, password string + + for i := 0; i < schemeStructType.NumField(); i++ { + fieldType := schemeStructType.Field(i) + valType := schemeValType.Field(i) + + secTag := parseSecurityTag(fieldType) + if secTag == nil || secTag.Name == "" { + continue + } + + switch secTag.Name { + case "username": + username = valType.String() + case "password": + password = valType.String() + } + } + + client.headers["Authorization"] = fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", username, password)))) +} + +func parseSecurityTag(field reflect.StructField) *securityTag { + tag := field.Tag.Get(securityTagKey) + if tag == "" { + return nil + } + + option := false + scheme := false + name := "" + securityType := "" + securitySubType := "" + + options := strings.Split(tag, ",") + for _, optionConf := range options { + parts := strings.Split(optionConf, "=") + if len(parts) < 1 || len(parts) > 2 { + continue + } + + switch parts[0] { + case "name": + name = parts[1] + case "type": + securityType = parts[1] + case "subtype": + securitySubType = parts[1] + case "option": + option = true + case "scheme": + scheme = true + } + } + + // TODO: validate tag? + + return &securityTag{ + Option: option, + Scheme: scheme, + Name: name, + Type: securityType, + SubType: securitySubType, + } +} diff --git a/internal/utils/utils.go b/internal/utils/utils.go new file mode 100644 index 0000000..b4618bb --- /dev/null +++ b/internal/utils/utils.go @@ -0,0 +1,170 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package utils + +import ( + "fmt" + "io" + "math/big" + "reflect" + "regexp" + "strings" + "time" + + "github.com/ericlagergren/decimal" +) + +const ( + queryParamTagKey = "queryParam" + headerParamTagKey = "header" + pathParamTagKey = "pathParam" +) + +var ( + paramRegex = regexp.MustCompile(`({.*?})`) + SerializationMethodToContentType = map[string]string{ + "json": "application/json", + "form": "application/x-www-form-urlencoded", + "multipart": "multipart/form-data", + "raw": "application/octet-stream", + "string": "text/plain", + } +) + +func UnmarshalJsonFromResponseBody(body io.Reader, out interface{}, tag string) error { + data, err := io.ReadAll(body) + if err != nil { + return fmt.Errorf("error reading response body: %w", err) + } + if err := UnmarshalJSON(data, out, reflect.StructTag(tag), true, false); err != nil { + return fmt.Errorf("error unmarshalling json response body: %w", err) + } + + return nil +} + +func ReplaceParameters(stringWithParams string, params map[string]string) string { + if len(params) == 0 { + return stringWithParams + } + + return paramRegex.ReplaceAllStringFunc(stringWithParams, func(match string) string { + match = match[1 : len(match)-1] + return params[match] + }) +} + +func Contains(slice []string, item string) bool { + for _, s := range slice { + if s == item { + return true + } + } + return false +} + +func parseStructTag(tagKey string, field reflect.StructField) map[string]string { + tag := field.Tag.Get(tagKey) + if tag == "" { + return nil + } + + values := map[string]string{} + + options := strings.Split(tag, ",") + for _, optionConf := range options { + parts := strings.Split(optionConf, "=") + + switch len(parts) { + case 1: + // flag option + parts = append(parts, "true") + case 2: + // key=value option + default: + // invalid option + continue + } + + values[parts[0]] = parts[1] + } + + return values +} + +func parseParamTag(tagKey string, field reflect.StructField, defaultStyle string, defaultExplode bool) *paramTag { + // example `{tagKey}:"style=simple,explode=false,name=apiID"` + values := parseStructTag(tagKey, field) + if values == nil { + return nil + } + + tag := ¶mTag{ + Style: defaultStyle, + Explode: defaultExplode, + ParamName: strings.ToLower(field.Name), + } + + for k, v := range values { + switch k { + case "style": + tag.Style = v + case "explode": + tag.Explode = v == "true" + case "name": + tag.ParamName = v + case "serialization": + tag.Serialization = v + } + } + + return tag +} + +func valToString(val interface{}) string { + switch v := val.(type) { + case time.Time: + return v.Format(time.RFC3339Nano) + case big.Int: + return v.String() + case decimal.Big: + return v.String() + default: + return fmt.Sprintf("%v", v) + } +} + +func populateFromGlobals(fieldType reflect.StructField, valType reflect.Value, paramType string, globals map[string]map[string]map[string]interface{}) reflect.Value { + if globals != nil && fieldType.Type.Kind() == reflect.Ptr { + parameters, ok := globals["parameters"] + if ok { + paramsOfType, ok := parameters[paramType] + if ok { + globalVal, ok := paramsOfType[fieldType.Name] + if ok { + if reflect.TypeOf(globalVal).Kind() == fieldType.Type.Elem().Kind() && valType.IsNil() { + valType = reflect.ValueOf(&globalVal) + } + } + } + } + } + + return valType +} + +func isNil(typ reflect.Type, val reflect.Value) bool { + // `reflect.TypeOf(nil) == nil` so calling typ.Kind() will cause a nil pointer + // dereference panic. Catch it and return early. + // https://github.com/golang/go/issues/51649 + // https://github.com/golang/go/issues/54208 + if typ == nil { + return true + } + + if typ.Kind() == reflect.Ptr || typ.Kind() == reflect.Map || typ.Kind() == reflect.Slice || typ.Kind() == reflect.Interface { + return val.IsNil() + } + + return false +} diff --git a/library.go b/library.go new file mode 100644 index 0000000..144c816 --- /dev/null +++ b/library.go @@ -0,0 +1,920 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Library - API Calls interacting with Plex Media Server Libraries +type Library struct { + sdkConfiguration sdkConfiguration +} + +func newLibrary(sdkConfig sdkConfiguration) *Library { + return &Library{ + sdkConfiguration: sdkConfig, + } +} + +// GetFileHash - Get Hash Value +// This resource returns hash values for local files +func (s *Library) GetFileHash(ctx context.Context, url_ string, type_ *float64) (*operations.GetFileHashResponse, error) { + request := operations.GetFileHashRequest{ + URL: url_, + Type: type_, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/library/hashes" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetFileHashResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetFileHashResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetRecentlyAdded - Get Recently Added +// This endpoint will return the recently added content. +func (s *Library) GetRecentlyAdded(ctx context.Context) (*operations.GetRecentlyAddedResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/library/recentlyAdded" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetRecentlyAddedResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetRecentlyAddedResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetRecentlyAddedResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetLibraries - Get All Libraries +// A library section (commonly referred to as just a library) is a collection of media. +// Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. +// For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat. +// +// Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. +// This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year). +func (s *Library) GetLibraries(ctx context.Context) (*operations.GetLibrariesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/library/sections" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetLibrariesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetLibrariesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetLibrary - Get Library Details +// Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are: +// +// - A list of `Directory` objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here: +// - Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users. +// - Secondary: These are marked with `secondary="1"` and were used by old clients to provide nested menus allowing for primative (but structured) navigation. +// - Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked `search="1"` which used to be used to allow clients to build search dialogs on the fly. +// +// - A list of `Type` objects: These represent the types of things found in this library, and for each one, a list of `Filter` and `Sort` objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. The `Type` object contains: +// - `key`: This provides the root endpoint returning the actual media list for the type. +// - `type`: This is the metadata type for the type (if a standard Plex type). +// - `title`: The title for for the content of this type (e.g. "Movies"). +// +// - Each `Filter` object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API. +// - `filter`: This represents the filter name used for the filter, which can be used to construct complex media queries with. +// - `filterType`: This is either `string`, `integer`, or `boolean`, and describes the type of values used for the filter. +// - `key`: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include a `type` argument that matches the metadata type of the Type element. +// - `title`: The title for the filter. +// +// - Each `Sort` object contains a description of the sort field. +// - `defaultDirection`: Can be either `asc` or `desc`, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending). +// - `descKey` and `key`: Contains the parameters passed to the `sort=...` media query for each direction of the sort. +// - `title`: The title of the field. +func (s *Library) GetLibrary(ctx context.Context, sectionID float64, includeDetails *operations.IncludeDetails) (*operations.GetLibraryResponse, error) { + request := operations.GetLibraryRequest{ + SectionID: sectionID, + IncludeDetails: includeDetails, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetLibraryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetLibraryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// DeleteLibrary - Delete Library Section +// Delate a library using a specific section +func (s *Library) DeleteLibrary(ctx context.Context, sectionID float64) (*operations.DeleteLibraryResponse, error) { + request := operations.DeleteLibraryRequest{ + SectionID: sectionID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.DeleteLibraryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.DeleteLibraryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetLibraryItems - Get Library Items +// This endpoint will return a list of library items filtered by the filter and type provided +func (s *Library) GetLibraryItems(ctx context.Context, sectionID float64, type_ *float64, filter *string) (*operations.GetLibraryItemsResponse, error) { + request := operations.GetLibraryItemsRequest{ + SectionID: sectionID, + Type: type_, + Filter: filter, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/all", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetLibraryItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetLibraryItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// RefreshLibrary - Refresh Library +// This endpoint Refreshes the library. +func (s *Library) RefreshLibrary(ctx context.Context, sectionID float64) (*operations.RefreshLibraryResponse, error) { + request := operations.RefreshLibraryRequest{ + SectionID: sectionID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/refresh", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.RefreshLibraryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.RefreshLibraryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetLatestLibraryItems - Get Latest Library Items +// This endpoint will return a list of the latest library items filtered by the filter and type provided +func (s *Library) GetLatestLibraryItems(ctx context.Context, sectionID float64, type_ float64, filter *string) (*operations.GetLatestLibraryItemsResponse, error) { + request := operations.GetLatestLibraryItemsRequest{ + SectionID: sectionID, + Type: type_, + Filter: filter, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/latest", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetLatestLibraryItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetLatestLibraryItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetCommonLibraryItems - Get Common Library Items +// Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter +func (s *Library) GetCommonLibraryItems(ctx context.Context, sectionID float64, type_ float64, filter *string) (*operations.GetCommonLibraryItemsResponse, error) { + request := operations.GetCommonLibraryItemsRequest{ + SectionID: sectionID, + Type: type_, + Filter: filter, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/sections/{sectionId}/common", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetCommonLibraryItemsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 404: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetCommonLibraryItemsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetMetadata - Get Items Metadata +// This endpoint will return the metadata of a library item specified with the ratingKey. +func (s *Library) GetMetadata(ctx context.Context, ratingKey float64) (*operations.GetMetadataResponse, error) { + request := operations.GetMetadataRequest{ + RatingKey: ratingKey, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetMetadataResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetMetadataResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetMetadataChildren - Get Items Children +// This endpoint will return the children of of a library item specified with the ratingKey. +func (s *Library) GetMetadataChildren(ctx context.Context, ratingKey float64) (*operations.GetMetadataChildrenResponse, error) { + request := operations.GetMetadataChildrenRequest{ + RatingKey: ratingKey, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/library/metadata/{ratingKey}/children", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetMetadataChildrenResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetMetadataChildrenResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetOnDeck - Get On Deck +// This endpoint will return the on deck content. +func (s *Library) GetOnDeck(ctx context.Context) (*operations.GetOnDeckResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/library/onDeck" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetOnDeckResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetOnDeckResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetOnDeckResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/log.go b/log.go new file mode 100644 index 0000000..6ea3a23 --- /dev/null +++ b/log.go @@ -0,0 +1,227 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Log - Submit logs to the Log Handler for Plex Media Server +type Log struct { + sdkConfiguration sdkConfiguration +} + +func newLog(sdkConfig sdkConfiguration) *Log { + return &Log{ + sdkConfiguration: sdkConfig, + } +} + +// LogLine - Logging a single line message. +// This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log. +func (s *Log) LogLine(ctx context.Context, level operations.Level, message string, source string) (*operations.LogLineResponse, error) { + request := operations.LogLineRequest{ + Level: level, + Message: message, + Source: source, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/log" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.LogLineResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.LogLineResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// LogMultiLine - Logging a multi-line message +// This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above. +func (s *Log) LogMultiLine(ctx context.Context) (*operations.LogMultiLineResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/log" + + req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.LogMultiLineResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.LogMultiLineResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// EnablePaperTrail - Enabling Papertrail +// This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time. +func (s *Log) EnablePaperTrail(ctx context.Context) (*operations.EnablePaperTrailResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/log/networked" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.EnablePaperTrailResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode == 403: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.EnablePaperTrailResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/media.go b/media.go new file mode 100644 index 0000000..2c41e43 --- /dev/null +++ b/media.go @@ -0,0 +1,241 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Media - API Calls interacting with Plex Media Server Media +type Media struct { + sdkConfiguration sdkConfiguration +} + +func newMedia(sdkConfig sdkConfiguration) *Media { + return &Media{ + sdkConfiguration: sdkConfig, + } +} + +// MarkPlayed - Mark Media Played +// This will mark the provided media key as Played. +func (s *Media) MarkPlayed(ctx context.Context, key float64) (*operations.MarkPlayedResponse, error) { + request := operations.MarkPlayedRequest{ + Key: key, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/:/scrobble" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.MarkPlayedResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.MarkPlayedResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// MarkUnplayed - Mark Media Unplayed +// This will mark the provided media key as Unplayed. +func (s *Media) MarkUnplayed(ctx context.Context, key float64) (*operations.MarkUnplayedResponse, error) { + request := operations.MarkUnplayedRequest{ + Key: key, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/:/unscrobble" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.MarkUnplayedResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.MarkUnplayedResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// UpdatePlayProgress - Update Media Play Progress +// This API command can be used to update the play progress of a media item. +func (s *Media) UpdatePlayProgress(ctx context.Context, key string, time float64, state string) (*operations.UpdatePlayProgressResponse, error) { + request := operations.UpdatePlayProgressRequest{ + Key: key, + Time: time, + State: state, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/:/progress" + + req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.UpdatePlayProgressResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.UpdatePlayProgressResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/models/components/security.go b/models/components/security.go new file mode 100644 index 0000000..a92b831 --- /dev/null +++ b/models/components/security.go @@ -0,0 +1,14 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package components + +type Security struct { + AccessToken string `security:"scheme,type=apiKey,subtype=header,name=X-Plex-Token"` +} + +func (o *Security) GetAccessToken() string { + if o == nil { + return "" + } + return o.AccessToken +} diff --git a/models/operations/addplaylistcontents.go b/models/operations/addplaylistcontents.go new file mode 100644 index 0000000..8f028a4 --- /dev/null +++ b/models/operations/addplaylistcontents.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type AddPlaylistContentsRequest struct { + // the ID of the playlist + PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` + // the content URI for the playlist + URI string `queryParam:"style=form,explode=true,name=uri"` + // the play queue to add to a playlist + PlayQueueID float64 `queryParam:"style=form,explode=true,name=playQueueID"` +} + +func (o *AddPlaylistContentsRequest) GetPlaylistID() float64 { + if o == nil { + return 0.0 + } + return o.PlaylistID +} + +func (o *AddPlaylistContentsRequest) GetURI() string { + if o == nil { + return "" + } + return o.URI +} + +func (o *AddPlaylistContentsRequest) GetPlayQueueID() float64 { + if o == nil { + return 0.0 + } + return o.PlayQueueID +} + +type AddPlaylistContentsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *AddPlaylistContentsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *AddPlaylistContentsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *AddPlaylistContentsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/applyupdates.go b/models/operations/applyupdates.go new file mode 100644 index 0000000..601204d --- /dev/null +++ b/models/operations/applyupdates.go @@ -0,0 +1,116 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Tonight - 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 +type Tonight int64 + +const ( + TonightZero Tonight = 0 + TonightOne Tonight = 1 +) + +func (e Tonight) ToPointer() *Tonight { + return &e +} + +func (e *Tonight) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = Tonight(v) + return nil + default: + return fmt.Errorf("invalid value for Tonight: %v", v) + } +} + +// Skip - Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. +type Skip int64 + +const ( + SkipZero Skip = 0 + SkipOne Skip = 1 +) + +func (e Skip) ToPointer() *Skip { + return &e +} + +func (e *Skip) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = Skip(v) + return nil + default: + return fmt.Errorf("invalid value for Skip: %v", v) + } +} + +type ApplyUpdatesRequest struct { + // 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 + Tonight *Tonight `queryParam:"style=form,explode=true,name=tonight"` + // Indicate that the latest version should be marked as skipped. The entry for this version will have the `state` set to `skipped`. + Skip *Skip `queryParam:"style=form,explode=true,name=skip"` +} + +func (o *ApplyUpdatesRequest) GetTonight() *Tonight { + if o == nil { + return nil + } + return o.Tonight +} + +func (o *ApplyUpdatesRequest) GetSkip() *Skip { + if o == nil { + return nil + } + return o.Skip +} + +type ApplyUpdatesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *ApplyUpdatesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ApplyUpdatesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ApplyUpdatesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/cancelserveractivities.go b/models/operations/cancelserveractivities.go new file mode 100644 index 0000000..9fbb11e --- /dev/null +++ b/models/operations/cancelserveractivities.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type CancelServerActivitiesRequest struct { + // The UUID of the activity to cancel. + ActivityUUID string `pathParam:"style=simple,explode=false,name=activityUUID"` +} + +func (o *CancelServerActivitiesRequest) GetActivityUUID() string { + if o == nil { + return "" + } + return o.ActivityUUID +} + +type CancelServerActivitiesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *CancelServerActivitiesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CancelServerActivitiesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CancelServerActivitiesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/checkforupdates.go b/models/operations/checkforupdates.go new file mode 100644 index 0000000..ecd960b --- /dev/null +++ b/models/operations/checkforupdates.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Download - Indicate that you want to start download any updates found. +type Download int64 + +const ( + DownloadZero Download = 0 + DownloadOne Download = 1 +) + +func (e Download) ToPointer() *Download { + return &e +} + +func (e *Download) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = Download(v) + return nil + default: + return fmt.Errorf("invalid value for Download: %v", v) + } +} + +type CheckForUpdatesRequest struct { + // Indicate that you want to start download any updates found. + Download *Download `queryParam:"style=form,explode=true,name=download"` +} + +func (o *CheckForUpdatesRequest) GetDownload() *Download { + if o == nil { + return nil + } + return o.Download +} + +type CheckForUpdatesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *CheckForUpdatesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CheckForUpdatesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CheckForUpdatesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/clearplaylistcontents.go b/models/operations/clearplaylistcontents.go new file mode 100644 index 0000000..37af329 --- /dev/null +++ b/models/operations/clearplaylistcontents.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type ClearPlaylistContentsRequest struct { + // the ID of the playlist + PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` +} + +func (o *ClearPlaylistContentsRequest) GetPlaylistID() float64 { + if o == nil { + return 0.0 + } + return o.PlaylistID +} + +type ClearPlaylistContentsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *ClearPlaylistContentsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *ClearPlaylistContentsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *ClearPlaylistContentsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/createplaylist.go b/models/operations/createplaylist.go new file mode 100644 index 0000000..11ac937 --- /dev/null +++ b/models/operations/createplaylist.go @@ -0,0 +1,146 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Type - type of playlist to create +type Type string + +const ( + TypeAudio Type = "audio" + TypeVideo Type = "video" + TypePhoto Type = "photo" +) + +func (e Type) ToPointer() *Type { + return &e +} + +func (e *Type) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "audio": + fallthrough + case "video": + fallthrough + case "photo": + *e = Type(v) + return nil + default: + return fmt.Errorf("invalid value for Type: %v", v) + } +} + +// Smart - whether the playlist is smart or not +type Smart int64 + +const ( + SmartZero Smart = 0 + SmartOne Smart = 1 +) + +func (e Smart) ToPointer() *Smart { + return &e +} + +func (e *Smart) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = Smart(v) + return nil + default: + return fmt.Errorf("invalid value for Smart: %v", v) + } +} + +type CreatePlaylistRequest struct { + // name of the playlist + Title string `queryParam:"style=form,explode=true,name=title"` + // type of playlist to create + Type Type `queryParam:"style=form,explode=true,name=type"` + // whether the playlist is smart or not + Smart Smart `queryParam:"style=form,explode=true,name=smart"` + // the content URI for the playlist + URI *string `queryParam:"style=form,explode=true,name=uri"` + // the play queue to copy to a playlist + PlayQueueID *float64 `queryParam:"style=form,explode=true,name=playQueueID"` +} + +func (o *CreatePlaylistRequest) GetTitle() string { + if o == nil { + return "" + } + return o.Title +} + +func (o *CreatePlaylistRequest) GetType() Type { + if o == nil { + return Type("") + } + return o.Type +} + +func (o *CreatePlaylistRequest) GetSmart() Smart { + if o == nil { + return Smart(0) + } + return o.Smart +} + +func (o *CreatePlaylistRequest) GetURI() *string { + if o == nil { + return nil + } + return o.URI +} + +func (o *CreatePlaylistRequest) GetPlayQueueID() *float64 { + if o == nil { + return nil + } + return o.PlayQueueID +} + +type CreatePlaylistResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *CreatePlaylistResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *CreatePlaylistResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *CreatePlaylistResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/deletelibrary.go b/models/operations/deletelibrary.go new file mode 100644 index 0000000..1f5d8a3 --- /dev/null +++ b/models/operations/deletelibrary.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type DeleteLibraryRequest struct { + // the Id of the library to query + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (o *DeleteLibraryRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +type DeleteLibraryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *DeleteLibraryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeleteLibraryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeleteLibraryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/deleteplaylist.go b/models/operations/deleteplaylist.go new file mode 100644 index 0000000..0beee02 --- /dev/null +++ b/models/operations/deleteplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type DeletePlaylistRequest struct { + // the ID of the playlist + PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` +} + +func (o *DeletePlaylistRequest) GetPlaylistID() float64 { + if o == nil { + return 0.0 + } + return o.PlaylistID +} + +type DeletePlaylistResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *DeletePlaylistResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *DeletePlaylistResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *DeletePlaylistResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/enablepapertrail.go b/models/operations/enablepapertrail.go new file mode 100644 index 0000000..f02f085 --- /dev/null +++ b/models/operations/enablepapertrail.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type EnablePaperTrailResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *EnablePaperTrailResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *EnablePaperTrailResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *EnablePaperTrailResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getavailableclients.go b/models/operations/getavailableclients.go new file mode 100644 index 0000000..0405e24 --- /dev/null +++ b/models/operations/getavailableclients.go @@ -0,0 +1,167 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type Server struct { + Name *string `json:"name,omitempty"` + Host *string `json:"host,omitempty"` + Address *string `json:"address,omitempty"` + Port *float64 `json:"port,omitempty"` + MachineIdentifier *string `json:"machineIdentifier,omitempty"` + Version *string `json:"version,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Product *string `json:"product,omitempty"` + DeviceClass *string `json:"deviceClass,omitempty"` + ProtocolVersion *float64 `json:"protocolVersion,omitempty"` + ProtocolCapabilities *string `json:"protocolCapabilities,omitempty"` +} + +func (o *Server) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Server) GetHost() *string { + if o == nil { + return nil + } + return o.Host +} + +func (o *Server) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *Server) GetPort() *float64 { + if o == nil { + return nil + } + return o.Port +} + +func (o *Server) GetMachineIdentifier() *string { + if o == nil { + return nil + } + return o.MachineIdentifier +} + +func (o *Server) GetVersion() *string { + if o == nil { + return nil + } + return o.Version +} + +func (o *Server) GetProtocol() *string { + if o == nil { + return nil + } + return o.Protocol +} + +func (o *Server) GetProduct() *string { + if o == nil { + return nil + } + return o.Product +} + +func (o *Server) GetDeviceClass() *string { + if o == nil { + return nil + } + return o.DeviceClass +} + +func (o *Server) GetProtocolVersion() *float64 { + if o == nil { + return nil + } + return o.ProtocolVersion +} + +func (o *Server) GetProtocolCapabilities() *string { + if o == nil { + return nil + } + return o.ProtocolCapabilities +} + +type GetAvailableClientsMediaContainer struct { + Size *float64 `json:"size,omitempty"` + Server []Server `json:"Server,omitempty"` +} + +func (o *GetAvailableClientsMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetAvailableClientsMediaContainer) GetServer() []Server { + if o == nil { + return nil + } + return o.Server +} + +type ResponseBody struct { + MediaContainer *GetAvailableClientsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *ResponseBody) GetMediaContainer() *GetAvailableClientsMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetAvailableClientsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Available Clients + ResponseBodies []ResponseBody +} + +func (o *GetAvailableClientsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetAvailableClientsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetAvailableClientsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetAvailableClientsResponse) GetResponseBodies() []ResponseBody { + if o == nil { + return nil + } + return o.ResponseBodies +} diff --git a/models/operations/getbutlertasks.go b/models/operations/getbutlertasks.go new file mode 100644 index 0000000..7d94c99 --- /dev/null +++ b/models/operations/getbutlertasks.go @@ -0,0 +1,120 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type ButlerTask struct { + Name *string `json:"name,omitempty"` + Interval *float64 `json:"interval,omitempty"` + ScheduleRandomized *bool `json:"scheduleRandomized,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Title *string `json:"title,omitempty"` + Description *string `json:"description,omitempty"` +} + +func (o *ButlerTask) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *ButlerTask) GetInterval() *float64 { + if o == nil { + return nil + } + return o.Interval +} + +func (o *ButlerTask) GetScheduleRandomized() *bool { + if o == nil { + return nil + } + return o.ScheduleRandomized +} + +func (o *ButlerTask) GetEnabled() *bool { + if o == nil { + return nil + } + return o.Enabled +} + +func (o *ButlerTask) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *ButlerTask) GetDescription() *string { + if o == nil { + return nil + } + return o.Description +} + +type ButlerTasks struct { + ButlerTask []ButlerTask `json:"ButlerTask,omitempty"` +} + +func (o *ButlerTasks) GetButlerTask() []ButlerTask { + if o == nil { + return nil + } + return o.ButlerTask +} + +// GetButlerTasksResponseBody - All butler tasks +type GetButlerTasksResponseBody struct { + ButlerTasks *ButlerTasks `json:"ButlerTasks,omitempty"` +} + +func (o *GetButlerTasksResponseBody) GetButlerTasks() *ButlerTasks { + if o == nil { + return nil + } + return o.ButlerTasks +} + +type GetButlerTasksResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // All butler tasks + Object *GetButlerTasksResponseBody +} + +func (o *GetButlerTasksResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetButlerTasksResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetButlerTasksResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetButlerTasksResponse) GetObject() *GetButlerTasksResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getcommonlibraryitems.go b/models/operations/getcommonlibraryitems.go new file mode 100644 index 0000000..7f8c78a --- /dev/null +++ b/models/operations/getcommonlibraryitems.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetCommonLibraryItemsRequest struct { + // the Id of the library to query + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` + // item type + Type float64 `queryParam:"style=form,explode=true,name=type"` + // the filter parameter + Filter *string `queryParam:"style=form,explode=true,name=filter"` +} + +func (o *GetCommonLibraryItemsRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +func (o *GetCommonLibraryItemsRequest) GetType() float64 { + if o == nil { + return 0.0 + } + return o.Type +} + +func (o *GetCommonLibraryItemsRequest) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +type GetCommonLibraryItemsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetCommonLibraryItemsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetCommonLibraryItemsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetCommonLibraryItemsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getdevices.go b/models/operations/getdevices.go new file mode 100644 index 0000000..6c07685 --- /dev/null +++ b/models/operations/getdevices.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type Device struct { + ID *float64 `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Platform *string `json:"platform,omitempty"` + ClientIdentifier *string `json:"clientIdentifier,omitempty"` + CreatedAt *float64 `json:"createdAt,omitempty"` +} + +func (o *Device) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *Device) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *Device) GetPlatform() *string { + if o == nil { + return nil + } + return o.Platform +} + +func (o *Device) GetClientIdentifier() *string { + if o == nil { + return nil + } + return o.ClientIdentifier +} + +func (o *Device) GetCreatedAt() *float64 { + if o == nil { + return nil + } + return o.CreatedAt +} + +type GetDevicesMediaContainer struct { + Size *float64 `json:"size,omitempty"` + Identifier *string `json:"identifier,omitempty"` + Device []Device `json:"Device,omitempty"` +} + +func (o *GetDevicesMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetDevicesMediaContainer) GetIdentifier() *string { + if o == nil { + return nil + } + return o.Identifier +} + +func (o *GetDevicesMediaContainer) GetDevice() []Device { + if o == nil { + return nil + } + return o.Device +} + +// GetDevicesResponseBody - Devices +type GetDevicesResponseBody struct { + MediaContainer *GetDevicesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetDevicesResponseBody) GetMediaContainer() *GetDevicesMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetDevicesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Devices + Object *GetDevicesResponseBody +} + +func (o *GetDevicesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetDevicesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetDevicesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetDevicesResponse) GetObject() *GetDevicesResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getfilehash.go b/models/operations/getfilehash.go new file mode 100644 index 0000000..bf63f88 --- /dev/null +++ b/models/operations/getfilehash.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetFileHashRequest struct { + // This is the path to the local file, must be prefixed by `file://` + URL string `queryParam:"style=form,explode=true,name=url"` + // Item type + Type *float64 `queryParam:"style=form,explode=true,name=type"` +} + +func (o *GetFileHashRequest) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +func (o *GetFileHashRequest) GetType() *float64 { + if o == nil { + return nil + } + return o.Type +} + +type GetFileHashResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetFileHashResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetFileHashResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetFileHashResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getglobalhubs.go b/models/operations/getglobalhubs.go new file mode 100644 index 0000000..50d64b5 --- /dev/null +++ b/models/operations/getglobalhubs.go @@ -0,0 +1,88 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// OnlyTransient - 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). +type OnlyTransient int64 + +const ( + OnlyTransientZero OnlyTransient = 0 + OnlyTransientOne OnlyTransient = 1 +) + +func (e OnlyTransient) ToPointer() *OnlyTransient { + return &e +} + +func (e *OnlyTransient) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = OnlyTransient(v) + return nil + default: + return fmt.Errorf("invalid value for OnlyTransient: %v", v) + } +} + +type GetGlobalHubsRequest struct { + // The number of items to return with each hub. + Count *float64 `queryParam:"style=form,explode=true,name=count"` + // 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). + OnlyTransient *OnlyTransient `queryParam:"style=form,explode=true,name=onlyTransient"` +} + +func (o *GetGlobalHubsRequest) GetCount() *float64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *GetGlobalHubsRequest) GetOnlyTransient() *OnlyTransient { + if o == nil { + return nil + } + return o.OnlyTransient +} + +type GetGlobalHubsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetGlobalHubsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetGlobalHubsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetGlobalHubsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getlatestlibraryitems.go b/models/operations/getlatestlibraryitems.go new file mode 100644 index 0000000..b467966 --- /dev/null +++ b/models/operations/getlatestlibraryitems.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetLatestLibraryItemsRequest struct { + // the Id of the library to query + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` + // item type + Type float64 `queryParam:"style=form,explode=true,name=type"` + // the filter parameter + Filter *string `queryParam:"style=form,explode=true,name=filter"` +} + +func (o *GetLatestLibraryItemsRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +func (o *GetLatestLibraryItemsRequest) GetType() float64 { + if o == nil { + return 0.0 + } + return o.Type +} + +func (o *GetLatestLibraryItemsRequest) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +type GetLatestLibraryItemsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetLatestLibraryItemsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetLatestLibraryItemsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetLatestLibraryItemsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getlibraries.go b/models/operations/getlibraries.go new file mode 100644 index 0000000..2bb5413 --- /dev/null +++ b/models/operations/getlibraries.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetLibrariesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetLibrariesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetLibrariesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetLibrariesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getlibrary.go b/models/operations/getlibrary.go new file mode 100644 index 0000000..da5a399 --- /dev/null +++ b/models/operations/getlibrary.go @@ -0,0 +1,103 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" +) + +// IncludeDetails - Whether or not to include details for a section (types, filters, and sorts). +// Only exists for backwards compatibility, media providers other than the server libraries have it on always. +type IncludeDetails int64 + +const ( + IncludeDetailsZero IncludeDetails = 0 + IncludeDetailsOne IncludeDetails = 1 +) + +func (e IncludeDetails) ToPointer() *IncludeDetails { + return &e +} + +func (e *IncludeDetails) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = IncludeDetails(v) + return nil + default: + return fmt.Errorf("invalid value for IncludeDetails: %v", v) + } +} + +type GetLibraryRequest struct { + // the Id of the library to query + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` + // Whether or not to include details for a section (types, filters, and sorts). + // Only exists for backwards compatibility, media providers other than the server libraries have it on always. + // + IncludeDetails *IncludeDetails `default:"0" queryParam:"style=form,explode=true,name=includeDetails"` +} + +func (g GetLibraryRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetLibraryRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetLibraryRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +func (o *GetLibraryRequest) GetIncludeDetails() *IncludeDetails { + if o == nil { + return nil + } + return o.IncludeDetails +} + +type GetLibraryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetLibraryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetLibraryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetLibraryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getlibraryhubs.go b/models/operations/getlibraryhubs.go new file mode 100644 index 0000000..9a09a3d --- /dev/null +++ b/models/operations/getlibraryhubs.go @@ -0,0 +1,97 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// QueryParamOnlyTransient - 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). +type QueryParamOnlyTransient int64 + +const ( + QueryParamOnlyTransientZero QueryParamOnlyTransient = 0 + QueryParamOnlyTransientOne QueryParamOnlyTransient = 1 +) + +func (e QueryParamOnlyTransient) ToPointer() *QueryParamOnlyTransient { + return &e +} + +func (e *QueryParamOnlyTransient) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = QueryParamOnlyTransient(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamOnlyTransient: %v", v) + } +} + +type GetLibraryHubsRequest struct { + // the Id of the library to query + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` + // The number of items to return with each hub. + Count *float64 `queryParam:"style=form,explode=true,name=count"` + // 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). + OnlyTransient *QueryParamOnlyTransient `queryParam:"style=form,explode=true,name=onlyTransient"` +} + +func (o *GetLibraryHubsRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +func (o *GetLibraryHubsRequest) GetCount() *float64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *GetLibraryHubsRequest) GetOnlyTransient() *QueryParamOnlyTransient { + if o == nil { + return nil + } + return o.OnlyTransient +} + +type GetLibraryHubsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetLibraryHubsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetLibraryHubsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetLibraryHubsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getlibraryitems.go b/models/operations/getlibraryitems.go new file mode 100644 index 0000000..262e3c9 --- /dev/null +++ b/models/operations/getlibraryitems.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetLibraryItemsRequest struct { + // the Id of the library to query + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` + // item type + Type *float64 `queryParam:"style=form,explode=true,name=type"` + // the filter parameter + Filter *string `queryParam:"style=form,explode=true,name=filter"` +} + +func (o *GetLibraryItemsRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +func (o *GetLibraryItemsRequest) GetType() *float64 { + if o == nil { + return nil + } + return o.Type +} + +func (o *GetLibraryItemsRequest) GetFilter() *string { + if o == nil { + return nil + } + return o.Filter +} + +type GetLibraryItemsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetLibraryItemsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetLibraryItemsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetLibraryItemsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getmetadata.go b/models/operations/getmetadata.go new file mode 100644 index 0000000..4105e04 --- /dev/null +++ b/models/operations/getmetadata.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetMetadataRequest struct { + // the id of the library item to return the children of. + RatingKey float64 `pathParam:"style=simple,explode=false,name=ratingKey"` +} + +func (o *GetMetadataRequest) GetRatingKey() float64 { + if o == nil { + return 0.0 + } + return o.RatingKey +} + +type GetMetadataResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetMetadataResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetMetadataResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetMetadataResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getmetadatachildren.go b/models/operations/getmetadatachildren.go new file mode 100644 index 0000000..be76aa3 --- /dev/null +++ b/models/operations/getmetadatachildren.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetMetadataChildrenRequest struct { + // the id of the library item to return the children of. + RatingKey float64 `pathParam:"style=simple,explode=false,name=ratingKey"` +} + +func (o *GetMetadataChildrenRequest) GetRatingKey() float64 { + if o == nil { + return 0.0 + } + return o.RatingKey +} + +type GetMetadataChildrenResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetMetadataChildrenResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetMetadataChildrenResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetMetadataChildrenResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getmyplexaccount.go b/models/operations/getmyplexaccount.go new file mode 100644 index 0000000..8d49298 --- /dev/null +++ b/models/operations/getmyplexaccount.go @@ -0,0 +1,157 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type MyPlex struct { + AuthToken *string `json:"authToken,omitempty"` + Username *string `json:"username,omitempty"` + MappingState *string `json:"mappingState,omitempty"` + MappingError *string `json:"mappingError,omitempty"` + SignInState *string `json:"signInState,omitempty"` + PublicAddress *string `json:"publicAddress,omitempty"` + PublicPort *float64 `json:"publicPort,omitempty"` + PrivateAddress *string `json:"privateAddress,omitempty"` + PrivatePort *float64 `json:"privatePort,omitempty"` + SubscriptionFeatures *string `json:"subscriptionFeatures,omitempty"` + SubscriptionActive *bool `json:"subscriptionActive,omitempty"` + SubscriptionState *string `json:"subscriptionState,omitempty"` +} + +func (o *MyPlex) GetAuthToken() *string { + if o == nil { + return nil + } + return o.AuthToken +} + +func (o *MyPlex) GetUsername() *string { + if o == nil { + return nil + } + return o.Username +} + +func (o *MyPlex) GetMappingState() *string { + if o == nil { + return nil + } + return o.MappingState +} + +func (o *MyPlex) GetMappingError() *string { + if o == nil { + return nil + } + return o.MappingError +} + +func (o *MyPlex) GetSignInState() *string { + if o == nil { + return nil + } + return o.SignInState +} + +func (o *MyPlex) GetPublicAddress() *string { + if o == nil { + return nil + } + return o.PublicAddress +} + +func (o *MyPlex) GetPublicPort() *float64 { + if o == nil { + return nil + } + return o.PublicPort +} + +func (o *MyPlex) GetPrivateAddress() *string { + if o == nil { + return nil + } + return o.PrivateAddress +} + +func (o *MyPlex) GetPrivatePort() *float64 { + if o == nil { + return nil + } + return o.PrivatePort +} + +func (o *MyPlex) GetSubscriptionFeatures() *string { + if o == nil { + return nil + } + return o.SubscriptionFeatures +} + +func (o *MyPlex) GetSubscriptionActive() *bool { + if o == nil { + return nil + } + return o.SubscriptionActive +} + +func (o *MyPlex) GetSubscriptionState() *string { + if o == nil { + return nil + } + return o.SubscriptionState +} + +// GetMyPlexAccountResponseBody - MyPlex Account +type GetMyPlexAccountResponseBody struct { + MyPlex *MyPlex `json:"MyPlex,omitempty"` +} + +func (o *GetMyPlexAccountResponseBody) GetMyPlex() *MyPlex { + if o == nil { + return nil + } + return o.MyPlex +} + +type GetMyPlexAccountResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // MyPlex Account + Object *GetMyPlexAccountResponseBody +} + +func (o *GetMyPlexAccountResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetMyPlexAccountResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetMyPlexAccountResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetMyPlexAccountResponse) GetObject() *GetMyPlexAccountResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getondeck.go b/models/operations/getondeck.go new file mode 100644 index 0000000..05854a1 --- /dev/null +++ b/models/operations/getondeck.go @@ -0,0 +1,817 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" + "time" +) + +type Stream struct { + ID *float64 `json:"id,omitempty"` + StreamType *float64 `json:"streamType,omitempty"` + Default *bool `json:"default,omitempty"` + Codec *string `json:"codec,omitempty"` + Index *float64 `json:"index,omitempty"` + Bitrate *float64 `json:"bitrate,omitempty"` + Language *string `json:"language,omitempty"` + LanguageTag *string `json:"languageTag,omitempty"` + LanguageCode *string `json:"languageCode,omitempty"` + BitDepth *float64 `json:"bitDepth,omitempty"` + ChromaLocation *string `json:"chromaLocation,omitempty"` + ChromaSubsampling *string `json:"chromaSubsampling,omitempty"` + CodedHeight *float64 `json:"codedHeight,omitempty"` + CodedWidth *float64 `json:"codedWidth,omitempty"` + ColorRange *string `json:"colorRange,omitempty"` + FrameRate *float64 `json:"frameRate,omitempty"` + Height *float64 `json:"height,omitempty"` + Level *float64 `json:"level,omitempty"` + Profile *string `json:"profile,omitempty"` + RefFrames *float64 `json:"refFrames,omitempty"` + Width *float64 `json:"width,omitempty"` + DisplayTitle *string `json:"displayTitle,omitempty"` + ExtendedDisplayTitle *string `json:"extendedDisplayTitle,omitempty"` +} + +func (o *Stream) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *Stream) GetStreamType() *float64 { + if o == nil { + return nil + } + return o.StreamType +} + +func (o *Stream) GetDefault() *bool { + if o == nil { + return nil + } + return o.Default +} + +func (o *Stream) GetCodec() *string { + if o == nil { + return nil + } + return o.Codec +} + +func (o *Stream) GetIndex() *float64 { + if o == nil { + return nil + } + return o.Index +} + +func (o *Stream) GetBitrate() *float64 { + if o == nil { + return nil + } + return o.Bitrate +} + +func (o *Stream) GetLanguage() *string { + if o == nil { + return nil + } + return o.Language +} + +func (o *Stream) GetLanguageTag() *string { + if o == nil { + return nil + } + return o.LanguageTag +} + +func (o *Stream) GetLanguageCode() *string { + if o == nil { + return nil + } + return o.LanguageCode +} + +func (o *Stream) GetBitDepth() *float64 { + if o == nil { + return nil + } + return o.BitDepth +} + +func (o *Stream) GetChromaLocation() *string { + if o == nil { + return nil + } + return o.ChromaLocation +} + +func (o *Stream) GetChromaSubsampling() *string { + if o == nil { + return nil + } + return o.ChromaSubsampling +} + +func (o *Stream) GetCodedHeight() *float64 { + if o == nil { + return nil + } + return o.CodedHeight +} + +func (o *Stream) GetCodedWidth() *float64 { + if o == nil { + return nil + } + return o.CodedWidth +} + +func (o *Stream) GetColorRange() *string { + if o == nil { + return nil + } + return o.ColorRange +} + +func (o *Stream) GetFrameRate() *float64 { + if o == nil { + return nil + } + return o.FrameRate +} + +func (o *Stream) GetHeight() *float64 { + if o == nil { + return nil + } + return o.Height +} + +func (o *Stream) GetLevel() *float64 { + if o == nil { + return nil + } + return o.Level +} + +func (o *Stream) GetProfile() *string { + if o == nil { + return nil + } + return o.Profile +} + +func (o *Stream) GetRefFrames() *float64 { + if o == nil { + return nil + } + return o.RefFrames +} + +func (o *Stream) GetWidth() *float64 { + if o == nil { + return nil + } + return o.Width +} + +func (o *Stream) GetDisplayTitle() *string { + if o == nil { + return nil + } + return o.DisplayTitle +} + +func (o *Stream) GetExtendedDisplayTitle() *string { + if o == nil { + return nil + } + return o.ExtendedDisplayTitle +} + +type GetOnDeckPart struct { + ID *float64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Duration *float64 `json:"duration,omitempty"` + File *string `json:"file,omitempty"` + Size *float64 `json:"size,omitempty"` + AudioProfile *string `json:"audioProfile,omitempty"` + Container *string `json:"container,omitempty"` + VideoProfile *string `json:"videoProfile,omitempty"` + Stream []Stream `json:"Stream,omitempty"` +} + +func (o *GetOnDeckPart) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *GetOnDeckPart) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetOnDeckPart) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *GetOnDeckPart) GetFile() *string { + if o == nil { + return nil + } + return o.File +} + +func (o *GetOnDeckPart) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetOnDeckPart) GetAudioProfile() *string { + if o == nil { + return nil + } + return o.AudioProfile +} + +func (o *GetOnDeckPart) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *GetOnDeckPart) GetVideoProfile() *string { + if o == nil { + return nil + } + return o.VideoProfile +} + +func (o *GetOnDeckPart) GetStream() []Stream { + if o == nil { + return nil + } + return o.Stream +} + +type GetOnDeckMedia struct { + ID *float64 `json:"id,omitempty"` + Duration *float64 `json:"duration,omitempty"` + Bitrate *float64 `json:"bitrate,omitempty"` + Width *float64 `json:"width,omitempty"` + Height *float64 `json:"height,omitempty"` + AspectRatio *float64 `json:"aspectRatio,omitempty"` + AudioChannels *float64 `json:"audioChannels,omitempty"` + AudioCodec *string `json:"audioCodec,omitempty"` + VideoCodec *string `json:"videoCodec,omitempty"` + VideoResolution *string `json:"videoResolution,omitempty"` + Container *string `json:"container,omitempty"` + VideoFrameRate *string `json:"videoFrameRate,omitempty"` + AudioProfile *string `json:"audioProfile,omitempty"` + VideoProfile *string `json:"videoProfile,omitempty"` + Part []GetOnDeckPart `json:"Part,omitempty"` +} + +func (o *GetOnDeckMedia) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *GetOnDeckMedia) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *GetOnDeckMedia) GetBitrate() *float64 { + if o == nil { + return nil + } + return o.Bitrate +} + +func (o *GetOnDeckMedia) GetWidth() *float64 { + if o == nil { + return nil + } + return o.Width +} + +func (o *GetOnDeckMedia) GetHeight() *float64 { + if o == nil { + return nil + } + return o.Height +} + +func (o *GetOnDeckMedia) GetAspectRatio() *float64 { + if o == nil { + return nil + } + return o.AspectRatio +} + +func (o *GetOnDeckMedia) GetAudioChannels() *float64 { + if o == nil { + return nil + } + return o.AudioChannels +} + +func (o *GetOnDeckMedia) GetAudioCodec() *string { + if o == nil { + return nil + } + return o.AudioCodec +} + +func (o *GetOnDeckMedia) GetVideoCodec() *string { + if o == nil { + return nil + } + return o.VideoCodec +} + +func (o *GetOnDeckMedia) GetVideoResolution() *string { + if o == nil { + return nil + } + return o.VideoResolution +} + +func (o *GetOnDeckMedia) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *GetOnDeckMedia) GetVideoFrameRate() *string { + if o == nil { + return nil + } + return o.VideoFrameRate +} + +func (o *GetOnDeckMedia) GetAudioProfile() *string { + if o == nil { + return nil + } + return o.AudioProfile +} + +func (o *GetOnDeckMedia) GetVideoProfile() *string { + if o == nil { + return nil + } + return o.VideoProfile +} + +func (o *GetOnDeckMedia) GetPart() []GetOnDeckPart { + if o == nil { + return nil + } + return o.Part +} + +type Guids struct { + ID *string `json:"id,omitempty"` +} + +func (o *Guids) GetID() *string { + if o == nil { + return nil + } + return o.ID +} + +type GetOnDeckMetadata struct { + AllowSync *bool `json:"allowSync,omitempty"` + LibrarySectionID *float64 `json:"librarySectionID,omitempty"` + LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` + LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` + RatingKey *float64 `json:"ratingKey,omitempty"` + Key *string `json:"key,omitempty"` + ParentRatingKey *float64 `json:"parentRatingKey,omitempty"` + GrandparentRatingKey *float64 `json:"grandparentRatingKey,omitempty"` + GUID *string `json:"guid,omitempty"` + ParentGUID *string `json:"parentGuid,omitempty"` + GrandparentGUID *string `json:"grandparentGuid,omitempty"` + Type *string `json:"type,omitempty"` + Title *string `json:"title,omitempty"` + GrandparentKey *string `json:"grandparentKey,omitempty"` + ParentKey *string `json:"parentKey,omitempty"` + LibrarySectionKey *string `json:"librarySectionKey,omitempty"` + GrandparentTitle *string `json:"grandparentTitle,omitempty"` + ParentTitle *string `json:"parentTitle,omitempty"` + ContentRating *string `json:"contentRating,omitempty"` + Summary *string `json:"summary,omitempty"` + Index *float64 `json:"index,omitempty"` + ParentIndex *float64 `json:"parentIndex,omitempty"` + LastViewedAt *float64 `json:"lastViewedAt,omitempty"` + Year *float64 `json:"year,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Art *string `json:"art,omitempty"` + ParentThumb *string `json:"parentThumb,omitempty"` + GrandparentThumb *string `json:"grandparentThumb,omitempty"` + GrandparentArt *string `json:"grandparentArt,omitempty"` + GrandparentTheme *string `json:"grandparentTheme,omitempty"` + Duration *float64 `json:"duration,omitempty"` + OriginallyAvailableAt *time.Time `json:"originallyAvailableAt,omitempty"` + AddedAt *float64 `json:"addedAt,omitempty"` + UpdatedAt *float64 `json:"updatedAt,omitempty"` + Media []GetOnDeckMedia `json:"Media,omitempty"` + Guids []Guids `json:"Guid,omitempty"` +} + +func (g GetOnDeckMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetOnDeckMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetOnDeckMetadata) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *GetOnDeckMetadata) GetLibrarySectionID() *float64 { + if o == nil { + return nil + } + return o.LibrarySectionID +} + +func (o *GetOnDeckMetadata) GetLibrarySectionTitle() *string { + if o == nil { + return nil + } + return o.LibrarySectionTitle +} + +func (o *GetOnDeckMetadata) GetLibrarySectionUUID() *string { + if o == nil { + return nil + } + return o.LibrarySectionUUID +} + +func (o *GetOnDeckMetadata) GetRatingKey() *float64 { + if o == nil { + return nil + } + return o.RatingKey +} + +func (o *GetOnDeckMetadata) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetOnDeckMetadata) GetParentRatingKey() *float64 { + if o == nil { + return nil + } + return o.ParentRatingKey +} + +func (o *GetOnDeckMetadata) GetGrandparentRatingKey() *float64 { + if o == nil { + return nil + } + return o.GrandparentRatingKey +} + +func (o *GetOnDeckMetadata) GetGUID() *string { + if o == nil { + return nil + } + return o.GUID +} + +func (o *GetOnDeckMetadata) GetParentGUID() *string { + if o == nil { + return nil + } + return o.ParentGUID +} + +func (o *GetOnDeckMetadata) GetGrandparentGUID() *string { + if o == nil { + return nil + } + return o.GrandparentGUID +} + +func (o *GetOnDeckMetadata) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *GetOnDeckMetadata) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *GetOnDeckMetadata) GetGrandparentKey() *string { + if o == nil { + return nil + } + return o.GrandparentKey +} + +func (o *GetOnDeckMetadata) GetParentKey() *string { + if o == nil { + return nil + } + return o.ParentKey +} + +func (o *GetOnDeckMetadata) GetLibrarySectionKey() *string { + if o == nil { + return nil + } + return o.LibrarySectionKey +} + +func (o *GetOnDeckMetadata) GetGrandparentTitle() *string { + if o == nil { + return nil + } + return o.GrandparentTitle +} + +func (o *GetOnDeckMetadata) GetParentTitle() *string { + if o == nil { + return nil + } + return o.ParentTitle +} + +func (o *GetOnDeckMetadata) GetContentRating() *string { + if o == nil { + return nil + } + return o.ContentRating +} + +func (o *GetOnDeckMetadata) GetSummary() *string { + if o == nil { + return nil + } + return o.Summary +} + +func (o *GetOnDeckMetadata) GetIndex() *float64 { + if o == nil { + return nil + } + return o.Index +} + +func (o *GetOnDeckMetadata) GetParentIndex() *float64 { + if o == nil { + return nil + } + return o.ParentIndex +} + +func (o *GetOnDeckMetadata) GetLastViewedAt() *float64 { + if o == nil { + return nil + } + return o.LastViewedAt +} + +func (o *GetOnDeckMetadata) GetYear() *float64 { + if o == nil { + return nil + } + return o.Year +} + +func (o *GetOnDeckMetadata) GetThumb() *string { + if o == nil { + return nil + } + return o.Thumb +} + +func (o *GetOnDeckMetadata) GetArt() *string { + if o == nil { + return nil + } + return o.Art +} + +func (o *GetOnDeckMetadata) GetParentThumb() *string { + if o == nil { + return nil + } + return o.ParentThumb +} + +func (o *GetOnDeckMetadata) GetGrandparentThumb() *string { + if o == nil { + return nil + } + return o.GrandparentThumb +} + +func (o *GetOnDeckMetadata) GetGrandparentArt() *string { + if o == nil { + return nil + } + return o.GrandparentArt +} + +func (o *GetOnDeckMetadata) GetGrandparentTheme() *string { + if o == nil { + return nil + } + return o.GrandparentTheme +} + +func (o *GetOnDeckMetadata) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *GetOnDeckMetadata) GetOriginallyAvailableAt() *time.Time { + if o == nil { + return nil + } + return o.OriginallyAvailableAt +} + +func (o *GetOnDeckMetadata) GetAddedAt() *float64 { + if o == nil { + return nil + } + return o.AddedAt +} + +func (o *GetOnDeckMetadata) GetUpdatedAt() *float64 { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *GetOnDeckMetadata) GetMedia() []GetOnDeckMedia { + if o == nil { + return nil + } + return o.Media +} + +func (o *GetOnDeckMetadata) GetGuids() []Guids { + if o == nil { + return nil + } + return o.Guids +} + +type GetOnDeckMediaContainer struct { + Size *float64 `json:"size,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Identifier *string `json:"identifier,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *float64 `json:"mediaTagVersion,omitempty"` + MixedParents *bool `json:"mixedParents,omitempty"` + Metadata []GetOnDeckMetadata `json:"Metadata,omitempty"` +} + +func (o *GetOnDeckMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetOnDeckMediaContainer) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *GetOnDeckMediaContainer) GetIdentifier() *string { + if o == nil { + return nil + } + return o.Identifier +} + +func (o *GetOnDeckMediaContainer) GetMediaTagPrefix() *string { + if o == nil { + return nil + } + return o.MediaTagPrefix +} + +func (o *GetOnDeckMediaContainer) GetMediaTagVersion() *float64 { + if o == nil { + return nil + } + return o.MediaTagVersion +} + +func (o *GetOnDeckMediaContainer) GetMixedParents() *bool { + if o == nil { + return nil + } + return o.MixedParents +} + +func (o *GetOnDeckMediaContainer) GetMetadata() []GetOnDeckMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +// GetOnDeckResponseBody - The on Deck content +type GetOnDeckResponseBody struct { + MediaContainer *GetOnDeckMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetOnDeckResponseBody) GetMediaContainer() *GetOnDeckMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetOnDeckResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The on Deck content + Object *GetOnDeckResponseBody +} + +func (o *GetOnDeckResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetOnDeckResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetOnDeckResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetOnDeckResponse) GetObject() *GetOnDeckResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getplaylist.go b/models/operations/getplaylist.go new file mode 100644 index 0000000..b5f2d1a --- /dev/null +++ b/models/operations/getplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetPlaylistRequest struct { + // the ID of the playlist + PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` +} + +func (o *GetPlaylistRequest) GetPlaylistID() float64 { + if o == nil { + return 0.0 + } + return o.PlaylistID +} + +type GetPlaylistResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetPlaylistResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPlaylistResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPlaylistResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getplaylistcontents.go b/models/operations/getplaylistcontents.go new file mode 100644 index 0000000..b09aaf8 --- /dev/null +++ b/models/operations/getplaylistcontents.go @@ -0,0 +1,58 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetPlaylistContentsRequest struct { + // the ID of the playlist + PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` + // the metadata type of the item to return + Type float64 `queryParam:"style=form,explode=true,name=type"` +} + +func (o *GetPlaylistContentsRequest) GetPlaylistID() float64 { + if o == nil { + return 0.0 + } + return o.PlaylistID +} + +func (o *GetPlaylistContentsRequest) GetType() float64 { + if o == nil { + return 0.0 + } + return o.Type +} + +type GetPlaylistContentsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetPlaylistContentsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPlaylistContentsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPlaylistContentsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getplaylists.go b/models/operations/getplaylists.go new file mode 100644 index 0000000..df00c02 --- /dev/null +++ b/models/operations/getplaylists.go @@ -0,0 +1,119 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// PlaylistType - limit to a type of playlist. +type PlaylistType string + +const ( + PlaylistTypeAudio PlaylistType = "audio" + PlaylistTypeVideo PlaylistType = "video" + PlaylistTypePhoto PlaylistType = "photo" +) + +func (e PlaylistType) ToPointer() *PlaylistType { + return &e +} + +func (e *PlaylistType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "audio": + fallthrough + case "video": + fallthrough + case "photo": + *e = PlaylistType(v) + return nil + default: + return fmt.Errorf("invalid value for PlaylistType: %v", v) + } +} + +// QueryParamSmart - type of playlists to return (default is all). +type QueryParamSmart int64 + +const ( + QueryParamSmartZero QueryParamSmart = 0 + QueryParamSmartOne QueryParamSmart = 1 +) + +func (e QueryParamSmart) ToPointer() *QueryParamSmart { + return &e +} + +func (e *QueryParamSmart) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = QueryParamSmart(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamSmart: %v", v) + } +} + +type GetPlaylistsRequest struct { + // limit to a type of playlist. + PlaylistType *PlaylistType `queryParam:"style=form,explode=true,name=playlistType"` + // type of playlists to return (default is all). + Smart *QueryParamSmart `queryParam:"style=form,explode=true,name=smart"` +} + +func (o *GetPlaylistsRequest) GetPlaylistType() *PlaylistType { + if o == nil { + return nil + } + return o.PlaylistType +} + +func (o *GetPlaylistsRequest) GetSmart() *QueryParamSmart { + if o == nil { + return nil + } + return o.Smart +} + +type GetPlaylistsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetPlaylistsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetPlaylistsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetPlaylistsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getrecentlyadded.go b/models/operations/getrecentlyadded.go new file mode 100644 index 0000000..1f340ad --- /dev/null +++ b/models/operations/getrecentlyadded.go @@ -0,0 +1,658 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" + "time" +) + +type Part struct { + ID *float64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Duration *float64 `json:"duration,omitempty"` + File *string `json:"file,omitempty"` + Size *float64 `json:"size,omitempty"` + Container *string `json:"container,omitempty"` + Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` + HasThumbnail *float64 `json:"hasThumbnail,omitempty"` + OptimizedForStreaming *bool `json:"optimizedForStreaming,omitempty"` + VideoProfile *string `json:"videoProfile,omitempty"` +} + +func (o *Part) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *Part) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Part) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *Part) GetFile() *string { + if o == nil { + return nil + } + return o.File +} + +func (o *Part) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *Part) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *Part) GetHas64bitOffsets() *bool { + if o == nil { + return nil + } + return o.Has64bitOffsets +} + +func (o *Part) GetHasThumbnail() *float64 { + if o == nil { + return nil + } + return o.HasThumbnail +} + +func (o *Part) GetOptimizedForStreaming() *bool { + if o == nil { + return nil + } + return o.OptimizedForStreaming +} + +func (o *Part) GetVideoProfile() *string { + if o == nil { + return nil + } + return o.VideoProfile +} + +type Media struct { + ID *float64 `json:"id,omitempty"` + Duration *float64 `json:"duration,omitempty"` + Bitrate *float64 `json:"bitrate,omitempty"` + Width *float64 `json:"width,omitempty"` + Height *float64 `json:"height,omitempty"` + AspectRatio *float64 `json:"aspectRatio,omitempty"` + AudioChannels *float64 `json:"audioChannels,omitempty"` + AudioCodec *string `json:"audioCodec,omitempty"` + VideoCodec *string `json:"videoCodec,omitempty"` + VideoResolution *float64 `json:"videoResolution,omitempty"` + Container *string `json:"container,omitempty"` + VideoFrameRate *string `json:"videoFrameRate,omitempty"` + OptimizedForStreaming *float64 `json:"optimizedForStreaming,omitempty"` + Has64bitOffsets *bool `json:"has64bitOffsets,omitempty"` + VideoProfile *string `json:"videoProfile,omitempty"` + Part []Part `json:"Part,omitempty"` +} + +func (o *Media) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *Media) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *Media) GetBitrate() *float64 { + if o == nil { + return nil + } + return o.Bitrate +} + +func (o *Media) GetWidth() *float64 { + if o == nil { + return nil + } + return o.Width +} + +func (o *Media) GetHeight() *float64 { + if o == nil { + return nil + } + return o.Height +} + +func (o *Media) GetAspectRatio() *float64 { + if o == nil { + return nil + } + return o.AspectRatio +} + +func (o *Media) GetAudioChannels() *float64 { + if o == nil { + return nil + } + return o.AudioChannels +} + +func (o *Media) GetAudioCodec() *string { + if o == nil { + return nil + } + return o.AudioCodec +} + +func (o *Media) GetVideoCodec() *string { + if o == nil { + return nil + } + return o.VideoCodec +} + +func (o *Media) GetVideoResolution() *float64 { + if o == nil { + return nil + } + return o.VideoResolution +} + +func (o *Media) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *Media) GetVideoFrameRate() *string { + if o == nil { + return nil + } + return o.VideoFrameRate +} + +func (o *Media) GetOptimizedForStreaming() *float64 { + if o == nil { + return nil + } + return o.OptimizedForStreaming +} + +func (o *Media) GetHas64bitOffsets() *bool { + if o == nil { + return nil + } + return o.Has64bitOffsets +} + +func (o *Media) GetVideoProfile() *string { + if o == nil { + return nil + } + return o.VideoProfile +} + +func (o *Media) GetPart() []Part { + if o == nil { + return nil + } + return o.Part +} + +type Genre struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *Genre) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type Director struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *Director) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type Writer struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *Writer) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type Country struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *Country) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type Role struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *Role) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type Metadata struct { + AllowSync *bool `json:"allowSync,omitempty"` + LibrarySectionID *float64 `json:"librarySectionID,omitempty"` + LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` + LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` + RatingKey *float64 `json:"ratingKey,omitempty"` + Key *string `json:"key,omitempty"` + GUID *string `json:"guid,omitempty"` + Studio *string `json:"studio,omitempty"` + Type *string `json:"type,omitempty"` + Title *string `json:"title,omitempty"` + ContentRating *string `json:"contentRating,omitempty"` + Summary *string `json:"summary,omitempty"` + Rating *float64 `json:"rating,omitempty"` + AudienceRating *float64 `json:"audienceRating,omitempty"` + Year *float64 `json:"year,omitempty"` + Tagline *string `json:"tagline,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Art *string `json:"art,omitempty"` + Duration *float64 `json:"duration,omitempty"` + OriginallyAvailableAt *time.Time `json:"originallyAvailableAt,omitempty"` + AddedAt *float64 `json:"addedAt,omitempty"` + UpdatedAt *float64 `json:"updatedAt,omitempty"` + AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` + ChapterSource *string `json:"chapterSource,omitempty"` + PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` + RatingImage *string `json:"ratingImage,omitempty"` + Media []Media `json:"Media,omitempty"` + Genre []Genre `json:"Genre,omitempty"` + Director []Director `json:"Director,omitempty"` + Writer []Writer `json:"Writer,omitempty"` + Country []Country `json:"Country,omitempty"` + Role []Role `json:"Role,omitempty"` +} + +func (m Metadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(m, "", false) +} + +func (m *Metadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &m, "", false, false); err != nil { + return err + } + return nil +} + +func (o *Metadata) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *Metadata) GetLibrarySectionID() *float64 { + if o == nil { + return nil + } + return o.LibrarySectionID +} + +func (o *Metadata) GetLibrarySectionTitle() *string { + if o == nil { + return nil + } + return o.LibrarySectionTitle +} + +func (o *Metadata) GetLibrarySectionUUID() *string { + if o == nil { + return nil + } + return o.LibrarySectionUUID +} + +func (o *Metadata) GetRatingKey() *float64 { + if o == nil { + return nil + } + return o.RatingKey +} + +func (o *Metadata) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Metadata) GetGUID() *string { + if o == nil { + return nil + } + return o.GUID +} + +func (o *Metadata) GetStudio() *string { + if o == nil { + return nil + } + return o.Studio +} + +func (o *Metadata) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *Metadata) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Metadata) GetContentRating() *string { + if o == nil { + return nil + } + return o.ContentRating +} + +func (o *Metadata) GetSummary() *string { + if o == nil { + return nil + } + return o.Summary +} + +func (o *Metadata) GetRating() *float64 { + if o == nil { + return nil + } + return o.Rating +} + +func (o *Metadata) GetAudienceRating() *float64 { + if o == nil { + return nil + } + return o.AudienceRating +} + +func (o *Metadata) GetYear() *float64 { + if o == nil { + return nil + } + return o.Year +} + +func (o *Metadata) GetTagline() *string { + if o == nil { + return nil + } + return o.Tagline +} + +func (o *Metadata) GetThumb() *string { + if o == nil { + return nil + } + return o.Thumb +} + +func (o *Metadata) GetArt() *string { + if o == nil { + return nil + } + return o.Art +} + +func (o *Metadata) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *Metadata) GetOriginallyAvailableAt() *time.Time { + if o == nil { + return nil + } + return o.OriginallyAvailableAt +} + +func (o *Metadata) GetAddedAt() *float64 { + if o == nil { + return nil + } + return o.AddedAt +} + +func (o *Metadata) GetUpdatedAt() *float64 { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *Metadata) GetAudienceRatingImage() *string { + if o == nil { + return nil + } + return o.AudienceRatingImage +} + +func (o *Metadata) GetChapterSource() *string { + if o == nil { + return nil + } + return o.ChapterSource +} + +func (o *Metadata) GetPrimaryExtraKey() *string { + if o == nil { + return nil + } + return o.PrimaryExtraKey +} + +func (o *Metadata) GetRatingImage() *string { + if o == nil { + return nil + } + return o.RatingImage +} + +func (o *Metadata) GetMedia() []Media { + if o == nil { + return nil + } + return o.Media +} + +func (o *Metadata) GetGenre() []Genre { + if o == nil { + return nil + } + return o.Genre +} + +func (o *Metadata) GetDirector() []Director { + if o == nil { + return nil + } + return o.Director +} + +func (o *Metadata) GetWriter() []Writer { + if o == nil { + return nil + } + return o.Writer +} + +func (o *Metadata) GetCountry() []Country { + if o == nil { + return nil + } + return o.Country +} + +func (o *Metadata) GetRole() []Role { + if o == nil { + return nil + } + return o.Role +} + +type GetRecentlyAddedMediaContainer struct { + Size *float64 `json:"size,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + Identifier *string `json:"identifier,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *float64 `json:"mediaTagVersion,omitempty"` + MixedParents *bool `json:"mixedParents,omitempty"` + Metadata []Metadata `json:"Metadata,omitempty"` +} + +func (o *GetRecentlyAddedMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetRecentlyAddedMediaContainer) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *GetRecentlyAddedMediaContainer) GetIdentifier() *string { + if o == nil { + return nil + } + return o.Identifier +} + +func (o *GetRecentlyAddedMediaContainer) GetMediaTagPrefix() *string { + if o == nil { + return nil + } + return o.MediaTagPrefix +} + +func (o *GetRecentlyAddedMediaContainer) GetMediaTagVersion() *float64 { + if o == nil { + return nil + } + return o.MediaTagVersion +} + +func (o *GetRecentlyAddedMediaContainer) GetMixedParents() *bool { + if o == nil { + return nil + } + return o.MixedParents +} + +func (o *GetRecentlyAddedMediaContainer) GetMetadata() []Metadata { + if o == nil { + return nil + } + return o.Metadata +} + +// GetRecentlyAddedResponseBody - The recently added content +type GetRecentlyAddedResponseBody struct { + MediaContainer *GetRecentlyAddedMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetRecentlyAddedResponseBody) GetMediaContainer() *GetRecentlyAddedMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetRecentlyAddedResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The recently added content + Object *GetRecentlyAddedResponseBody +} + +func (o *GetRecentlyAddedResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetRecentlyAddedResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetRecentlyAddedResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetRecentlyAddedResponse) GetObject() *GetRecentlyAddedResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getresizedphoto.go b/models/operations/getresizedphoto.go new file mode 100644 index 0000000..d6bbabb --- /dev/null +++ b/models/operations/getresizedphoto.go @@ -0,0 +1,173 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" +) + +// MinSize - images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. +type MinSize int64 + +const ( + MinSizeZero MinSize = 0 + MinSizeOne MinSize = 1 +) + +func (e MinSize) ToPointer() *MinSize { + return &e +} + +func (e *MinSize) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = MinSize(v) + return nil + default: + return fmt.Errorf("invalid value for MinSize: %v", v) + } +} + +// Upscale - allow images to be resized beyond native dimensions. +type Upscale int64 + +const ( + UpscaleZero Upscale = 0 + UpscaleOne Upscale = 1 +) + +func (e Upscale) ToPointer() *Upscale { + return &e +} + +func (e *Upscale) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = Upscale(v) + return nil + default: + return fmt.Errorf("invalid value for Upscale: %v", v) + } +} + +type GetResizedPhotoRequest struct { + // The width for the resized photo + Width float64 `queryParam:"style=form,explode=true,name=width"` + // The height for the resized photo + Height float64 `queryParam:"style=form,explode=true,name=height"` + // The opacity for the resized photo + Opacity int64 `default:"100" queryParam:"style=form,explode=true,name=opacity"` + // The width for the resized photo + Blur float64 `queryParam:"style=form,explode=true,name=blur"` + // images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against. + MinSize MinSize `queryParam:"style=form,explode=true,name=minSize"` + // allow images to be resized beyond native dimensions. + Upscale Upscale `queryParam:"style=form,explode=true,name=upscale"` + // path to image within Plex + URL string `queryParam:"style=form,explode=true,name=url"` +} + +func (g GetResizedPhotoRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetResizedPhotoRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetResizedPhotoRequest) GetWidth() float64 { + if o == nil { + return 0.0 + } + return o.Width +} + +func (o *GetResizedPhotoRequest) GetHeight() float64 { + if o == nil { + return 0.0 + } + return o.Height +} + +func (o *GetResizedPhotoRequest) GetOpacity() int64 { + if o == nil { + return 0 + } + return o.Opacity +} + +func (o *GetResizedPhotoRequest) GetBlur() float64 { + if o == nil { + return 0.0 + } + return o.Blur +} + +func (o *GetResizedPhotoRequest) GetMinSize() MinSize { + if o == nil { + return MinSize(0) + } + return o.MinSize +} + +func (o *GetResizedPhotoRequest) GetUpscale() Upscale { + if o == nil { + return Upscale(0) + } + return o.Upscale +} + +func (o *GetResizedPhotoRequest) GetURL() string { + if o == nil { + return "" + } + return o.URL +} + +type GetResizedPhotoResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetResizedPhotoResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetResizedPhotoResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetResizedPhotoResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getsearchresults.go b/models/operations/getsearchresults.go new file mode 100644 index 0000000..7af3ca8 --- /dev/null +++ b/models/operations/getsearchresults.go @@ -0,0 +1,681 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" + "time" +) + +type GetSearchResultsRequest struct { + // The search query string to use + Query string `queryParam:"style=form,explode=true,name=query"` +} + +func (o *GetSearchResultsRequest) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +type GetSearchResultsPart struct { + ID *float64 `json:"id,omitempty"` + Key *string `json:"key,omitempty"` + Duration *float64 `json:"duration,omitempty"` + File *string `json:"file,omitempty"` + Size *float64 `json:"size,omitempty"` + AudioProfile *string `json:"audioProfile,omitempty"` + Container *string `json:"container,omitempty"` + VideoProfile *string `json:"videoProfile,omitempty"` +} + +func (o *GetSearchResultsPart) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *GetSearchResultsPart) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetSearchResultsPart) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *GetSearchResultsPart) GetFile() *string { + if o == nil { + return nil + } + return o.File +} + +func (o *GetSearchResultsPart) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetSearchResultsPart) GetAudioProfile() *string { + if o == nil { + return nil + } + return o.AudioProfile +} + +func (o *GetSearchResultsPart) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *GetSearchResultsPart) GetVideoProfile() *string { + if o == nil { + return nil + } + return o.VideoProfile +} + +type GetSearchResultsMedia struct { + ID *float64 `json:"id,omitempty"` + Duration *float64 `json:"duration,omitempty"` + Bitrate *float64 `json:"bitrate,omitempty"` + Width *float64 `json:"width,omitempty"` + Height *float64 `json:"height,omitempty"` + AspectRatio *float64 `json:"aspectRatio,omitempty"` + AudioChannels *float64 `json:"audioChannels,omitempty"` + AudioCodec *string `json:"audioCodec,omitempty"` + VideoCodec *string `json:"videoCodec,omitempty"` + VideoResolution *float64 `json:"videoResolution,omitempty"` + Container *string `json:"container,omitempty"` + VideoFrameRate *string `json:"videoFrameRate,omitempty"` + AudioProfile *string `json:"audioProfile,omitempty"` + VideoProfile *string `json:"videoProfile,omitempty"` + Part []GetSearchResultsPart `json:"Part,omitempty"` +} + +func (o *GetSearchResultsMedia) GetID() *float64 { + if o == nil { + return nil + } + return o.ID +} + +func (o *GetSearchResultsMedia) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *GetSearchResultsMedia) GetBitrate() *float64 { + if o == nil { + return nil + } + return o.Bitrate +} + +func (o *GetSearchResultsMedia) GetWidth() *float64 { + if o == nil { + return nil + } + return o.Width +} + +func (o *GetSearchResultsMedia) GetHeight() *float64 { + if o == nil { + return nil + } + return o.Height +} + +func (o *GetSearchResultsMedia) GetAspectRatio() *float64 { + if o == nil { + return nil + } + return o.AspectRatio +} + +func (o *GetSearchResultsMedia) GetAudioChannels() *float64 { + if o == nil { + return nil + } + return o.AudioChannels +} + +func (o *GetSearchResultsMedia) GetAudioCodec() *string { + if o == nil { + return nil + } + return o.AudioCodec +} + +func (o *GetSearchResultsMedia) GetVideoCodec() *string { + if o == nil { + return nil + } + return o.VideoCodec +} + +func (o *GetSearchResultsMedia) GetVideoResolution() *float64 { + if o == nil { + return nil + } + return o.VideoResolution +} + +func (o *GetSearchResultsMedia) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *GetSearchResultsMedia) GetVideoFrameRate() *string { + if o == nil { + return nil + } + return o.VideoFrameRate +} + +func (o *GetSearchResultsMedia) GetAudioProfile() *string { + if o == nil { + return nil + } + return o.AudioProfile +} + +func (o *GetSearchResultsMedia) GetVideoProfile() *string { + if o == nil { + return nil + } + return o.VideoProfile +} + +func (o *GetSearchResultsMedia) GetPart() []GetSearchResultsPart { + if o == nil { + return nil + } + return o.Part +} + +type GetSearchResultsGenre struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *GetSearchResultsGenre) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type GetSearchResultsDirector struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *GetSearchResultsDirector) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type GetSearchResultsWriter struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *GetSearchResultsWriter) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type GetSearchResultsCountry struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *GetSearchResultsCountry) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type GetSearchResultsRole struct { + Tag *string `json:"tag,omitempty"` +} + +func (o *GetSearchResultsRole) GetTag() *string { + if o == nil { + return nil + } + return o.Tag +} + +type GetSearchResultsMetadata struct { + AllowSync *bool `json:"allowSync,omitempty"` + LibrarySectionID *float64 `json:"librarySectionID,omitempty"` + LibrarySectionTitle *string `json:"librarySectionTitle,omitempty"` + LibrarySectionUUID *string `json:"librarySectionUUID,omitempty"` + Personal *bool `json:"personal,omitempty"` + SourceTitle *string `json:"sourceTitle,omitempty"` + RatingKey *float64 `json:"ratingKey,omitempty"` + Key *string `json:"key,omitempty"` + GUID *string `json:"guid,omitempty"` + Studio *string `json:"studio,omitempty"` + Type *string `json:"type,omitempty"` + Title *string `json:"title,omitempty"` + ContentRating *string `json:"contentRating,omitempty"` + Summary *string `json:"summary,omitempty"` + Rating *float64 `json:"rating,omitempty"` + AudienceRating *float64 `json:"audienceRating,omitempty"` + Year *float64 `json:"year,omitempty"` + Tagline *string `json:"tagline,omitempty"` + Thumb *string `json:"thumb,omitempty"` + Art *string `json:"art,omitempty"` + Duration *float64 `json:"duration,omitempty"` + OriginallyAvailableAt *time.Time `json:"originallyAvailableAt,omitempty"` + AddedAt *float64 `json:"addedAt,omitempty"` + UpdatedAt *float64 `json:"updatedAt,omitempty"` + AudienceRatingImage *string `json:"audienceRatingImage,omitempty"` + ChapterSource *string `json:"chapterSource,omitempty"` + PrimaryExtraKey *string `json:"primaryExtraKey,omitempty"` + RatingImage *string `json:"ratingImage,omitempty"` + Media []GetSearchResultsMedia `json:"Media,omitempty"` + Genre []GetSearchResultsGenre `json:"Genre,omitempty"` + Director []GetSearchResultsDirector `json:"Director,omitempty"` + Writer []GetSearchResultsWriter `json:"Writer,omitempty"` + Country []GetSearchResultsCountry `json:"Country,omitempty"` + Role []GetSearchResultsRole `json:"Role,omitempty"` +} + +func (g GetSearchResultsMetadata) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(g, "", false) +} + +func (g *GetSearchResultsMetadata) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &g, "", false, false); err != nil { + return err + } + return nil +} + +func (o *GetSearchResultsMetadata) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *GetSearchResultsMetadata) GetLibrarySectionID() *float64 { + if o == nil { + return nil + } + return o.LibrarySectionID +} + +func (o *GetSearchResultsMetadata) GetLibrarySectionTitle() *string { + if o == nil { + return nil + } + return o.LibrarySectionTitle +} + +func (o *GetSearchResultsMetadata) GetLibrarySectionUUID() *string { + if o == nil { + return nil + } + return o.LibrarySectionUUID +} + +func (o *GetSearchResultsMetadata) GetPersonal() *bool { + if o == nil { + return nil + } + return o.Personal +} + +func (o *GetSearchResultsMetadata) GetSourceTitle() *string { + if o == nil { + return nil + } + return o.SourceTitle +} + +func (o *GetSearchResultsMetadata) GetRatingKey() *float64 { + if o == nil { + return nil + } + return o.RatingKey +} + +func (o *GetSearchResultsMetadata) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *GetSearchResultsMetadata) GetGUID() *string { + if o == nil { + return nil + } + return o.GUID +} + +func (o *GetSearchResultsMetadata) GetStudio() *string { + if o == nil { + return nil + } + return o.Studio +} + +func (o *GetSearchResultsMetadata) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *GetSearchResultsMetadata) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *GetSearchResultsMetadata) GetContentRating() *string { + if o == nil { + return nil + } + return o.ContentRating +} + +func (o *GetSearchResultsMetadata) GetSummary() *string { + if o == nil { + return nil + } + return o.Summary +} + +func (o *GetSearchResultsMetadata) GetRating() *float64 { + if o == nil { + return nil + } + return o.Rating +} + +func (o *GetSearchResultsMetadata) GetAudienceRating() *float64 { + if o == nil { + return nil + } + return o.AudienceRating +} + +func (o *GetSearchResultsMetadata) GetYear() *float64 { + if o == nil { + return nil + } + return o.Year +} + +func (o *GetSearchResultsMetadata) GetTagline() *string { + if o == nil { + return nil + } + return o.Tagline +} + +func (o *GetSearchResultsMetadata) GetThumb() *string { + if o == nil { + return nil + } + return o.Thumb +} + +func (o *GetSearchResultsMetadata) GetArt() *string { + if o == nil { + return nil + } + return o.Art +} + +func (o *GetSearchResultsMetadata) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *GetSearchResultsMetadata) GetOriginallyAvailableAt() *time.Time { + if o == nil { + return nil + } + return o.OriginallyAvailableAt +} + +func (o *GetSearchResultsMetadata) GetAddedAt() *float64 { + if o == nil { + return nil + } + return o.AddedAt +} + +func (o *GetSearchResultsMetadata) GetUpdatedAt() *float64 { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *GetSearchResultsMetadata) GetAudienceRatingImage() *string { + if o == nil { + return nil + } + return o.AudienceRatingImage +} + +func (o *GetSearchResultsMetadata) GetChapterSource() *string { + if o == nil { + return nil + } + return o.ChapterSource +} + +func (o *GetSearchResultsMetadata) GetPrimaryExtraKey() *string { + if o == nil { + return nil + } + return o.PrimaryExtraKey +} + +func (o *GetSearchResultsMetadata) GetRatingImage() *string { + if o == nil { + return nil + } + return o.RatingImage +} + +func (o *GetSearchResultsMetadata) GetMedia() []GetSearchResultsMedia { + if o == nil { + return nil + } + return o.Media +} + +func (o *GetSearchResultsMetadata) GetGenre() []GetSearchResultsGenre { + if o == nil { + return nil + } + return o.Genre +} + +func (o *GetSearchResultsMetadata) GetDirector() []GetSearchResultsDirector { + if o == nil { + return nil + } + return o.Director +} + +func (o *GetSearchResultsMetadata) GetWriter() []GetSearchResultsWriter { + if o == nil { + return nil + } + return o.Writer +} + +func (o *GetSearchResultsMetadata) GetCountry() []GetSearchResultsCountry { + if o == nil { + return nil + } + return o.Country +} + +func (o *GetSearchResultsMetadata) GetRole() []GetSearchResultsRole { + if o == nil { + return nil + } + return o.Role +} + +type Provider struct { + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *Provider) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Provider) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Provider) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +type GetSearchResultsMediaContainer struct { + Size *float64 `json:"size,omitempty"` + Identifier *string `json:"identifier,omitempty"` + MediaTagPrefix *string `json:"mediaTagPrefix,omitempty"` + MediaTagVersion *float64 `json:"mediaTagVersion,omitempty"` + Metadata []GetSearchResultsMetadata `json:"Metadata,omitempty"` + Provider []Provider `json:"Provider,omitempty"` +} + +func (o *GetSearchResultsMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetSearchResultsMediaContainer) GetIdentifier() *string { + if o == nil { + return nil + } + return o.Identifier +} + +func (o *GetSearchResultsMediaContainer) GetMediaTagPrefix() *string { + if o == nil { + return nil + } + return o.MediaTagPrefix +} + +func (o *GetSearchResultsMediaContainer) GetMediaTagVersion() *float64 { + if o == nil { + return nil + } + return o.MediaTagVersion +} + +func (o *GetSearchResultsMediaContainer) GetMetadata() []GetSearchResultsMetadata { + if o == nil { + return nil + } + return o.Metadata +} + +func (o *GetSearchResultsMediaContainer) GetProvider() []Provider { + if o == nil { + return nil + } + return o.Provider +} + +// GetSearchResultsResponseBody - Search Results +type GetSearchResultsResponseBody struct { + MediaContainer *GetSearchResultsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetSearchResultsResponseBody) GetMediaContainer() *GetSearchResultsMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetSearchResultsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // Search Results + Object *GetSearchResultsResponseBody +} + +func (o *GetSearchResultsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetSearchResultsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetSearchResultsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetSearchResultsResponse) GetObject() *GetSearchResultsResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getserveractivities.go b/models/operations/getserveractivities.go new file mode 100644 index 0000000..f6f1334 --- /dev/null +++ b/models/operations/getserveractivities.go @@ -0,0 +1,155 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type Context struct { + LibrarySectionID *string `json:"librarySectionID,omitempty"` +} + +func (o *Context) GetLibrarySectionID() *string { + if o == nil { + return nil + } + return o.LibrarySectionID +} + +type Activity struct { + UUID *string `json:"uuid,omitempty"` + Type *string `json:"type,omitempty"` + Cancellable *bool `json:"cancellable,omitempty"` + UserID *float64 `json:"userID,omitempty"` + Title *string `json:"title,omitempty"` + Subtitle *string `json:"subtitle,omitempty"` + Progress *float64 `json:"progress,omitempty"` + Context *Context `json:"Context,omitempty"` +} + +func (o *Activity) GetUUID() *string { + if o == nil { + return nil + } + return o.UUID +} + +func (o *Activity) GetType() *string { + if o == nil { + return nil + } + return o.Type +} + +func (o *Activity) GetCancellable() *bool { + if o == nil { + return nil + } + return o.Cancellable +} + +func (o *Activity) GetUserID() *float64 { + if o == nil { + return nil + } + return o.UserID +} + +func (o *Activity) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +func (o *Activity) GetSubtitle() *string { + if o == nil { + return nil + } + return o.Subtitle +} + +func (o *Activity) GetProgress() *float64 { + if o == nil { + return nil + } + return o.Progress +} + +func (o *Activity) GetContext() *Context { + if o == nil { + return nil + } + return o.Context +} + +type GetServerActivitiesMediaContainer struct { + Size *float64 `json:"size,omitempty"` + Activity []Activity `json:"Activity,omitempty"` +} + +func (o *GetServerActivitiesMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetServerActivitiesMediaContainer) GetActivity() []Activity { + if o == nil { + return nil + } + return o.Activity +} + +// GetServerActivitiesResponseBody - The Server Activities +type GetServerActivitiesResponseBody struct { + MediaContainer *GetServerActivitiesMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetServerActivitiesResponseBody) GetMediaContainer() *GetServerActivitiesMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetServerActivitiesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The Server Activities + Object *GetServerActivitiesResponseBody +} + +func (o *GetServerActivitiesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetServerActivitiesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetServerActivitiesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetServerActivitiesResponse) GetObject() *GetServerActivitiesResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getservercapabilities.go b/models/operations/getservercapabilities.go new file mode 100644 index 0000000..8b724c4 --- /dev/null +++ b/models/operations/getservercapabilities.go @@ -0,0 +1,496 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type Directory struct { + Count *float64 `json:"count,omitempty"` + Key *string `json:"key,omitempty"` + Title *string `json:"title,omitempty"` +} + +func (o *Directory) GetCount() *float64 { + if o == nil { + return nil + } + return o.Count +} + +func (o *Directory) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *Directory) GetTitle() *string { + if o == nil { + return nil + } + return o.Title +} + +type MediaContainer struct { + Size *float64 `json:"size,omitempty"` + AllowCameraUpload *bool `json:"allowCameraUpload,omitempty"` + AllowChannelAccess *bool `json:"allowChannelAccess,omitempty"` + AllowMediaDeletion *bool `json:"allowMediaDeletion,omitempty"` + AllowSharing *bool `json:"allowSharing,omitempty"` + AllowSync *bool `json:"allowSync,omitempty"` + AllowTuners *bool `json:"allowTuners,omitempty"` + BackgroundProcessing *bool `json:"backgroundProcessing,omitempty"` + Certificate *bool `json:"certificate,omitempty"` + CompanionProxy *bool `json:"companionProxy,omitempty"` + CountryCode *string `json:"countryCode,omitempty"` + Diagnostics *string `json:"diagnostics,omitempty"` + EventStream *bool `json:"eventStream,omitempty"` + FriendlyName *string `json:"friendlyName,omitempty"` + HubSearch *bool `json:"hubSearch,omitempty"` + ItemClusters *bool `json:"itemClusters,omitempty"` + Livetv *float64 `json:"livetv,omitempty"` + MachineIdentifier *string `json:"machineIdentifier,omitempty"` + MediaProviders *bool `json:"mediaProviders,omitempty"` + Multiuser *bool `json:"multiuser,omitempty"` + MusicAnalysis *float64 `json:"musicAnalysis,omitempty"` + MyPlex *bool `json:"myPlex,omitempty"` + MyPlexMappingState *string `json:"myPlexMappingState,omitempty"` + MyPlexSigninState *string `json:"myPlexSigninState,omitempty"` + MyPlexSubscription *bool `json:"myPlexSubscription,omitempty"` + MyPlexUsername *string `json:"myPlexUsername,omitempty"` + OfflineTranscode *float64 `json:"offlineTranscode,omitempty"` + OwnerFeatures *string `json:"ownerFeatures,omitempty"` + PhotoAutoTag *bool `json:"photoAutoTag,omitempty"` + Platform *string `json:"platform,omitempty"` + PlatformVersion *string `json:"platformVersion,omitempty"` + PluginHost *bool `json:"pluginHost,omitempty"` + PushNotifications *bool `json:"pushNotifications,omitempty"` + ReadOnlyLibraries *bool `json:"readOnlyLibraries,omitempty"` + StreamingBrainABRVersion *float64 `json:"streamingBrainABRVersion,omitempty"` + StreamingBrainVersion *float64 `json:"streamingBrainVersion,omitempty"` + Sync *bool `json:"sync,omitempty"` + TranscoderActiveVideoSessions *float64 `json:"transcoderActiveVideoSessions,omitempty"` + TranscoderAudio *bool `json:"transcoderAudio,omitempty"` + TranscoderLyrics *bool `json:"transcoderLyrics,omitempty"` + TranscoderPhoto *bool `json:"transcoderPhoto,omitempty"` + TranscoderSubtitles *bool `json:"transcoderSubtitles,omitempty"` + TranscoderVideo *bool `json:"transcoderVideo,omitempty"` + TranscoderVideoBitrates *string `json:"transcoderVideoBitrates,omitempty"` + TranscoderVideoQualities *string `json:"transcoderVideoQualities,omitempty"` + TranscoderVideoResolutions *string `json:"transcoderVideoResolutions,omitempty"` + UpdatedAt *float64 `json:"updatedAt,omitempty"` + Updater *bool `json:"updater,omitempty"` + Version *string `json:"version,omitempty"` + VoiceSearch *bool `json:"voiceSearch,omitempty"` + Directory []Directory `json:"Directory,omitempty"` +} + +func (o *MediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *MediaContainer) GetAllowCameraUpload() *bool { + if o == nil { + return nil + } + return o.AllowCameraUpload +} + +func (o *MediaContainer) GetAllowChannelAccess() *bool { + if o == nil { + return nil + } + return o.AllowChannelAccess +} + +func (o *MediaContainer) GetAllowMediaDeletion() *bool { + if o == nil { + return nil + } + return o.AllowMediaDeletion +} + +func (o *MediaContainer) GetAllowSharing() *bool { + if o == nil { + return nil + } + return o.AllowSharing +} + +func (o *MediaContainer) GetAllowSync() *bool { + if o == nil { + return nil + } + return o.AllowSync +} + +func (o *MediaContainer) GetAllowTuners() *bool { + if o == nil { + return nil + } + return o.AllowTuners +} + +func (o *MediaContainer) GetBackgroundProcessing() *bool { + if o == nil { + return nil + } + return o.BackgroundProcessing +} + +func (o *MediaContainer) GetCertificate() *bool { + if o == nil { + return nil + } + return o.Certificate +} + +func (o *MediaContainer) GetCompanionProxy() *bool { + if o == nil { + return nil + } + return o.CompanionProxy +} + +func (o *MediaContainer) GetCountryCode() *string { + if o == nil { + return nil + } + return o.CountryCode +} + +func (o *MediaContainer) GetDiagnostics() *string { + if o == nil { + return nil + } + return o.Diagnostics +} + +func (o *MediaContainer) GetEventStream() *bool { + if o == nil { + return nil + } + return o.EventStream +} + +func (o *MediaContainer) GetFriendlyName() *string { + if o == nil { + return nil + } + return o.FriendlyName +} + +func (o *MediaContainer) GetHubSearch() *bool { + if o == nil { + return nil + } + return o.HubSearch +} + +func (o *MediaContainer) GetItemClusters() *bool { + if o == nil { + return nil + } + return o.ItemClusters +} + +func (o *MediaContainer) GetLivetv() *float64 { + if o == nil { + return nil + } + return o.Livetv +} + +func (o *MediaContainer) GetMachineIdentifier() *string { + if o == nil { + return nil + } + return o.MachineIdentifier +} + +func (o *MediaContainer) GetMediaProviders() *bool { + if o == nil { + return nil + } + return o.MediaProviders +} + +func (o *MediaContainer) GetMultiuser() *bool { + if o == nil { + return nil + } + return o.Multiuser +} + +func (o *MediaContainer) GetMusicAnalysis() *float64 { + if o == nil { + return nil + } + return o.MusicAnalysis +} + +func (o *MediaContainer) GetMyPlex() *bool { + if o == nil { + return nil + } + return o.MyPlex +} + +func (o *MediaContainer) GetMyPlexMappingState() *string { + if o == nil { + return nil + } + return o.MyPlexMappingState +} + +func (o *MediaContainer) GetMyPlexSigninState() *string { + if o == nil { + return nil + } + return o.MyPlexSigninState +} + +func (o *MediaContainer) GetMyPlexSubscription() *bool { + if o == nil { + return nil + } + return o.MyPlexSubscription +} + +func (o *MediaContainer) GetMyPlexUsername() *string { + if o == nil { + return nil + } + return o.MyPlexUsername +} + +func (o *MediaContainer) GetOfflineTranscode() *float64 { + if o == nil { + return nil + } + return o.OfflineTranscode +} + +func (o *MediaContainer) GetOwnerFeatures() *string { + if o == nil { + return nil + } + return o.OwnerFeatures +} + +func (o *MediaContainer) GetPhotoAutoTag() *bool { + if o == nil { + return nil + } + return o.PhotoAutoTag +} + +func (o *MediaContainer) GetPlatform() *string { + if o == nil { + return nil + } + return o.Platform +} + +func (o *MediaContainer) GetPlatformVersion() *string { + if o == nil { + return nil + } + return o.PlatformVersion +} + +func (o *MediaContainer) GetPluginHost() *bool { + if o == nil { + return nil + } + return o.PluginHost +} + +func (o *MediaContainer) GetPushNotifications() *bool { + if o == nil { + return nil + } + return o.PushNotifications +} + +func (o *MediaContainer) GetReadOnlyLibraries() *bool { + if o == nil { + return nil + } + return o.ReadOnlyLibraries +} + +func (o *MediaContainer) GetStreamingBrainABRVersion() *float64 { + if o == nil { + return nil + } + return o.StreamingBrainABRVersion +} + +func (o *MediaContainer) GetStreamingBrainVersion() *float64 { + if o == nil { + return nil + } + return o.StreamingBrainVersion +} + +func (o *MediaContainer) GetSync() *bool { + if o == nil { + return nil + } + return o.Sync +} + +func (o *MediaContainer) GetTranscoderActiveVideoSessions() *float64 { + if o == nil { + return nil + } + return o.TranscoderActiveVideoSessions +} + +func (o *MediaContainer) GetTranscoderAudio() *bool { + if o == nil { + return nil + } + return o.TranscoderAudio +} + +func (o *MediaContainer) GetTranscoderLyrics() *bool { + if o == nil { + return nil + } + return o.TranscoderLyrics +} + +func (o *MediaContainer) GetTranscoderPhoto() *bool { + if o == nil { + return nil + } + return o.TranscoderPhoto +} + +func (o *MediaContainer) GetTranscoderSubtitles() *bool { + if o == nil { + return nil + } + return o.TranscoderSubtitles +} + +func (o *MediaContainer) GetTranscoderVideo() *bool { + if o == nil { + return nil + } + return o.TranscoderVideo +} + +func (o *MediaContainer) GetTranscoderVideoBitrates() *string { + if o == nil { + return nil + } + return o.TranscoderVideoBitrates +} + +func (o *MediaContainer) GetTranscoderVideoQualities() *string { + if o == nil { + return nil + } + return o.TranscoderVideoQualities +} + +func (o *MediaContainer) GetTranscoderVideoResolutions() *string { + if o == nil { + return nil + } + return o.TranscoderVideoResolutions +} + +func (o *MediaContainer) GetUpdatedAt() *float64 { + if o == nil { + return nil + } + return o.UpdatedAt +} + +func (o *MediaContainer) GetUpdater() *bool { + if o == nil { + return nil + } + return o.Updater +} + +func (o *MediaContainer) GetVersion() *string { + if o == nil { + return nil + } + return o.Version +} + +func (o *MediaContainer) GetVoiceSearch() *bool { + if o == nil { + return nil + } + return o.VoiceSearch +} + +func (o *MediaContainer) GetDirectory() []Directory { + if o == nil { + return nil + } + return o.Directory +} + +// GetServerCapabilitiesResponseBody - The Server Capabilities +type GetServerCapabilitiesResponseBody struct { + MediaContainer *MediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetServerCapabilitiesResponseBody) GetMediaContainer() *MediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetServerCapabilitiesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The Server Capabilities + Object *GetServerCapabilitiesResponseBody +} + +func (o *GetServerCapabilitiesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetServerCapabilitiesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetServerCapabilitiesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetServerCapabilitiesResponse) GetObject() *GetServerCapabilitiesResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getserveridentity.go b/models/operations/getserveridentity.go new file mode 100644 index 0000000..76549ae --- /dev/null +++ b/models/operations/getserveridentity.go @@ -0,0 +1,93 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetServerIdentityMediaContainer struct { + Size *float64 `json:"size,omitempty"` + Claimed *bool `json:"claimed,omitempty"` + MachineIdentifier *string `json:"machineIdentifier,omitempty"` + Version *string `json:"version,omitempty"` +} + +func (o *GetServerIdentityMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetServerIdentityMediaContainer) GetClaimed() *bool { + if o == nil { + return nil + } + return o.Claimed +} + +func (o *GetServerIdentityMediaContainer) GetMachineIdentifier() *string { + if o == nil { + return nil + } + return o.MachineIdentifier +} + +func (o *GetServerIdentityMediaContainer) GetVersion() *string { + if o == nil { + return nil + } + return o.Version +} + +// GetServerIdentityResponseBody - The Transcode Sessions +type GetServerIdentityResponseBody struct { + MediaContainer *GetServerIdentityMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetServerIdentityResponseBody) GetMediaContainer() *GetServerIdentityMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetServerIdentityResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The Transcode Sessions + Object *GetServerIdentityResponseBody +} + +func (o *GetServerIdentityResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetServerIdentityResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetServerIdentityResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetServerIdentityResponse) GetObject() *GetServerIdentityResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getserverlist.go b/models/operations/getserverlist.go new file mode 100644 index 0000000..4ca69b8 --- /dev/null +++ b/models/operations/getserverlist.go @@ -0,0 +1,128 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetServerListServer struct { + Name *string `json:"name,omitempty"` + Host *string `json:"host,omitempty"` + Address *string `json:"address,omitempty"` + Port *float64 `json:"port,omitempty"` + MachineIdentifier *string `json:"machineIdentifier,omitempty"` + Version *string `json:"version,omitempty"` +} + +func (o *GetServerListServer) GetName() *string { + if o == nil { + return nil + } + return o.Name +} + +func (o *GetServerListServer) GetHost() *string { + if o == nil { + return nil + } + return o.Host +} + +func (o *GetServerListServer) GetAddress() *string { + if o == nil { + return nil + } + return o.Address +} + +func (o *GetServerListServer) GetPort() *float64 { + if o == nil { + return nil + } + return o.Port +} + +func (o *GetServerListServer) GetMachineIdentifier() *string { + if o == nil { + return nil + } + return o.MachineIdentifier +} + +func (o *GetServerListServer) GetVersion() *string { + if o == nil { + return nil + } + return o.Version +} + +type GetServerListMediaContainer struct { + Size *float64 `json:"size,omitempty"` + Server []GetServerListServer `json:"Server,omitempty"` +} + +func (o *GetServerListMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetServerListMediaContainer) GetServer() []GetServerListServer { + if o == nil { + return nil + } + return o.Server +} + +// GetServerListResponseBody - List of Servers +type GetServerListResponseBody struct { + MediaContainer *GetServerListMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetServerListResponseBody) GetMediaContainer() *GetServerListMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetServerListResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // List of Servers + Object *GetServerListResponseBody +} + +func (o *GetServerListResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetServerListResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetServerListResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetServerListResponse) GetObject() *GetServerListResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/getserverpreferences.go b/models/operations/getserverpreferences.go new file mode 100644 index 0000000..1d0ded7 --- /dev/null +++ b/models/operations/getserverpreferences.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetServerPreferencesResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetServerPreferencesResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetServerPreferencesResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetServerPreferencesResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getsessionhistory.go b/models/operations/getsessionhistory.go new file mode 100644 index 0000000..cda8fd1 --- /dev/null +++ b/models/operations/getsessionhistory.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetSessionHistoryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetSessionHistoryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetSessionHistoryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetSessionHistoryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getsessions.go b/models/operations/getsessions.go new file mode 100644 index 0000000..23d7834 --- /dev/null +++ b/models/operations/getsessions.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetSessionsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetSessionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetSessionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetSessionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getsourceconnectioninformation.go b/models/operations/getsourceconnectioninformation.go new file mode 100644 index 0000000..d84897f --- /dev/null +++ b/models/operations/getsourceconnectioninformation.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetSourceConnectionInformationRequest struct { + // The source identifier with an included prefix. + Source string `queryParam:"style=form,explode=true,name=source"` +} + +func (o *GetSourceConnectionInformationRequest) GetSource() string { + if o == nil { + return "" + } + return o.Source +} + +type GetSourceConnectionInformationResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetSourceConnectionInformationResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetSourceConnectionInformationResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetSourceConnectionInformationResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/gettimeline.go b/models/operations/gettimeline.go new file mode 100644 index 0000000..81391e0 --- /dev/null +++ b/models/operations/gettimeline.go @@ -0,0 +1,163 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// State - The state of the media item +type State string + +const ( + StatePlaying State = "playing" + StatePaused State = "paused" + StateStopped State = "stopped" +) + +func (e State) ToPointer() *State { + return &e +} + +func (e *State) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "playing": + fallthrough + case "paused": + fallthrough + case "stopped": + *e = State(v) + return nil + default: + return fmt.Errorf("invalid value for State: %v", v) + } +} + +type GetTimelineRequest struct { + // The rating key of the media item + RatingKey float64 `queryParam:"style=form,explode=true,name=ratingKey"` + // The key of the media item to get the timeline for + Key string `queryParam:"style=form,explode=true,name=key"` + // The state of the media item + State State `queryParam:"style=form,explode=true,name=state"` + // Whether the media item has MDE + HasMDE float64 `queryParam:"style=form,explode=true,name=hasMDE"` + // The time of the media item + Time float64 `queryParam:"style=form,explode=true,name=time"` + // The duration of the media item + Duration float64 `queryParam:"style=form,explode=true,name=duration"` + // The context of the media item + Context string `queryParam:"style=form,explode=true,name=context"` + // The play queue item ID of the media item + PlayQueueItemID float64 `queryParam:"style=form,explode=true,name=playQueueItemID"` + // The playback time of the media item + PlayBackTime float64 `queryParam:"style=form,explode=true,name=playBackTime"` + // The row of the media item + Row float64 `queryParam:"style=form,explode=true,name=row"` +} + +func (o *GetTimelineRequest) GetRatingKey() float64 { + if o == nil { + return 0.0 + } + return o.RatingKey +} + +func (o *GetTimelineRequest) GetKey() string { + if o == nil { + return "" + } + return o.Key +} + +func (o *GetTimelineRequest) GetState() State { + if o == nil { + return State("") + } + return o.State +} + +func (o *GetTimelineRequest) GetHasMDE() float64 { + if o == nil { + return 0.0 + } + return o.HasMDE +} + +func (o *GetTimelineRequest) GetTime() float64 { + if o == nil { + return 0.0 + } + return o.Time +} + +func (o *GetTimelineRequest) GetDuration() float64 { + if o == nil { + return 0.0 + } + return o.Duration +} + +func (o *GetTimelineRequest) GetContext() string { + if o == nil { + return "" + } + return o.Context +} + +func (o *GetTimelineRequest) GetPlayQueueItemID() float64 { + if o == nil { + return 0.0 + } + return o.PlayQueueItemID +} + +func (o *GetTimelineRequest) GetPlayBackTime() float64 { + if o == nil { + return 0.0 + } + return o.PlayBackTime +} + +func (o *GetTimelineRequest) GetRow() float64 { + if o == nil { + return 0.0 + } + return o.Row +} + +type GetTimelineResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetTimelineResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetTimelineResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetTimelineResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/gettranscodesessions.go b/models/operations/gettranscodesessions.go new file mode 100644 index 0000000..873cc60 --- /dev/null +++ b/models/operations/gettranscodesessions.go @@ -0,0 +1,256 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type TranscodeSession struct { + Key *string `json:"key,omitempty"` + Throttled *bool `json:"throttled,omitempty"` + Complete *bool `json:"complete,omitempty"` + Progress *float64 `json:"progress,omitempty"` + Size *float64 `json:"size,omitempty"` + Speed *float64 `json:"speed,omitempty"` + Error *bool `json:"error,omitempty"` + Duration *float64 `json:"duration,omitempty"` + Context *string `json:"context,omitempty"` + SourceVideoCodec *string `json:"sourceVideoCodec,omitempty"` + SourceAudioCodec *string `json:"sourceAudioCodec,omitempty"` + VideoDecision *string `json:"videoDecision,omitempty"` + AudioDecision *string `json:"audioDecision,omitempty"` + Protocol *string `json:"protocol,omitempty"` + Container *string `json:"container,omitempty"` + VideoCodec *string `json:"videoCodec,omitempty"` + AudioCodec *string `json:"audioCodec,omitempty"` + AudioChannels *float64 `json:"audioChannels,omitempty"` + TranscodeHwRequested *bool `json:"transcodeHwRequested,omitempty"` + TimeStamp *float64 `json:"timeStamp,omitempty"` + MaxOffsetAvailable *float64 `json:"maxOffsetAvailable,omitempty"` + MinOffsetAvailable *float64 `json:"minOffsetAvailable,omitempty"` +} + +func (o *TranscodeSession) GetKey() *string { + if o == nil { + return nil + } + return o.Key +} + +func (o *TranscodeSession) GetThrottled() *bool { + if o == nil { + return nil + } + return o.Throttled +} + +func (o *TranscodeSession) GetComplete() *bool { + if o == nil { + return nil + } + return o.Complete +} + +func (o *TranscodeSession) GetProgress() *float64 { + if o == nil { + return nil + } + return o.Progress +} + +func (o *TranscodeSession) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *TranscodeSession) GetSpeed() *float64 { + if o == nil { + return nil + } + return o.Speed +} + +func (o *TranscodeSession) GetError() *bool { + if o == nil { + return nil + } + return o.Error +} + +func (o *TranscodeSession) GetDuration() *float64 { + if o == nil { + return nil + } + return o.Duration +} + +func (o *TranscodeSession) GetContext() *string { + if o == nil { + return nil + } + return o.Context +} + +func (o *TranscodeSession) GetSourceVideoCodec() *string { + if o == nil { + return nil + } + return o.SourceVideoCodec +} + +func (o *TranscodeSession) GetSourceAudioCodec() *string { + if o == nil { + return nil + } + return o.SourceAudioCodec +} + +func (o *TranscodeSession) GetVideoDecision() *string { + if o == nil { + return nil + } + return o.VideoDecision +} + +func (o *TranscodeSession) GetAudioDecision() *string { + if o == nil { + return nil + } + return o.AudioDecision +} + +func (o *TranscodeSession) GetProtocol() *string { + if o == nil { + return nil + } + return o.Protocol +} + +func (o *TranscodeSession) GetContainer() *string { + if o == nil { + return nil + } + return o.Container +} + +func (o *TranscodeSession) GetVideoCodec() *string { + if o == nil { + return nil + } + return o.VideoCodec +} + +func (o *TranscodeSession) GetAudioCodec() *string { + if o == nil { + return nil + } + return o.AudioCodec +} + +func (o *TranscodeSession) GetAudioChannels() *float64 { + if o == nil { + return nil + } + return o.AudioChannels +} + +func (o *TranscodeSession) GetTranscodeHwRequested() *bool { + if o == nil { + return nil + } + return o.TranscodeHwRequested +} + +func (o *TranscodeSession) GetTimeStamp() *float64 { + if o == nil { + return nil + } + return o.TimeStamp +} + +func (o *TranscodeSession) GetMaxOffsetAvailable() *float64 { + if o == nil { + return nil + } + return o.MaxOffsetAvailable +} + +func (o *TranscodeSession) GetMinOffsetAvailable() *float64 { + if o == nil { + return nil + } + return o.MinOffsetAvailable +} + +type GetTranscodeSessionsMediaContainer struct { + Size *float64 `json:"size,omitempty"` + TranscodeSession []TranscodeSession `json:"TranscodeSession,omitempty"` +} + +func (o *GetTranscodeSessionsMediaContainer) GetSize() *float64 { + if o == nil { + return nil + } + return o.Size +} + +func (o *GetTranscodeSessionsMediaContainer) GetTranscodeSession() []TranscodeSession { + if o == nil { + return nil + } + return o.TranscodeSession +} + +// GetTranscodeSessionsResponseBody - The Transcode Sessions +type GetTranscodeSessionsResponseBody struct { + MediaContainer *GetTranscodeSessionsMediaContainer `json:"MediaContainer,omitempty"` +} + +func (o *GetTranscodeSessionsResponseBody) GetMediaContainer() *GetTranscodeSessionsMediaContainer { + if o == nil { + return nil + } + return o.MediaContainer +} + +type GetTranscodeSessionsResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response + // The Transcode Sessions + Object *GetTranscodeSessionsResponseBody +} + +func (o *GetTranscodeSessionsResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetTranscodeSessionsResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetTranscodeSessionsResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} + +func (o *GetTranscodeSessionsResponse) GetObject() *GetTranscodeSessionsResponseBody { + if o == nil { + return nil + } + return o.Object +} diff --git a/models/operations/gettransienttoken.go b/models/operations/gettransienttoken.go new file mode 100644 index 0000000..03d2843 --- /dev/null +++ b/models/operations/gettransienttoken.go @@ -0,0 +1,110 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// QueryParamType - `delegation` - This is the only supported `type` parameter. +type QueryParamType string + +const ( + QueryParamTypeDelegation QueryParamType = "delegation" +) + +func (e QueryParamType) ToPointer() *QueryParamType { + return &e +} + +func (e *QueryParamType) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "delegation": + *e = QueryParamType(v) + return nil + default: + return fmt.Errorf("invalid value for QueryParamType: %v", v) + } +} + +// Scope - `all` - This is the only supported `scope` parameter. +type Scope string + +const ( + ScopeAll Scope = "all" +) + +func (e Scope) ToPointer() *Scope { + return &e +} + +func (e *Scope) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "all": + *e = Scope(v) + return nil + default: + return fmt.Errorf("invalid value for Scope: %v", v) + } +} + +type GetTransientTokenRequest struct { + // `delegation` - This is the only supported `type` parameter. + Type QueryParamType `queryParam:"style=form,explode=true,name=type"` + // `all` - This is the only supported `scope` parameter. + Scope Scope `queryParam:"style=form,explode=true,name=scope"` +} + +func (o *GetTransientTokenRequest) GetType() QueryParamType { + if o == nil { + return QueryParamType("") + } + return o.Type +} + +func (o *GetTransientTokenRequest) GetScope() Scope { + if o == nil { + return Scope("") + } + return o.Scope +} + +type GetTransientTokenResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetTransientTokenResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetTransientTokenResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetTransientTokenResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/getupdatestatus.go b/models/operations/getupdatestatus.go new file mode 100644 index 0000000..e069155 --- /dev/null +++ b/models/operations/getupdatestatus.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type GetUpdateStatusResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *GetUpdateStatusResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *GetUpdateStatusResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *GetUpdateStatusResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/logline.go b/models/operations/logline.go new file mode 100644 index 0000000..2dcf0a5 --- /dev/null +++ b/models/operations/logline.go @@ -0,0 +1,117 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Level - An integer log level to write to the PMS log with. +// 0: Error +// 1: Warning +// 2: Info +// 3: Debug +// 4: Verbose +type Level int64 + +const ( + LevelZero Level = 0 + LevelOne Level = 1 + LevelTwo Level = 2 + LevelThree Level = 3 + LevelFour Level = 4 +) + +func (e Level) ToPointer() *Level { + return &e +} + +func (e *Level) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + fallthrough + case 2: + fallthrough + case 3: + fallthrough + case 4: + *e = Level(v) + return nil + default: + return fmt.Errorf("invalid value for Level: %v", v) + } +} + +type LogLineRequest struct { + // An integer log level to write to the PMS log with. + // 0: Error + // 1: Warning + // 2: Info + // 3: Debug + // 4: Verbose + // + Level Level `queryParam:"style=form,explode=true,name=level"` + // The text of the message to write to the log. + Message string `queryParam:"style=form,explode=true,name=message"` + // a string indicating the source of the message. + Source string `queryParam:"style=form,explode=true,name=source"` +} + +func (o *LogLineRequest) GetLevel() Level { + if o == nil { + return Level(0) + } + return o.Level +} + +func (o *LogLineRequest) GetMessage() string { + if o == nil { + return "" + } + return o.Message +} + +func (o *LogLineRequest) GetSource() string { + if o == nil { + return "" + } + return o.Source +} + +type LogLineResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *LogLineResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *LogLineResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *LogLineResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/logmultiline.go b/models/operations/logmultiline.go new file mode 100644 index 0000000..7f64ee3 --- /dev/null +++ b/models/operations/logmultiline.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type LogMultiLineResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *LogMultiLineResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *LogMultiLineResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *LogMultiLineResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/markplayed.go b/models/operations/markplayed.go new file mode 100644 index 0000000..f82e093 --- /dev/null +++ b/models/operations/markplayed.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type MarkPlayedRequest struct { + // The media key to mark as played + Key float64 `queryParam:"style=form,explode=true,name=key"` +} + +func (o *MarkPlayedRequest) GetKey() float64 { + if o == nil { + return 0.0 + } + return o.Key +} + +type MarkPlayedResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *MarkPlayedResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *MarkPlayedResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *MarkPlayedResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/markunplayed.go b/models/operations/markunplayed.go new file mode 100644 index 0000000..e033978 --- /dev/null +++ b/models/operations/markunplayed.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type MarkUnplayedRequest struct { + // The media key to mark as Unplayed + Key float64 `queryParam:"style=form,explode=true,name=key"` +} + +func (o *MarkUnplayedRequest) GetKey() float64 { + if o == nil { + return 0.0 + } + return o.Key +} + +type MarkUnplayedResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *MarkUnplayedResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *MarkUnplayedResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *MarkUnplayedResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/performsearch.go b/models/operations/performsearch.go new file mode 100644 index 0000000..a7eb32f --- /dev/null +++ b/models/operations/performsearch.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" +) + +type PerformSearchRequest struct { + // The query term + Query string `queryParam:"style=form,explode=true,name=query"` + // This gives context to the search, and can result in re-ordering of search result hubs + SectionID *float64 `queryParam:"style=form,explode=true,name=sectionId"` + // The number of items to return per hub + Limit *float64 `default:"3" queryParam:"style=form,explode=true,name=limit"` +} + +func (p PerformSearchRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PerformSearchRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PerformSearchRequest) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *PerformSearchRequest) GetSectionID() *float64 { + if o == nil { + return nil + } + return o.SectionID +} + +func (o *PerformSearchRequest) GetLimit() *float64 { + if o == nil { + return nil + } + return o.Limit +} + +type PerformSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *PerformSearchResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *PerformSearchResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *PerformSearchResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/performvoicesearch.go b/models/operations/performvoicesearch.go new file mode 100644 index 0000000..728d41b --- /dev/null +++ b/models/operations/performvoicesearch.go @@ -0,0 +1,79 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "github.com/LukeHagar/plexgo/internal/utils" + "net/http" +) + +type PerformVoiceSearchRequest struct { + // The query term + Query string `queryParam:"style=form,explode=true,name=query"` + // This gives context to the search, and can result in re-ordering of search result hubs + SectionID *float64 `queryParam:"style=form,explode=true,name=sectionId"` + // The number of items to return per hub + Limit *float64 `default:"3" queryParam:"style=form,explode=true,name=limit"` +} + +func (p PerformVoiceSearchRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PerformVoiceSearchRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, &p, "", false, false); err != nil { + return err + } + return nil +} + +func (o *PerformVoiceSearchRequest) GetQuery() string { + if o == nil { + return "" + } + return o.Query +} + +func (o *PerformVoiceSearchRequest) GetSectionID() *float64 { + if o == nil { + return nil + } + return o.SectionID +} + +func (o *PerformVoiceSearchRequest) GetLimit() *float64 { + if o == nil { + return nil + } + return o.Limit +} + +type PerformVoiceSearchResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *PerformVoiceSearchResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *PerformVoiceSearchResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *PerformVoiceSearchResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/refreshlibrary.go b/models/operations/refreshlibrary.go new file mode 100644 index 0000000..34c65c7 --- /dev/null +++ b/models/operations/refreshlibrary.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type RefreshLibraryRequest struct { + // the Id of the library to refresh + SectionID float64 `pathParam:"style=simple,explode=false,name=sectionId"` +} + +func (o *RefreshLibraryRequest) GetSectionID() float64 { + if o == nil { + return 0.0 + } + return o.SectionID +} + +type RefreshLibraryResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *RefreshLibraryResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *RefreshLibraryResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *RefreshLibraryResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/startalltasks.go b/models/operations/startalltasks.go new file mode 100644 index 0000000..a293a11 --- /dev/null +++ b/models/operations/startalltasks.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type StartAllTasksResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StartAllTasksResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StartAllTasksResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StartAllTasksResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/starttask.go b/models/operations/starttask.go new file mode 100644 index 0000000..3eafbee --- /dev/null +++ b/models/operations/starttask.go @@ -0,0 +1,115 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// TaskName - the name of the task to be started. +type TaskName string + +const ( + TaskNameBackupDatabase TaskName = "BackupDatabase" + TaskNameBuildGracenoteCollections TaskName = "BuildGracenoteCollections" + TaskNameCheckForUpdates TaskName = "CheckForUpdates" + TaskNameCleanOldBundles TaskName = "CleanOldBundles" + TaskNameCleanOldCacheFiles TaskName = "CleanOldCacheFiles" + TaskNameDeepMediaAnalysis TaskName = "DeepMediaAnalysis" + TaskNameGenerateAutoTags TaskName = "GenerateAutoTags" + TaskNameGenerateChapterThumbs TaskName = "GenerateChapterThumbs" + TaskNameGenerateMediaIndexFiles TaskName = "GenerateMediaIndexFiles" + TaskNameOptimizeDatabase TaskName = "OptimizeDatabase" + TaskNameRefreshLibraries TaskName = "RefreshLibraries" + TaskNameRefreshLocalMedia TaskName = "RefreshLocalMedia" + TaskNameRefreshPeriodicMetadata TaskName = "RefreshPeriodicMetadata" + TaskNameUpgradeMediaAnalysis TaskName = "UpgradeMediaAnalysis" +) + +func (e TaskName) ToPointer() *TaskName { + return &e +} + +func (e *TaskName) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "BackupDatabase": + fallthrough + case "BuildGracenoteCollections": + fallthrough + case "CheckForUpdates": + fallthrough + case "CleanOldBundles": + fallthrough + case "CleanOldCacheFiles": + fallthrough + case "DeepMediaAnalysis": + fallthrough + case "GenerateAutoTags": + fallthrough + case "GenerateChapterThumbs": + fallthrough + case "GenerateMediaIndexFiles": + fallthrough + case "OptimizeDatabase": + fallthrough + case "RefreshLibraries": + fallthrough + case "RefreshLocalMedia": + fallthrough + case "RefreshPeriodicMetadata": + fallthrough + case "UpgradeMediaAnalysis": + *e = TaskName(v) + return nil + default: + return fmt.Errorf("invalid value for TaskName: %v", v) + } +} + +type StartTaskRequest struct { + // the name of the task to be started. + TaskName TaskName `pathParam:"style=simple,explode=false,name=taskName"` +} + +func (o *StartTaskRequest) GetTaskName() TaskName { + if o == nil { + return TaskName("") + } + return o.TaskName +} + +type StartTaskResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StartTaskResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StartTaskResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StartTaskResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/startuniversaltranscode.go b/models/operations/startuniversaltranscode.go new file mode 100644 index 0000000..74c1770 --- /dev/null +++ b/models/operations/startuniversaltranscode.go @@ -0,0 +1,184 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type StartUniversalTranscodeRequest struct { + // Whether the media item has MDE + HasMDE float64 `queryParam:"style=form,explode=true,name=hasMDE"` + // The path to the media item to transcode + Path string `queryParam:"style=form,explode=true,name=path"` + // The index of the media item to transcode + MediaIndex float64 `queryParam:"style=form,explode=true,name=mediaIndex"` + // The index of the part to transcode + PartIndex float64 `queryParam:"style=form,explode=true,name=partIndex"` + // The protocol to use for the transcode session + Protocol string `queryParam:"style=form,explode=true,name=protocol"` + // Whether to use fast seek or not + FastSeek *float64 `queryParam:"style=form,explode=true,name=fastSeek"` + // Whether to use direct play or not + DirectPlay *float64 `queryParam:"style=form,explode=true,name=directPlay"` + // Whether to use direct stream or not + DirectStream *float64 `queryParam:"style=form,explode=true,name=directStream"` + // The size of the subtitles + SubtitleSize *float64 `queryParam:"style=form,explode=true,name=subtitleSize"` + // The subtitles + Subtites *string `queryParam:"style=form,explode=true,name=subtites"` + // The audio boost + AudioBoost *float64 `queryParam:"style=form,explode=true,name=audioBoost"` + // The location of the transcode session + Location *string `queryParam:"style=form,explode=true,name=location"` + // The size of the media buffer + MediaBufferSize *float64 `queryParam:"style=form,explode=true,name=mediaBufferSize"` + // The session ID + Session *string `queryParam:"style=form,explode=true,name=session"` + // Whether to add a debug overlay or not + AddDebugOverlay *float64 `queryParam:"style=form,explode=true,name=addDebugOverlay"` + // Whether to auto adjust quality or not + AutoAdjustQuality *float64 `queryParam:"style=form,explode=true,name=autoAdjustQuality"` +} + +func (o *StartUniversalTranscodeRequest) GetHasMDE() float64 { + if o == nil { + return 0.0 + } + return o.HasMDE +} + +func (o *StartUniversalTranscodeRequest) GetPath() string { + if o == nil { + return "" + } + return o.Path +} + +func (o *StartUniversalTranscodeRequest) GetMediaIndex() float64 { + if o == nil { + return 0.0 + } + return o.MediaIndex +} + +func (o *StartUniversalTranscodeRequest) GetPartIndex() float64 { + if o == nil { + return 0.0 + } + return o.PartIndex +} + +func (o *StartUniversalTranscodeRequest) GetProtocol() string { + if o == nil { + return "" + } + return o.Protocol +} + +func (o *StartUniversalTranscodeRequest) GetFastSeek() *float64 { + if o == nil { + return nil + } + return o.FastSeek +} + +func (o *StartUniversalTranscodeRequest) GetDirectPlay() *float64 { + if o == nil { + return nil + } + return o.DirectPlay +} + +func (o *StartUniversalTranscodeRequest) GetDirectStream() *float64 { + if o == nil { + return nil + } + return o.DirectStream +} + +func (o *StartUniversalTranscodeRequest) GetSubtitleSize() *float64 { + if o == nil { + return nil + } + return o.SubtitleSize +} + +func (o *StartUniversalTranscodeRequest) GetSubtites() *string { + if o == nil { + return nil + } + return o.Subtites +} + +func (o *StartUniversalTranscodeRequest) GetAudioBoost() *float64 { + if o == nil { + return nil + } + return o.AudioBoost +} + +func (o *StartUniversalTranscodeRequest) GetLocation() *string { + if o == nil { + return nil + } + return o.Location +} + +func (o *StartUniversalTranscodeRequest) GetMediaBufferSize() *float64 { + if o == nil { + return nil + } + return o.MediaBufferSize +} + +func (o *StartUniversalTranscodeRequest) GetSession() *string { + if o == nil { + return nil + } + return o.Session +} + +func (o *StartUniversalTranscodeRequest) GetAddDebugOverlay() *float64 { + if o == nil { + return nil + } + return o.AddDebugOverlay +} + +func (o *StartUniversalTranscodeRequest) GetAutoAdjustQuality() *float64 { + if o == nil { + return nil + } + return o.AutoAdjustQuality +} + +type StartUniversalTranscodeResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StartUniversalTranscodeResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StartUniversalTranscodeResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StartUniversalTranscodeResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/stopalltasks.go b/models/operations/stopalltasks.go new file mode 100644 index 0000000..e66f13d --- /dev/null +++ b/models/operations/stopalltasks.go @@ -0,0 +1,37 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type StopAllTasksResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StopAllTasksResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StopAllTasksResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StopAllTasksResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/stoptask.go b/models/operations/stoptask.go new file mode 100644 index 0000000..24b22f7 --- /dev/null +++ b/models/operations/stoptask.go @@ -0,0 +1,115 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// PathParamTaskName - The name of the task to be started. +type PathParamTaskName string + +const ( + PathParamTaskNameBackupDatabase PathParamTaskName = "BackupDatabase" + PathParamTaskNameBuildGracenoteCollections PathParamTaskName = "BuildGracenoteCollections" + PathParamTaskNameCheckForUpdates PathParamTaskName = "CheckForUpdates" + PathParamTaskNameCleanOldBundles PathParamTaskName = "CleanOldBundles" + PathParamTaskNameCleanOldCacheFiles PathParamTaskName = "CleanOldCacheFiles" + PathParamTaskNameDeepMediaAnalysis PathParamTaskName = "DeepMediaAnalysis" + PathParamTaskNameGenerateAutoTags PathParamTaskName = "GenerateAutoTags" + PathParamTaskNameGenerateChapterThumbs PathParamTaskName = "GenerateChapterThumbs" + PathParamTaskNameGenerateMediaIndexFiles PathParamTaskName = "GenerateMediaIndexFiles" + PathParamTaskNameOptimizeDatabase PathParamTaskName = "OptimizeDatabase" + PathParamTaskNameRefreshLibraries PathParamTaskName = "RefreshLibraries" + PathParamTaskNameRefreshLocalMedia PathParamTaskName = "RefreshLocalMedia" + PathParamTaskNameRefreshPeriodicMetadata PathParamTaskName = "RefreshPeriodicMetadata" + PathParamTaskNameUpgradeMediaAnalysis PathParamTaskName = "UpgradeMediaAnalysis" +) + +func (e PathParamTaskName) ToPointer() *PathParamTaskName { + return &e +} + +func (e *PathParamTaskName) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "BackupDatabase": + fallthrough + case "BuildGracenoteCollections": + fallthrough + case "CheckForUpdates": + fallthrough + case "CleanOldBundles": + fallthrough + case "CleanOldCacheFiles": + fallthrough + case "DeepMediaAnalysis": + fallthrough + case "GenerateAutoTags": + fallthrough + case "GenerateChapterThumbs": + fallthrough + case "GenerateMediaIndexFiles": + fallthrough + case "OptimizeDatabase": + fallthrough + case "RefreshLibraries": + fallthrough + case "RefreshLocalMedia": + fallthrough + case "RefreshPeriodicMetadata": + fallthrough + case "UpgradeMediaAnalysis": + *e = PathParamTaskName(v) + return nil + default: + return fmt.Errorf("invalid value for PathParamTaskName: %v", v) + } +} + +type StopTaskRequest struct { + // The name of the task to be started. + TaskName PathParamTaskName `pathParam:"style=simple,explode=false,name=taskName"` +} + +func (o *StopTaskRequest) GetTaskName() PathParamTaskName { + if o == nil { + return PathParamTaskName("") + } + return o.TaskName +} + +type StopTaskResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StopTaskResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StopTaskResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StopTaskResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/stoptranscodesession.go b/models/operations/stoptranscodesession.go new file mode 100644 index 0000000..e7db5be --- /dev/null +++ b/models/operations/stoptranscodesession.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type StopTranscodeSessionRequest struct { + // the Key of the transcode session to stop + SessionKey string `pathParam:"style=simple,explode=false,name=sessionKey"` +} + +func (o *StopTranscodeSessionRequest) GetSessionKey() string { + if o == nil { + return "" + } + return o.SessionKey +} + +type StopTranscodeSessionResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *StopTranscodeSessionResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *StopTranscodeSessionResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *StopTranscodeSessionResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/updateplaylist.go b/models/operations/updateplaylist.go new file mode 100644 index 0000000..437fab9 --- /dev/null +++ b/models/operations/updateplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type UpdatePlaylistRequest struct { + // the ID of the playlist + PlaylistID float64 `pathParam:"style=simple,explode=false,name=playlistID"` +} + +func (o *UpdatePlaylistRequest) GetPlaylistID() float64 { + if o == nil { + return 0.0 + } + return o.PlaylistID +} + +type UpdatePlaylistResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *UpdatePlaylistResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpdatePlaylistResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdatePlaylistResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/updateplayprogress.go b/models/operations/updateplayprogress.go new file mode 100644 index 0000000..de27407 --- /dev/null +++ b/models/operations/updateplayprogress.go @@ -0,0 +1,67 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "net/http" +) + +type UpdatePlayProgressRequest struct { + // the media key + Key string `queryParam:"style=form,explode=true,name=key"` + // The time, in milliseconds, used to set the media playback progress. + Time float64 `queryParam:"style=form,explode=true,name=time"` + // The playback state of the media item. + State string `queryParam:"style=form,explode=true,name=state"` +} + +func (o *UpdatePlayProgressRequest) GetKey() string { + if o == nil { + return "" + } + return o.Key +} + +func (o *UpdatePlayProgressRequest) GetTime() float64 { + if o == nil { + return 0.0 + } + return o.Time +} + +func (o *UpdatePlayProgressRequest) GetState() string { + if o == nil { + return "" + } + return o.State +} + +type UpdatePlayProgressResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *UpdatePlayProgressResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UpdatePlayProgressResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UpdatePlayProgressResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/operations/uploadplaylist.go b/models/operations/uploadplaylist.go new file mode 100644 index 0000000..45b1c53 --- /dev/null +++ b/models/operations/uploadplaylist.go @@ -0,0 +1,97 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package operations + +import ( + "encoding/json" + "fmt" + "net/http" +) + +// Force - force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. +// The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. +type Force int64 + +const ( + ForceZero Force = 0 + ForceOne Force = 1 +) + +func (e Force) ToPointer() *Force { + return &e +} + +func (e *Force) UnmarshalJSON(data []byte) error { + var v int64 + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case 0: + fallthrough + case 1: + *e = Force(v) + return nil + default: + return fmt.Errorf("invalid value for Force: %v", v) + } +} + +type UploadPlaylistRequest struct { + // absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server. + // If the `path` argument is a directory, that path will be scanned for playlist files to be processed. + // Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it. + // The GUID of each playlist is based on the filename. + // If the `path` argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it. + // The GUID of each playlist is based on the filename. + // + Path string `queryParam:"style=form,explode=true,name=path"` + // force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist. + // The `force` argument is used to disable overwriting. If the `force` argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded. + // + Force Force `queryParam:"style=form,explode=true,name=force"` +} + +func (o *UploadPlaylistRequest) GetPath() string { + if o == nil { + return "" + } + return o.Path +} + +func (o *UploadPlaylistRequest) GetForce() Force { + if o == nil { + return Force(0) + } + return o.Force +} + +type UploadPlaylistResponse struct { + // HTTP response content type for this operation + ContentType string + // HTTP response status code for this operation + StatusCode int + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response +} + +func (o *UploadPlaylistResponse) GetContentType() string { + if o == nil { + return "" + } + return o.ContentType +} + +func (o *UploadPlaylistResponse) GetStatusCode() int { + if o == nil { + return 0 + } + return o.StatusCode +} + +func (o *UploadPlaylistResponse) GetRawResponse() *http.Response { + if o == nil { + return nil + } + return o.RawResponse +} diff --git a/models/sdkerrors/addplaylistcontents.go b/models/sdkerrors/addplaylistcontents.go new file mode 100644 index 0000000..691e12e --- /dev/null +++ b/models/sdkerrors/addplaylistcontents.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type AddPlaylistContentsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *AddPlaylistContentsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *AddPlaylistContentsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *AddPlaylistContentsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// AddPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type AddPlaylistContentsResponseBody struct { + Errors []AddPlaylistContentsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &AddPlaylistContentsResponseBody{} + +func (e *AddPlaylistContentsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/applyupdates.go b/models/sdkerrors/applyupdates.go new file mode 100644 index 0000000..db09296 --- /dev/null +++ b/models/sdkerrors/applyupdates.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type ApplyUpdatesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *ApplyUpdatesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *ApplyUpdatesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *ApplyUpdatesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// ApplyUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type ApplyUpdatesResponseBody struct { + Errors []ApplyUpdatesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &ApplyUpdatesResponseBody{} + +func (e *ApplyUpdatesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/cancelserveractivities.go b/models/sdkerrors/cancelserveractivities.go new file mode 100644 index 0000000..7e460c4 --- /dev/null +++ b/models/sdkerrors/cancelserveractivities.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type CancelServerActivitiesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *CancelServerActivitiesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *CancelServerActivitiesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *CancelServerActivitiesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// CancelServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type CancelServerActivitiesResponseBody struct { + Errors []CancelServerActivitiesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &CancelServerActivitiesResponseBody{} + +func (e *CancelServerActivitiesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/checkforupdates.go b/models/sdkerrors/checkforupdates.go new file mode 100644 index 0000000..ab829a6 --- /dev/null +++ b/models/sdkerrors/checkforupdates.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type CheckForUpdatesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *CheckForUpdatesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *CheckForUpdatesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *CheckForUpdatesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// CheckForUpdatesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type CheckForUpdatesResponseBody struct { + Errors []CheckForUpdatesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &CheckForUpdatesResponseBody{} + +func (e *CheckForUpdatesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/clearplaylistcontents.go b/models/sdkerrors/clearplaylistcontents.go new file mode 100644 index 0000000..e8a2888 --- /dev/null +++ b/models/sdkerrors/clearplaylistcontents.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type ClearPlaylistContentsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *ClearPlaylistContentsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *ClearPlaylistContentsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *ClearPlaylistContentsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// ClearPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type ClearPlaylistContentsResponseBody struct { + Errors []ClearPlaylistContentsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &ClearPlaylistContentsResponseBody{} + +func (e *ClearPlaylistContentsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/createplaylist.go b/models/sdkerrors/createplaylist.go new file mode 100644 index 0000000..fa642f4 --- /dev/null +++ b/models/sdkerrors/createplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type CreatePlaylistErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *CreatePlaylistErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *CreatePlaylistErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *CreatePlaylistErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// CreatePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type CreatePlaylistResponseBody struct { + Errors []CreatePlaylistErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &CreatePlaylistResponseBody{} + +func (e *CreatePlaylistResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/deletelibrary.go b/models/sdkerrors/deletelibrary.go new file mode 100644 index 0000000..f404dab --- /dev/null +++ b/models/sdkerrors/deletelibrary.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type DeleteLibraryErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *DeleteLibraryErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *DeleteLibraryErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *DeleteLibraryErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// DeleteLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type DeleteLibraryResponseBody struct { + Errors []DeleteLibraryErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &DeleteLibraryResponseBody{} + +func (e *DeleteLibraryResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/deleteplaylist.go b/models/sdkerrors/deleteplaylist.go new file mode 100644 index 0000000..74061e3 --- /dev/null +++ b/models/sdkerrors/deleteplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type DeletePlaylistErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *DeletePlaylistErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *DeletePlaylistErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *DeletePlaylistErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// DeletePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type DeletePlaylistResponseBody struct { + Errors []DeletePlaylistErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &DeletePlaylistResponseBody{} + +func (e *DeletePlaylistResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/enablepapertrail.go b/models/sdkerrors/enablepapertrail.go new file mode 100644 index 0000000..5e0708b --- /dev/null +++ b/models/sdkerrors/enablepapertrail.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type EnablePaperTrailErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *EnablePaperTrailErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *EnablePaperTrailErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *EnablePaperTrailErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// EnablePaperTrailResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type EnablePaperTrailResponseBody struct { + Errors []EnablePaperTrailErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &EnablePaperTrailResponseBody{} + +func (e *EnablePaperTrailResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getavailableclients.go b/models/sdkerrors/getavailableclients.go new file mode 100644 index 0000000..0d1fcc5 --- /dev/null +++ b/models/sdkerrors/getavailableclients.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetAvailableClientsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetAvailableClientsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetAvailableClientsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetAvailableClientsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetAvailableClientsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetAvailableClientsResponseBody struct { + Errors []GetAvailableClientsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetAvailableClientsResponseBody{} + +func (e *GetAvailableClientsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getbutlertasks.go b/models/sdkerrors/getbutlertasks.go new file mode 100644 index 0000000..7ef4939 --- /dev/null +++ b/models/sdkerrors/getbutlertasks.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetButlerTasksErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetButlerTasksErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetButlerTasksErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetButlerTasksErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetButlerTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetButlerTasksResponseBody struct { + Errors []GetButlerTasksErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetButlerTasksResponseBody{} + +func (e *GetButlerTasksResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getcommonlibraryitems.go b/models/sdkerrors/getcommonlibraryitems.go new file mode 100644 index 0000000..42cd7e7 --- /dev/null +++ b/models/sdkerrors/getcommonlibraryitems.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetCommonLibraryItemsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetCommonLibraryItemsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetCommonLibraryItemsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetCommonLibraryItemsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetCommonLibraryItemsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetCommonLibraryItemsResponseBody struct { + Errors []GetCommonLibraryItemsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetCommonLibraryItemsResponseBody{} + +func (e *GetCommonLibraryItemsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getdevices.go b/models/sdkerrors/getdevices.go new file mode 100644 index 0000000..2a15328 --- /dev/null +++ b/models/sdkerrors/getdevices.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetDevicesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetDevicesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetDevicesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetDevicesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetDevicesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetDevicesResponseBody struct { + Errors []GetDevicesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetDevicesResponseBody{} + +func (e *GetDevicesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getfilehash.go b/models/sdkerrors/getfilehash.go new file mode 100644 index 0000000..a9fc2a0 --- /dev/null +++ b/models/sdkerrors/getfilehash.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetFileHashErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetFileHashErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetFileHashErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetFileHashErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetFileHashResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetFileHashResponseBody struct { + Errors []GetFileHashErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetFileHashResponseBody{} + +func (e *GetFileHashResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getglobalhubs.go b/models/sdkerrors/getglobalhubs.go new file mode 100644 index 0000000..6178286 --- /dev/null +++ b/models/sdkerrors/getglobalhubs.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetGlobalHubsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetGlobalHubsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetGlobalHubsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetGlobalHubsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetGlobalHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetGlobalHubsResponseBody struct { + Errors []GetGlobalHubsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetGlobalHubsResponseBody{} + +func (e *GetGlobalHubsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getlatestlibraryitems.go b/models/sdkerrors/getlatestlibraryitems.go new file mode 100644 index 0000000..49fed49 --- /dev/null +++ b/models/sdkerrors/getlatestlibraryitems.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetLatestLibraryItemsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetLatestLibraryItemsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetLatestLibraryItemsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetLatestLibraryItemsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetLatestLibraryItemsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetLatestLibraryItemsResponseBody struct { + Errors []GetLatestLibraryItemsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetLatestLibraryItemsResponseBody{} + +func (e *GetLatestLibraryItemsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getlibraries.go b/models/sdkerrors/getlibraries.go new file mode 100644 index 0000000..5cb1cf2 --- /dev/null +++ b/models/sdkerrors/getlibraries.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetLibrariesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetLibrariesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetLibrariesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetLibrariesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetLibrariesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetLibrariesResponseBody struct { + Errors []GetLibrariesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetLibrariesResponseBody{} + +func (e *GetLibrariesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getlibrary.go b/models/sdkerrors/getlibrary.go new file mode 100644 index 0000000..7fbe3b6 --- /dev/null +++ b/models/sdkerrors/getlibrary.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetLibraryErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetLibraryErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetLibraryErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetLibraryErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetLibraryResponseBody struct { + Errors []GetLibraryErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetLibraryResponseBody{} + +func (e *GetLibraryResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getlibraryhubs.go b/models/sdkerrors/getlibraryhubs.go new file mode 100644 index 0000000..1509759 --- /dev/null +++ b/models/sdkerrors/getlibraryhubs.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetLibraryHubsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetLibraryHubsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetLibraryHubsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetLibraryHubsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetLibraryHubsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetLibraryHubsResponseBody struct { + Errors []GetLibraryHubsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetLibraryHubsResponseBody{} + +func (e *GetLibraryHubsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getlibraryitems.go b/models/sdkerrors/getlibraryitems.go new file mode 100644 index 0000000..63c340d --- /dev/null +++ b/models/sdkerrors/getlibraryitems.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetLibraryItemsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetLibraryItemsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetLibraryItemsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetLibraryItemsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetLibraryItemsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetLibraryItemsResponseBody struct { + Errors []GetLibraryItemsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetLibraryItemsResponseBody{} + +func (e *GetLibraryItemsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getmetadata.go b/models/sdkerrors/getmetadata.go new file mode 100644 index 0000000..9eb9512 --- /dev/null +++ b/models/sdkerrors/getmetadata.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetMetadataErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetMetadataErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetMetadataErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetMetadataErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetMetadataResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetMetadataResponseBody struct { + Errors []GetMetadataErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetMetadataResponseBody{} + +func (e *GetMetadataResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getmetadatachildren.go b/models/sdkerrors/getmetadatachildren.go new file mode 100644 index 0000000..0c9e7cc --- /dev/null +++ b/models/sdkerrors/getmetadatachildren.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetMetadataChildrenErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetMetadataChildrenErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetMetadataChildrenErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetMetadataChildrenErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetMetadataChildrenResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetMetadataChildrenResponseBody struct { + Errors []GetMetadataChildrenErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetMetadataChildrenResponseBody{} + +func (e *GetMetadataChildrenResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getmyplexaccount.go b/models/sdkerrors/getmyplexaccount.go new file mode 100644 index 0000000..56e1493 --- /dev/null +++ b/models/sdkerrors/getmyplexaccount.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetMyPlexAccountErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetMyPlexAccountErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetMyPlexAccountErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetMyPlexAccountErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetMyPlexAccountResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetMyPlexAccountResponseBody struct { + Errors []GetMyPlexAccountErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetMyPlexAccountResponseBody{} + +func (e *GetMyPlexAccountResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getondeck.go b/models/sdkerrors/getondeck.go new file mode 100644 index 0000000..50b9df4 --- /dev/null +++ b/models/sdkerrors/getondeck.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetOnDeckErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetOnDeckErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetOnDeckErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetOnDeckErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetOnDeckResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetOnDeckResponseBody struct { + Errors []GetOnDeckErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetOnDeckResponseBody{} + +func (e *GetOnDeckResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getplaylist.go b/models/sdkerrors/getplaylist.go new file mode 100644 index 0000000..c3b4a68 --- /dev/null +++ b/models/sdkerrors/getplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetPlaylistErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetPlaylistErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetPlaylistErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetPlaylistErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetPlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetPlaylistResponseBody struct { + Errors []GetPlaylistErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetPlaylistResponseBody{} + +func (e *GetPlaylistResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getplaylistcontents.go b/models/sdkerrors/getplaylistcontents.go new file mode 100644 index 0000000..64ce459 --- /dev/null +++ b/models/sdkerrors/getplaylistcontents.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetPlaylistContentsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetPlaylistContentsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetPlaylistContentsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetPlaylistContentsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetPlaylistContentsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetPlaylistContentsResponseBody struct { + Errors []GetPlaylistContentsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetPlaylistContentsResponseBody{} + +func (e *GetPlaylistContentsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getplaylists.go b/models/sdkerrors/getplaylists.go new file mode 100644 index 0000000..6227a33 --- /dev/null +++ b/models/sdkerrors/getplaylists.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetPlaylistsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetPlaylistsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetPlaylistsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetPlaylistsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetPlaylistsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetPlaylistsResponseBody struct { + Errors []GetPlaylistsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetPlaylistsResponseBody{} + +func (e *GetPlaylistsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getrecentlyadded.go b/models/sdkerrors/getrecentlyadded.go new file mode 100644 index 0000000..43652d8 --- /dev/null +++ b/models/sdkerrors/getrecentlyadded.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetRecentlyAddedErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetRecentlyAddedErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetRecentlyAddedErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetRecentlyAddedErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetRecentlyAddedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetRecentlyAddedResponseBody struct { + Errors []GetRecentlyAddedErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetRecentlyAddedResponseBody{} + +func (e *GetRecentlyAddedResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getresizedphoto.go b/models/sdkerrors/getresizedphoto.go new file mode 100644 index 0000000..e83f146 --- /dev/null +++ b/models/sdkerrors/getresizedphoto.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetResizedPhotoErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetResizedPhotoErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetResizedPhotoErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetResizedPhotoErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetResizedPhotoResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetResizedPhotoResponseBody struct { + Errors []GetResizedPhotoErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetResizedPhotoResponseBody{} + +func (e *GetResizedPhotoResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getsearchresults.go b/models/sdkerrors/getsearchresults.go new file mode 100644 index 0000000..22301ed --- /dev/null +++ b/models/sdkerrors/getsearchresults.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetSearchResultsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetSearchResultsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetSearchResultsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetSearchResultsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetSearchResultsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetSearchResultsResponseBody struct { + Errors []GetSearchResultsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetSearchResultsResponseBody{} + +func (e *GetSearchResultsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getserveractivities.go b/models/sdkerrors/getserveractivities.go new file mode 100644 index 0000000..549d9d6 --- /dev/null +++ b/models/sdkerrors/getserveractivities.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetServerActivitiesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetServerActivitiesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetServerActivitiesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetServerActivitiesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetServerActivitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetServerActivitiesResponseBody struct { + Errors []GetServerActivitiesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetServerActivitiesResponseBody{} + +func (e *GetServerActivitiesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getservercapabilities.go b/models/sdkerrors/getservercapabilities.go new file mode 100644 index 0000000..a7192b8 --- /dev/null +++ b/models/sdkerrors/getservercapabilities.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type Errors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *Errors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *Errors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *Errors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetServerCapabilitiesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetServerCapabilitiesResponseBody struct { + Errors []Errors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetServerCapabilitiesResponseBody{} + +func (e *GetServerCapabilitiesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getserveridentity.go b/models/sdkerrors/getserveridentity.go new file mode 100644 index 0000000..456b8b1 --- /dev/null +++ b/models/sdkerrors/getserveridentity.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetServerIdentityErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetServerIdentityErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetServerIdentityErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetServerIdentityErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetServerIdentityResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetServerIdentityResponseBody struct { + Errors []GetServerIdentityErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetServerIdentityResponseBody{} + +func (e *GetServerIdentityResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getserverlist.go b/models/sdkerrors/getserverlist.go new file mode 100644 index 0000000..452ac97 --- /dev/null +++ b/models/sdkerrors/getserverlist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetServerListErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetServerListErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetServerListErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetServerListErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetServerListResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetServerListResponseBody struct { + Errors []GetServerListErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetServerListResponseBody{} + +func (e *GetServerListResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getserverpreferences.go b/models/sdkerrors/getserverpreferences.go new file mode 100644 index 0000000..e42c61b --- /dev/null +++ b/models/sdkerrors/getserverpreferences.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetServerPreferencesErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetServerPreferencesErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetServerPreferencesErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetServerPreferencesErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetServerPreferencesResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetServerPreferencesResponseBody struct { + Errors []GetServerPreferencesErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetServerPreferencesResponseBody{} + +func (e *GetServerPreferencesResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getsessionhistory.go b/models/sdkerrors/getsessionhistory.go new file mode 100644 index 0000000..a0d232d --- /dev/null +++ b/models/sdkerrors/getsessionhistory.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetSessionHistoryErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetSessionHistoryErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetSessionHistoryErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetSessionHistoryErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetSessionHistoryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetSessionHistoryResponseBody struct { + Errors []GetSessionHistoryErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetSessionHistoryResponseBody{} + +func (e *GetSessionHistoryResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getsessions.go b/models/sdkerrors/getsessions.go new file mode 100644 index 0000000..eac87c1 --- /dev/null +++ b/models/sdkerrors/getsessions.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetSessionsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetSessionsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetSessionsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetSessionsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetSessionsResponseBody struct { + Errors []GetSessionsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetSessionsResponseBody{} + +func (e *GetSessionsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getsourceconnectioninformation.go b/models/sdkerrors/getsourceconnectioninformation.go new file mode 100644 index 0000000..9f2d316 --- /dev/null +++ b/models/sdkerrors/getsourceconnectioninformation.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetSourceConnectionInformationErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetSourceConnectionInformationErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetSourceConnectionInformationErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetSourceConnectionInformationErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetSourceConnectionInformationResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetSourceConnectionInformationResponseBody struct { + Errors []GetSourceConnectionInformationErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetSourceConnectionInformationResponseBody{} + +func (e *GetSourceConnectionInformationResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/gettimeline.go b/models/sdkerrors/gettimeline.go new file mode 100644 index 0000000..77996ed --- /dev/null +++ b/models/sdkerrors/gettimeline.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetTimelineErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetTimelineErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetTimelineErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetTimelineErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetTimelineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetTimelineResponseBody struct { + Errors []GetTimelineErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetTimelineResponseBody{} + +func (e *GetTimelineResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/gettranscodesessions.go b/models/sdkerrors/gettranscodesessions.go new file mode 100644 index 0000000..48cbb34 --- /dev/null +++ b/models/sdkerrors/gettranscodesessions.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetTranscodeSessionsErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetTranscodeSessionsErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetTranscodeSessionsErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetTranscodeSessionsErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetTranscodeSessionsResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetTranscodeSessionsResponseBody struct { + Errors []GetTranscodeSessionsErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetTranscodeSessionsResponseBody{} + +func (e *GetTranscodeSessionsResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/gettransienttoken.go b/models/sdkerrors/gettransienttoken.go new file mode 100644 index 0000000..772f1fa --- /dev/null +++ b/models/sdkerrors/gettransienttoken.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetTransientTokenErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetTransientTokenErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetTransientTokenErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetTransientTokenErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetTransientTokenResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetTransientTokenResponseBody struct { + Errors []GetTransientTokenErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetTransientTokenResponseBody{} + +func (e *GetTransientTokenResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/getupdatestatus.go b/models/sdkerrors/getupdatestatus.go new file mode 100644 index 0000000..99c65b2 --- /dev/null +++ b/models/sdkerrors/getupdatestatus.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type GetUpdateStatusErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *GetUpdateStatusErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *GetUpdateStatusErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *GetUpdateStatusErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// GetUpdateStatusResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type GetUpdateStatusResponseBody struct { + Errors []GetUpdateStatusErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &GetUpdateStatusResponseBody{} + +func (e *GetUpdateStatusResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/logline.go b/models/sdkerrors/logline.go new file mode 100644 index 0000000..0dd1060 --- /dev/null +++ b/models/sdkerrors/logline.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type LogLineErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *LogLineErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *LogLineErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *LogLineErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// LogLineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type LogLineResponseBody struct { + Errors []LogLineErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &LogLineResponseBody{} + +func (e *LogLineResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/logmultiline.go b/models/sdkerrors/logmultiline.go new file mode 100644 index 0000000..4fa1e71 --- /dev/null +++ b/models/sdkerrors/logmultiline.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type LogMultiLineErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *LogMultiLineErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *LogMultiLineErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *LogMultiLineErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// LogMultiLineResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type LogMultiLineResponseBody struct { + Errors []LogMultiLineErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &LogMultiLineResponseBody{} + +func (e *LogMultiLineResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/markplayed.go b/models/sdkerrors/markplayed.go new file mode 100644 index 0000000..a740882 --- /dev/null +++ b/models/sdkerrors/markplayed.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type MarkPlayedErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *MarkPlayedErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *MarkPlayedErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *MarkPlayedErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// MarkPlayedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type MarkPlayedResponseBody struct { + Errors []MarkPlayedErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &MarkPlayedResponseBody{} + +func (e *MarkPlayedResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/markunplayed.go b/models/sdkerrors/markunplayed.go new file mode 100644 index 0000000..bf79cc1 --- /dev/null +++ b/models/sdkerrors/markunplayed.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type MarkUnplayedErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *MarkUnplayedErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *MarkUnplayedErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *MarkUnplayedErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// MarkUnplayedResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type MarkUnplayedResponseBody struct { + Errors []MarkUnplayedErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &MarkUnplayedResponseBody{} + +func (e *MarkUnplayedResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/performsearch.go b/models/sdkerrors/performsearch.go new file mode 100644 index 0000000..38a5330 --- /dev/null +++ b/models/sdkerrors/performsearch.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type PerformSearchErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *PerformSearchErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *PerformSearchErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *PerformSearchErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// PerformSearchResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type PerformSearchResponseBody struct { + Errors []PerformSearchErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &PerformSearchResponseBody{} + +func (e *PerformSearchResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/performvoicesearch.go b/models/sdkerrors/performvoicesearch.go new file mode 100644 index 0000000..ce42ad4 --- /dev/null +++ b/models/sdkerrors/performvoicesearch.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type PerformVoiceSearchErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *PerformVoiceSearchErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *PerformVoiceSearchErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *PerformVoiceSearchErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// PerformVoiceSearchResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type PerformVoiceSearchResponseBody struct { + Errors []PerformVoiceSearchErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &PerformVoiceSearchResponseBody{} + +func (e *PerformVoiceSearchResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/refreshlibrary.go b/models/sdkerrors/refreshlibrary.go new file mode 100644 index 0000000..a642757 --- /dev/null +++ b/models/sdkerrors/refreshlibrary.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type RefreshLibraryErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *RefreshLibraryErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *RefreshLibraryErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *RefreshLibraryErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// RefreshLibraryResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type RefreshLibraryResponseBody struct { + Errors []RefreshLibraryErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &RefreshLibraryResponseBody{} + +func (e *RefreshLibraryResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/sdkerror.go b/models/sdkerrors/sdkerror.go new file mode 100644 index 0000000..5c1affd --- /dev/null +++ b/models/sdkerrors/sdkerror.go @@ -0,0 +1,35 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "fmt" + "net/http" +) + +type SDKError struct { + Message string + StatusCode int + Body string + RawResponse *http.Response +} + +var _ error = &SDKError{} + +func NewSDKError(message string, statusCode int, body string, httpRes *http.Response) *SDKError { + return &SDKError{ + Message: message, + StatusCode: statusCode, + Body: body, + RawResponse: httpRes, + } +} + +func (e *SDKError) Error() string { + body := "" + if len(e.Body) > 0 { + body = fmt.Sprintf("\n%s", e.Body) + } + + return fmt.Sprintf("%s: Status %d%s", e.Message, e.StatusCode, body) +} diff --git a/models/sdkerrors/startalltasks.go b/models/sdkerrors/startalltasks.go new file mode 100644 index 0000000..c88bf25 --- /dev/null +++ b/models/sdkerrors/startalltasks.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type StartAllTasksErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *StartAllTasksErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *StartAllTasksErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *StartAllTasksErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// StartAllTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type StartAllTasksResponseBody struct { + Errors []StartAllTasksErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &StartAllTasksResponseBody{} + +func (e *StartAllTasksResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/starttask.go b/models/sdkerrors/starttask.go new file mode 100644 index 0000000..8031725 --- /dev/null +++ b/models/sdkerrors/starttask.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type StartTaskErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *StartTaskErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *StartTaskErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *StartTaskErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// StartTaskResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type StartTaskResponseBody struct { + Errors []StartTaskErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &StartTaskResponseBody{} + +func (e *StartTaskResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/startuniversaltranscode.go b/models/sdkerrors/startuniversaltranscode.go new file mode 100644 index 0000000..68ef2a5 --- /dev/null +++ b/models/sdkerrors/startuniversaltranscode.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type StartUniversalTranscodeErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *StartUniversalTranscodeErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *StartUniversalTranscodeErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *StartUniversalTranscodeErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// StartUniversalTranscodeResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type StartUniversalTranscodeResponseBody struct { + Errors []StartUniversalTranscodeErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &StartUniversalTranscodeResponseBody{} + +func (e *StartUniversalTranscodeResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/stopalltasks.go b/models/sdkerrors/stopalltasks.go new file mode 100644 index 0000000..700d86b --- /dev/null +++ b/models/sdkerrors/stopalltasks.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type StopAllTasksErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *StopAllTasksErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *StopAllTasksErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *StopAllTasksErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// StopAllTasksResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type StopAllTasksResponseBody struct { + Errors []StopAllTasksErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &StopAllTasksResponseBody{} + +func (e *StopAllTasksResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/stoptask.go b/models/sdkerrors/stoptask.go new file mode 100644 index 0000000..ceb6d84 --- /dev/null +++ b/models/sdkerrors/stoptask.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type StopTaskErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *StopTaskErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *StopTaskErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *StopTaskErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// StopTaskResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type StopTaskResponseBody struct { + Errors []StopTaskErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &StopTaskResponseBody{} + +func (e *StopTaskResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/stoptranscodesession.go b/models/sdkerrors/stoptranscodesession.go new file mode 100644 index 0000000..a243a03 --- /dev/null +++ b/models/sdkerrors/stoptranscodesession.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type StopTranscodeSessionErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *StopTranscodeSessionErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *StopTranscodeSessionErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *StopTranscodeSessionErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// StopTranscodeSessionResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type StopTranscodeSessionResponseBody struct { + Errors []StopTranscodeSessionErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &StopTranscodeSessionResponseBody{} + +func (e *StopTranscodeSessionResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/updateplaylist.go b/models/sdkerrors/updateplaylist.go new file mode 100644 index 0000000..103cbfc --- /dev/null +++ b/models/sdkerrors/updateplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type UpdatePlaylistErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *UpdatePlaylistErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *UpdatePlaylistErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *UpdatePlaylistErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// UpdatePlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type UpdatePlaylistResponseBody struct { + Errors []UpdatePlaylistErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &UpdatePlaylistResponseBody{} + +func (e *UpdatePlaylistResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/updateplayprogress.go b/models/sdkerrors/updateplayprogress.go new file mode 100644 index 0000000..fd08fce --- /dev/null +++ b/models/sdkerrors/updateplayprogress.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type UpdatePlayProgressErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *UpdatePlayProgressErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *UpdatePlayProgressErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *UpdatePlayProgressErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// UpdatePlayProgressResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type UpdatePlayProgressResponseBody struct { + Errors []UpdatePlayProgressErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &UpdatePlayProgressResponseBody{} + +func (e *UpdatePlayProgressResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/models/sdkerrors/uploadplaylist.go b/models/sdkerrors/uploadplaylist.go new file mode 100644 index 0000000..cfc6165 --- /dev/null +++ b/models/sdkerrors/uploadplaylist.go @@ -0,0 +1,49 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package sdkerrors + +import ( + "encoding/json" + "net/http" +) + +type UploadPlaylistErrors struct { + Code *float64 `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Status *float64 `json:"status,omitempty"` +} + +func (o *UploadPlaylistErrors) GetCode() *float64 { + if o == nil { + return nil + } + return o.Code +} + +func (o *UploadPlaylistErrors) GetMessage() *string { + if o == nil { + return nil + } + return o.Message +} + +func (o *UploadPlaylistErrors) GetStatus() *float64 { + if o == nil { + return nil + } + return o.Status +} + +// UploadPlaylistResponseBody - Unauthorized - Returned if the X-Plex-Token is missing from the header or query. +type UploadPlaylistResponseBody struct { + Errors []UploadPlaylistErrors `json:"errors,omitempty"` + // Raw HTTP response; suitable for custom response parsing + RawResponse *http.Response `json:"-"` +} + +var _ error = &UploadPlaylistResponseBody{} + +func (e *UploadPlaylistResponseBody) Error() string { + data, _ := json.Marshal(e) + return string(data) +} diff --git a/playlists.go b/playlists.go new file mode 100644 index 0000000..e36c1b9 --- /dev/null +++ b/playlists.go @@ -0,0 +1,678 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). +// They can be organized in (optionally nesting) folders. +// Retrieving a playlist, or its items, will trigger a refresh of its metadata. +// This may cause the duration and number of items to change. +type Playlists struct { + sdkConfiguration sdkConfiguration +} + +func newPlaylists(sdkConfig sdkConfiguration) *Playlists { + return &Playlists{ + sdkConfiguration: sdkConfig, + } +} + +// CreatePlaylist - Create a Playlist +// Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass: +// - `uri` - The content URI for what we're playing (e.g. `library://...`). +// - `playQueueID` - To create a playlist from an existing play queue. +func (s *Playlists) CreatePlaylist(ctx context.Context, request operations.CreatePlaylistRequest) (*operations.CreatePlaylistResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/playlists" + + req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CreatePlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.CreatePlaylistResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetPlaylists - Get All Playlists +// Get All Playlists given the specified filters. +func (s *Playlists) GetPlaylists(ctx context.Context, playlistType *operations.PlaylistType, smart *operations.QueryParamSmart) (*operations.GetPlaylistsResponse, error) { + request := operations.GetPlaylistsRequest{ + PlaylistType: playlistType, + Smart: smart, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/playlists/all" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetPlaylistsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetPlaylistsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetPlaylist - Retrieve Playlist +// Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item: +// Smart playlist details contain the `content` attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing. +func (s *Playlists) GetPlaylist(ctx context.Context, playlistID float64) (*operations.GetPlaylistResponse, error) { + request := operations.GetPlaylistRequest{ + PlaylistID: playlistID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetPlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetPlaylistResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// DeletePlaylist - Deletes a Playlist +// This endpoint will delete a playlist +func (s *Playlists) DeletePlaylist(ctx context.Context, playlistID float64) (*operations.DeletePlaylistResponse, error) { + request := operations.DeletePlaylistRequest{ + PlaylistID: playlistID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.DeletePlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.DeletePlaylistResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// UpdatePlaylist - Update a Playlist +// From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via `PUT /library/metadata/{playlistID}` +func (s *Playlists) UpdatePlaylist(ctx context.Context, playlistID float64) (*operations.UpdatePlaylistResponse, error) { + request := operations.UpdatePlaylistRequest{ + PlaylistID: playlistID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.UpdatePlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.UpdatePlaylistResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetPlaylistContents - Retrieve Playlist Contents +// Gets the contents of a playlist. Should be paged by clients via standard mechanisms. +// By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the `type` parameter. +// For example, you could use this to display a list of recently added albums vis a smart playlist. +// Note that for dumb playlists, items have a `playlistItemID` attribute which is used for deleting or moving items. +func (s *Playlists) GetPlaylistContents(ctx context.Context, playlistID float64, type_ float64) (*operations.GetPlaylistContentsResponse, error) { + request := operations.GetPlaylistContentsRequest{ + PlaylistID: playlistID, + Type: type_, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetPlaylistContentsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetPlaylistContentsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ClearPlaylistContents - Delete Playlist Contents +// Clears a playlist, only works with dumb playlists. Returns the playlist. +func (s *Playlists) ClearPlaylistContents(ctx context.Context, playlistID float64) (*operations.ClearPlaylistContentsResponse, error) { + request := operations.ClearPlaylistContentsRequest{ + PlaylistID: playlistID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ClearPlaylistContentsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.ClearPlaylistContentsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// AddPlaylistContents - Adding to a Playlist +// Adds a generator to a playlist, same parameters as the POST above. With a dumb playlist, this adds the specified items to the playlist. +// With a smart playlist, passing a new `uri` parameter replaces the rules for the playlist. Returns the playlist. +func (s *Playlists) AddPlaylistContents(ctx context.Context, playlistID float64, uri string, playQueueID float64) (*operations.AddPlaylistContentsResponse, error) { + request := operations.AddPlaylistContentsRequest{ + PlaylistID: playlistID, + URI: uri, + PlayQueueID: playQueueID, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/playlists/{playlistID}/items", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.AddPlaylistContentsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.AddPlaylistContentsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// UploadPlaylist - Upload Playlist +// Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file. +func (s *Playlists) UploadPlaylist(ctx context.Context, path string, force operations.Force) (*operations.UploadPlaylistResponse, error) { + request := operations.UploadPlaylistRequest{ + Path: path, + Force: force, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/playlists/upload" + + req, err := http.NewRequestWithContext(ctx, "POST", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.UploadPlaylistResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.UploadPlaylistResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/plexapi.go b/plexapi.go new file mode 100644 index 0000000..64e4474 --- /dev/null +++ b/plexapi.go @@ -0,0 +1,312 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "context" + "encoding/json" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/components" + "net/http" + "time" +) + +// ServerList contains the list of servers available to the SDK +var ServerList = []string{ + // The full address of your Plex Server + "http://10.10.10.47:32400", + // The full address of your Plex Server + "{protocol}://{ip}:{port}", +} + +// HTTPClient provides an interface for suplying the SDK with a custom HTTP client +type HTTPClient interface { + Do(req *http.Request) (*http.Response, error) +} + +// String provides a helper function to return a pointer to a string +func String(s string) *string { return &s } + +// Bool provides a helper function to return a pointer to a bool +func Bool(b bool) *bool { return &b } + +// Int provides a helper function to return a pointer to an int +func Int(i int) *int { return &i } + +// Int64 provides a helper function to return a pointer to an int64 +func Int64(i int64) *int64 { return &i } + +// Float32 provides a helper function to return a pointer to a float32 +func Float32(f float32) *float32 { return &f } + +// Float64 provides a helper function to return a pointer to a float64 +func Float64(f float64) *float64 { return &f } + +type sdkConfiguration struct { + DefaultClient HTTPClient + SecurityClient HTTPClient + Security func(context.Context) (interface{}, error) + ServerURL string + ServerIndex int + ServerDefaults []map[string]string + Language string + OpenAPIDocVersion string + SDKVersion string + GenVersion string + UserAgent string + RetryConfig *utils.RetryConfig +} + +func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) { + if c.ServerURL != "" { + return c.ServerURL, nil + } + + return ServerList[c.ServerIndex], c.ServerDefaults[c.ServerIndex] +} + +// PlexAPI - Plex-API: A Plex Media Server API Map +// An Open API Spec for interacting with Plex.tv and Plex Servers +type PlexAPI struct { + // Operations against the Plex Media Server System. + // + Server *Server + // API Calls interacting with Plex Media Server Media + // + Media *Media + // Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints. + // Activities are associated with HTTP replies via a special `X-Plex-Activity` header which contains the UUID of the activity. + // Activities are optional cancellable. If cancellable, they may be cancelled via the `DELETE` endpoint. Other details: + // - They can contain a `progress` (from 0 to 100) marking the percent completion of the activity. + // - They must contain an `type` which is used by clients to distinguish the specific activity. + // - They may contain a `Context` object with attributes which associate the activity with various specific entities (items, libraries, etc.) + // - The may contain a `Response` object which attributes which represent the result of the asynchronous operation. + // + Activities *Activities + // Butler is the task manager of the Plex Media Server Ecosystem. + // + Butler *Butler + // Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows. + // + Hubs *Hubs + // API Calls that perform search operations with Plex Media Server + // + Search *Search + // API Calls interacting with Plex Media Server Libraries + // + Library *Library + // Submit logs to the Log Handler for Plex Media Server + // + Log *Log + // Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). + // They can be organized in (optionally nesting) folders. + // Retrieving a playlist, or its items, will trigger a refresh of its metadata. + // This may cause the duration and number of items to change. + // + Playlists *Playlists + // API Calls against Security for Plex Media Server + // + Security *Security + // API Calls that perform search operations with Plex Media Server Sessions + // + Sessions *Sessions + // This describes the API for searching and applying updates to the Plex Media Server. + // Updates to the status can be observed via the Event API. + // + Updater *Updater + // API Calls that perform operations with Plex Media Server Videos + // + Video *Video + + sdkConfiguration sdkConfiguration +} + +type SDKOption func(*PlexAPI) + +// WithServerURL allows the overriding of the default server URL +func WithServerURL(serverURL string) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.ServerURL = serverURL + } +} + +// WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters +func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption { + return func(sdk *PlexAPI) { + if params != nil { + serverURL = utils.ReplaceParameters(serverURL, params) + } + + sdk.sdkConfiguration.ServerURL = serverURL + } +} + +// WithServerIndex allows the overriding of the default server by index +func WithServerIndex(serverIndex int) SDKOption { + return func(sdk *PlexAPI) { + if serverIndex < 0 || serverIndex >= len(ServerList) { + panic(fmt.Errorf("server index %d out of range", serverIndex)) + } + + sdk.sdkConfiguration.ServerIndex = serverIndex + } +} + +// ServerProtocol - The protocol to use when connecting to your plex server. +type ServerProtocol string + +const ( + ServerProtocolHTTP ServerProtocol = "http" + ServerProtocolHTTPS ServerProtocol = "https" +) + +func (e ServerProtocol) ToPointer() *ServerProtocol { + return &e +} + +func (e *ServerProtocol) UnmarshalJSON(data []byte) error { + var v string + if err := json.Unmarshal(data, &v); err != nil { + return err + } + switch v { + case "http": + fallthrough + case "https": + *e = ServerProtocol(v) + return nil + default: + return fmt.Errorf("invalid value for ServerProtocol: %v", v) + } +} + +// WithProtocol allows setting the protocol variable for url substitution +func WithProtocol(protocol ServerProtocol) SDKOption { + return func(sdk *PlexAPI) { + for idx := range sdk.sdkConfiguration.ServerDefaults { + if _, ok := sdk.sdkConfiguration.ServerDefaults[idx]["protocol"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerDefaults[idx]["protocol"] = fmt.Sprintf("%v", protocol) + } + } +} + +// WithIP allows setting the ip variable for url substitution +func WithIP(ip string) SDKOption { + return func(sdk *PlexAPI) { + for idx := range sdk.sdkConfiguration.ServerDefaults { + if _, ok := sdk.sdkConfiguration.ServerDefaults[idx]["ip"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerDefaults[idx]["ip"] = fmt.Sprintf("%v", ip) + } + } +} + +// WithPort allows setting the port variable for url substitution +func WithPort(port string) SDKOption { + return func(sdk *PlexAPI) { + for idx := range sdk.sdkConfiguration.ServerDefaults { + if _, ok := sdk.sdkConfiguration.ServerDefaults[idx]["port"]; !ok { + continue + } + + sdk.sdkConfiguration.ServerDefaults[idx]["port"] = fmt.Sprintf("%v", port) + } + } +} + +// WithClient allows the overriding of the default HTTP client used by the SDK +func WithClient(client HTTPClient) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.DefaultClient = client + } +} + +func withSecurity(security interface{}) func(context.Context) (interface{}, error) { + return func(context.Context) (interface{}, error) { + return &security, nil + } +} + +// WithSecurity configures the SDK to use the provided security details +func WithSecurity(accessToken string) SDKOption { + return func(sdk *PlexAPI) { + security := components.Security{AccessToken: accessToken} + sdk.sdkConfiguration.Security = withSecurity(&security) + } +} + +func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption { + return func(sdk *PlexAPI) { + sdk.sdkConfiguration.RetryConfig = &retryConfig + } +} + +// New creates a new instance of the SDK with the provided options +func New(opts ...SDKOption) *PlexAPI { + sdk := &PlexAPI{ + sdkConfiguration: sdkConfiguration{ + Language: "go", + OpenAPIDocVersion: "0.0.3", + SDKVersion: "0.0.1", + GenVersion: "2.228.1", + UserAgent: "speakeasy-sdk/go 0.0.1 2.228.1 0.0.3 github.com/LukeHagar/plexgo", + ServerDefaults: []map[string]string{ + {}, + { + "protocol": "http", + "ip": "10.10.10.47", + "port": "32400", + }, + }, + }, + } + for _, opt := range opts { + opt(sdk) + } + + // Use WithClient to override the default client if you would like to customize the timeout + if sdk.sdkConfiguration.DefaultClient == nil { + sdk.sdkConfiguration.DefaultClient = &http.Client{Timeout: 60 * time.Second} + } + if sdk.sdkConfiguration.SecurityClient == nil { + if sdk.sdkConfiguration.Security != nil { + sdk.sdkConfiguration.SecurityClient = utils.ConfigureSecurityClient(sdk.sdkConfiguration.DefaultClient, sdk.sdkConfiguration.Security) + } else { + sdk.sdkConfiguration.SecurityClient = sdk.sdkConfiguration.DefaultClient + } + } + + sdk.Server = newServer(sdk.sdkConfiguration) + + sdk.Media = newMedia(sdk.sdkConfiguration) + + sdk.Activities = newActivities(sdk.sdkConfiguration) + + sdk.Butler = newButler(sdk.sdkConfiguration) + + sdk.Hubs = newHubs(sdk.sdkConfiguration) + + sdk.Search = newSearch(sdk.sdkConfiguration) + + sdk.Library = newLibrary(sdk.sdkConfiguration) + + sdk.Log = newLog(sdk.sdkConfiguration) + + sdk.Playlists = newPlaylists(sdk.sdkConfiguration) + + sdk.Security = newSecurity(sdk.sdkConfiguration) + + sdk.Sessions = newSessions(sdk.sdkConfiguration) + + sdk.Updater = newUpdater(sdk.sdkConfiguration) + + sdk.Video = newVideo(sdk.sdkConfiguration) + + return sdk +} diff --git a/search.go b/search.go new file mode 100644 index 0000000..d2f0e6e --- /dev/null +++ b/search.go @@ -0,0 +1,269 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Search - API Calls that perform search operations with Plex Media Server +type Search struct { + sdkConfiguration sdkConfiguration +} + +func newSearch(sdkConfig sdkConfiguration) *Search { + return &Search{ + sdkConfiguration: sdkConfig, + } +} + +// PerformSearch - Perform a search +// This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor). +// +// In the response's items, the following extra attributes are returned to further describe or disambiguate the result: +// +// - `reason`: The reason for the result, if not because of a direct search term match; can be either: +// - `section`: There are multiple identical results from different sections. +// - `originalTitle`: There was a search term match from the original title field (sometimes those can be very different or in a foreign language). +// - ``: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code of `artist` (the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason of `actor` +// +// - `reasonTitle`: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g. `Arnold Schwarzenegger` for movies which were returned because the search was for "arnold"). +// - `reasonID`: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID. +// +// This request is intended to be very fast, and called as the user types. +func (s *Search) PerformSearch(ctx context.Context, query string, sectionID *float64, limit *float64) (*operations.PerformSearchResponse, error) { + request := operations.PerformSearchRequest{ + Query: query, + SectionID: sectionID, + Limit: limit, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/hubs/search" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.PerformSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.PerformSearchResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// PerformVoiceSearch - Perform a voice search +// This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the `/hubs/search` endpoint. +// It uses a [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) heuristic to search titles, and as such is much slower than the other search endpoint. +// Whenever possible, clients should limit the search to the appropriate type. +// Results, as well as their containing per-type hubs, contain a `distance` attribute which can be used to judge result quality. +func (s *Search) PerformVoiceSearch(ctx context.Context, query string, sectionID *float64, limit *float64) (*operations.PerformVoiceSearchResponse, error) { + request := operations.PerformVoiceSearchRequest{ + Query: query, + SectionID: sectionID, + Limit: limit, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/hubs/search/voice" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.PerformVoiceSearchResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.PerformVoiceSearchResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetSearchResults - Get Search Results +// This will search the database for the string provided. +func (s *Search) GetSearchResults(ctx context.Context, query string) (*operations.GetSearchResultsResponse, error) { + request := operations.GetSearchResultsRequest{ + Query: query, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/search" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetSearchResultsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetSearchResultsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetSearchResultsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/security.go b/security.go new file mode 100644 index 0000000..7515fb9 --- /dev/null +++ b/security.go @@ -0,0 +1,170 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Security - API Calls against Security for Plex Media Server +type Security struct { + sdkConfiguration sdkConfiguration +} + +func newSecurity(sdkConfig sdkConfiguration) *Security { + return &Security{ + sdkConfiguration: sdkConfig, + } +} + +// GetTransientToken - Get a Transient Token. +// This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted. +func (s *Security) GetTransientToken(ctx context.Context, type_ operations.QueryParamType, scope operations.Scope) (*operations.GetTransientTokenResponse, error) { + request := operations.GetTransientTokenRequest{ + Type: type_, + Scope: scope, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/security/token" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetTransientTokenResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetTransientTokenResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetSourceConnectionInformation - Get Source Connection Information +// If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. +// Note: requires Plex Media Server >= 1.15.4. +func (s *Security) GetSourceConnectionInformation(ctx context.Context, source string) (*operations.GetSourceConnectionInformationResponse, error) { + request := operations.GetSourceConnectionInformationRequest{ + Source: source, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/security/resources" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetSourceConnectionInformationResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetSourceConnectionInformationResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/server.go b/server.go new file mode 100644 index 0000000..986051a --- /dev/null +++ b/server.go @@ -0,0 +1,600 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Server - Operations against the Plex Media Server System. +type Server struct { + sdkConfiguration sdkConfiguration +} + +func newServer(sdkConfig sdkConfiguration) *Server { + return &Server{ + sdkConfiguration: sdkConfig, + } +} + +// GetServerCapabilities - Server Capabilities +// Server Capabilities +func (s *Server) GetServerCapabilities(ctx context.Context) (*operations.GetServerCapabilitiesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetServerCapabilitiesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetServerCapabilitiesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetServerCapabilitiesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetServerPreferences - Get Server Preferences +// Get Server Preferences +func (s *Server) GetServerPreferences(ctx context.Context) (*operations.GetServerPreferencesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/:/prefs" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetServerPreferencesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetServerPreferencesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetAvailableClients - Get Available Clients +// Get Available Clients +func (s *Server) GetAvailableClients(ctx context.Context) (*operations.GetAvailableClientsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/clients" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetAvailableClientsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out []operations.ResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.ResponseBodies = out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetAvailableClientsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetDevices - Get Devices +// Get Devices +func (s *Server) GetDevices(ctx context.Context) (*operations.GetDevicesResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/devices" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetDevicesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetDevicesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetDevicesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetServerIdentity - Get Server Identity +// Get Server Identity +func (s *Server) GetServerIdentity(ctx context.Context) (*operations.GetServerIdentityResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/identity" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetServerIdentityResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetServerIdentityResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetServerIdentityResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetMyPlexAccount - Get MyPlex Account +// Returns MyPlex Account Information +func (s *Server) GetMyPlexAccount(ctx context.Context) (*operations.GetMyPlexAccountResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/myplex/account" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetMyPlexAccountResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetMyPlexAccountResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetMyPlexAccountResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetResizedPhoto - Get a Resized Photo +// Plex's Photo transcoder is used throughout the service to serve images at specified sizes. +func (s *Server) GetResizedPhoto(ctx context.Context, request operations.GetResizedPhotoRequest) (*operations.GetResizedPhotoResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/photo/:/transcode" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetResizedPhotoResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetResizedPhotoResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetServerList - Get Server List +// Get Server List +func (s *Server) GetServerList(ctx context.Context) (*operations.GetServerListResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/servers" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetServerListResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetServerListResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetServerListResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/sessions.go b/sessions.go new file mode 100644 index 0000000..5b60f26 --- /dev/null +++ b/sessions.go @@ -0,0 +1,296 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Sessions - API Calls that perform search operations with Plex Media Server Sessions +type Sessions struct { + sdkConfiguration sdkConfiguration +} + +func newSessions(sdkConfig sdkConfiguration) *Sessions { + return &Sessions{ + sdkConfiguration: sdkConfig, + } +} + +// GetSessions - Get Active Sessions +// This will retrieve the "Now Playing" Information of the PMS. +func (s *Sessions) GetSessions(ctx context.Context) (*operations.GetSessionsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/status/sessions" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetSessionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetSessionsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetSessionHistory - Get Session History +// This will Retrieve a listing of all history views. +func (s *Sessions) GetSessionHistory(ctx context.Context) (*operations.GetSessionHistoryResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/status/sessions/history/all" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetSessionHistoryResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetSessionHistoryResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetTranscodeSessions - Get Transcode Sessions +// Get Transcode Sessions +func (s *Sessions) GetTranscodeSessions(ctx context.Context) (*operations.GetTranscodeSessionsResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/transcode/sessions" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetTranscodeSessionsResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out operations.GetTranscodeSessionsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + + res.Object = &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetTranscodeSessionsResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// StopTranscodeSession - Stop a Transcode Session +// Stop a Transcode Session +func (s *Sessions) StopTranscodeSession(ctx context.Context, sessionKey string) (*operations.StopTranscodeSessionResponse, error) { + request := operations.StopTranscodeSessionRequest{ + SessionKey: sessionKey, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url, err := utils.GenerateURL(ctx, baseURL, "/transcode/sessions/{sessionKey}", request, nil) + if err != nil { + return nil, fmt.Errorf("error generating URL: %w", err) + } + + req, err := http.NewRequestWithContext(ctx, "DELETE", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.StopTranscodeSessionResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.StopTranscodeSessionResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/types/bigint.go b/types/bigint.go new file mode 100644 index 0000000..afd0cd2 --- /dev/null +++ b/types/bigint.go @@ -0,0 +1,21 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import ( + "fmt" + "math/big" +) + +// MustNewBigIntFromString returns an instance of big.Int from a string +// The string is assumed to be base 10 and if it is not a valid big.Int +// then the function panics. +// Avoid using this function in production code. +func MustNewBigIntFromString(s string) *big.Int { + i, ok := new(big.Int).SetString(s, 10) + if !ok { + panic(fmt.Errorf("failed to parse string as big.Int")) + } + + return i +} diff --git a/types/date.go b/types/date.go new file mode 100644 index 0000000..c4648fa --- /dev/null +++ b/types/date.go @@ -0,0 +1,90 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import ( + "encoding/json" + "fmt" + "strings" + "time" +) + +// Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02". +type Date struct { + time.Time +} + +var ( + _ json.Marshaler = &Date{} + _ json.Unmarshaler = &Date{} + _ fmt.Stringer = &Date{} +) + +// NewDate returns an instance of Date from a time.Time. +func NewDate(t time.Time) *Date { + d := DateFromTime(t) + return &d +} + +// DateFromTime returns a Date from a time.Time. +func DateFromTime(t time.Time) Date { + return Date{t} +} + +// NewDateFromString returns an instance of Date from a string formatted as "2006-01-02". +func NewDateFromString(str string) (*Date, error) { + d, err := DateFromString(str) + if err != nil { + return nil, err + } + + return &d, nil +} + +// DateFromString returns a Date from a string formatted as "2006-01-02". +func DateFromString(str string) (Date, error) { + var d Date + var err error + + d.Time, err = time.Parse("2006-01-02", str) + return d, err +} + +// MustNewDateFromString returns an instance of Date from a string formatted as "2006-01-02" or panics. +// Avoid using this function in production code. +func MustNewDateFromString(str string) *Date { + d := MustDateFromString(str) + return &d +} + +// MustDateFromString returns a Date from a string formatted as "2006-01-02" or panics. +// Avoid using this function in production code. +func MustDateFromString(str string) Date { + d, err := DateFromString(str) + if err != nil { + panic(err) + } + return d +} + +func (d Date) GetTime() time.Time { + return d.Time +} + +func (d Date) MarshalJSON() ([]byte, error) { + return []byte(fmt.Sprintf(`"%s"`, d.Time.Format("2006-01-02"))), nil +} + +func (d *Date) UnmarshalJSON(data []byte) error { + var err error + + str := string(data) + str = strings.Trim(str, `"`) + + d.Time, err = time.Parse("2006-01-02", str) + return err +} + +func (d Date) String() string { + return d.Time.Format("2006-01-02") +} diff --git a/types/datetime.go b/types/datetime.go new file mode 100644 index 0000000..0529b25 --- /dev/null +++ b/types/datetime.go @@ -0,0 +1,23 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import "time" + +// MustTimeFromString returns a time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. +// Avoid using this function in production code. +func MustTimeFromString(str string) time.Time { + t, err := time.Parse(time.RFC3339, str) + if err != nil { + panic(err) + } + + return t +} + +// MustNewTimeFromString returns an instance of time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. +// Avoid using this function in production code. +func MustNewTimeFromString(str string) *time.Time { + t := MustTimeFromString(str) + return &t +} diff --git a/types/decimal.go b/types/decimal.go new file mode 100644 index 0000000..a42284b --- /dev/null +++ b/types/decimal.go @@ -0,0 +1,20 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +import ( + "fmt" + + "github.com/ericlagergren/decimal" +) + +// MustNewDecimalFromString returns an instance of Decimal from a string +// Avoid using this function in production code. +func MustNewDecimalFromString(s string) *decimal.Big { + d, ok := new(decimal.Big).SetString(s) + if !ok { + panic(fmt.Errorf("failed to parse string as decimal.Big")) + } + + return d +} diff --git a/types/pointers.go b/types/pointers.go new file mode 100644 index 0000000..4f15e99 --- /dev/null +++ b/types/pointers.go @@ -0,0 +1,10 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package types + +func String(s string) *string { return &s } +func Bool(b bool) *bool { return &b } +func Int(i int) *int { return &i } +func Int64(i int64) *int64 { return &i } +func Float32(f float32) *float32 { return &f } +func Float64(f float64) *float64 { return &f } diff --git a/updater.go b/updater.go new file mode 100644 index 0000000..2c771db --- /dev/null +++ b/updater.go @@ -0,0 +1,235 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Updater - This describes the API for searching and applying updates to the Plex Media Server. +// Updates to the status can be observed via the Event API. +type Updater struct { + sdkConfiguration sdkConfiguration +} + +func newUpdater(sdkConfig sdkConfiguration) *Updater { + return &Updater{ + sdkConfiguration: sdkConfig, + } +} + +// GetUpdateStatus - Querying status of updates +// Querying status of updates +func (s *Updater) GetUpdateStatus(ctx context.Context) (*operations.GetUpdateStatusResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/updater/status" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetUpdateStatusResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetUpdateStatusResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// CheckForUpdates - Checking for updates +// Checking for updates +func (s *Updater) CheckForUpdates(ctx context.Context, download *operations.Download) (*operations.CheckForUpdatesResponse, error) { + request := operations.CheckForUpdatesRequest{ + Download: download, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/updater/check" + + req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.CheckForUpdatesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.CheckForUpdatesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// ApplyUpdates - Apply Updates +// Note that these two parameters are effectively mutually exclusive. The `tonight` parameter takes precedence and `skip` will be ignored if `tonight` is also passed +func (s *Updater) ApplyUpdates(ctx context.Context, tonight *operations.Tonight, skip *operations.Skip) (*operations.ApplyUpdatesResponse, error) { + request := operations.ApplyUpdatesRequest{ + Tonight: tonight, + Skip: skip, + } + + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/updater/apply" + + req, err := http.NewRequestWithContext(ctx, "PUT", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.ApplyUpdatesResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode == 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.ApplyUpdatesResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} diff --git a/video.go b/video.go new file mode 100644 index 0000000..907af45 --- /dev/null +++ b/video.go @@ -0,0 +1,160 @@ +// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT. + +package plexgo + +import ( + "bytes" + "context" + "fmt" + "github.com/LukeHagar/plexgo/internal/utils" + "github.com/LukeHagar/plexgo/models/operations" + "github.com/LukeHagar/plexgo/models/sdkerrors" + "io" + "net/http" + "strings" +) + +// Video - API Calls that perform operations with Plex Media Server Videos +type Video struct { + sdkConfiguration sdkConfiguration +} + +func newVideo(sdkConfig sdkConfiguration) *Video { + return &Video{ + sdkConfiguration: sdkConfig, + } +} + +// StartUniversalTranscode - Start Universal Transcode +// Begin a Universal Transcode Session +func (s *Video) StartUniversalTranscode(ctx context.Context, request operations.StartUniversalTranscodeRequest) (*operations.StartUniversalTranscodeResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/video/:/transcode/universal/start.mpd" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.StartUniversalTranscodeResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.StartUniversalTranscodeResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +} + +// GetTimeline - Get the timeline for a media item +// Get the timeline for a media item +func (s *Video) GetTimeline(ctx context.Context, request operations.GetTimelineRequest) (*operations.GetTimelineResponse, error) { + baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + url := strings.TrimSuffix(baseURL, "/") + "/:/timeline" + + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, fmt.Errorf("error creating request: %w", err) + } + req.Header.Set("Accept", "application/json") + req.Header.Set("user-agent", s.sdkConfiguration.UserAgent) + + if err := utils.PopulateQueryParams(ctx, req, request, nil); err != nil { + return nil, fmt.Errorf("error populating query params: %w", err) + } + + client := s.sdkConfiguration.SecurityClient + + httpRes, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("error sending request: %w", err) + } + if httpRes == nil { + return nil, fmt.Errorf("error sending request: no response") + } + + contentType := httpRes.Header.Get("Content-Type") + + res := &operations.GetTimelineResponse{ + StatusCode: httpRes.StatusCode, + ContentType: contentType, + RawResponse: httpRes, + } + + rawBody, err := io.ReadAll(httpRes.Body) + if err != nil { + return nil, fmt.Errorf("error reading response body: %w", err) + } + httpRes.Body.Close() + httpRes.Body = io.NopCloser(bytes.NewBuffer(rawBody)) + switch { + case httpRes.StatusCode == 200: + case httpRes.StatusCode == 400: + fallthrough + case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500: + fallthrough + case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600: + return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes) + case httpRes.StatusCode == 401: + switch { + case utils.MatchContentType(contentType, `application/json`): + var out sdkerrors.GetTimelineResponseBody + if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil { + return nil, err + } + out.RawResponse = httpRes + + return nil, &out + default: + return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes) + } + } + + return res, nil +}